@antscorp/antsomi-ui 1.3.3-beta.92 → 1.3.3-beta.94

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.
@@ -31,9 +31,9 @@ export { Alert } from './Alert';
31
31
  export { ScrollBox } from './ScrollBox';
32
32
  export { Rate } from './Rate';
33
33
  export { SliderV2 } from './SliderV2';
34
+ export { InputDynamic } from './InputDynamic';
34
35
  export * from './Flex';
35
36
  export * from './RateV2';
36
- export { InputDynamic } from './InputDynamic';
37
37
  export * from './PreviewTabs';
38
38
  export * from './MobileFrame';
39
39
  export * from './SlideBar';
@@ -31,9 +31,9 @@ export { Alert } from './Alert';
31
31
  export { ScrollBox } from './ScrollBox';
32
32
  export { Rate } from './Rate';
33
33
  export { SliderV2 } from './SliderV2';
34
+ export { InputDynamic } from './InputDynamic';
34
35
  export * from './Flex';
35
36
  export * from './RateV2';
36
- export { InputDynamic } from './InputDynamic';
37
37
  export * from './PreviewTabs';
38
38
  export * from './MobileFrame';
39
39
  export * from './SlideBar';
@@ -307,7 +307,7 @@ export const AdvancedPicker = props => {
307
307
  };
308
308
  return (React.createElement("div", { style: contentStyle, ref: ref },
309
309
  React.createElement(DropdownHeader, { className: "dropdown-header" },
310
- React.createElement(DropdownLabel, { valueType: valueType, date: date, format: format, type: type, showTime: showTime, operatorKey: operatorKey, formatInputDisplay: formatInputDisplay, dateType: option.dateType.value })),
310
+ React.createElement(DropdownLabel, { valueType: valueType, date: date, format: format, type: type, showTime: showTime, operatorKey: operatorKey, formatInputDisplay: formatInputDisplay })),
311
311
  React.createElement(DropdownContent, { className: "dropdown-content" },
312
312
  renderDateTypeOptions(),
313
313
  option.dateType.value === 'fixed' ? (React.createElement(React.Fragment, null,
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { TAdvancedType, TDateType, TOperatorKey, ValueTypes } from '../AdvancedPicker/types';
2
+ import { TAdvancedType, TOperatorKey, ValueTypes } from '../AdvancedPicker/types';
3
3
  interface DropdownLabelProps {
4
4
  valueType?: ValueTypes;
5
5
  date?: string;
@@ -8,7 +8,6 @@ interface DropdownLabelProps {
8
8
  showTime?: boolean;
9
9
  operatorKey?: TOperatorKey;
10
10
  formatInputDisplay?: string;
11
- dateType?: TDateType;
12
11
  }
13
12
  export declare const DropdownLabel: React.FC<DropdownLabelProps>;
14
13
  export {};
@@ -8,7 +8,7 @@ import { ADVANCED_PICKER_TYPE, DEFAULT_DATE_FORMAT, HIDE_TIME_LABEL_ARR, QUARTER
8
8
  // Instance
9
9
  import i18nInstance from '@antscorp/antsomi-ui/es/locales/i18n';
10
10
  import { getFormatDisplay, getLabelQuarterRange } from '../AdvancedPicker/utils';
11
- export const DropdownLabel = React.memo(({ valueType, date, format, type, showTime, operatorKey, formatInputDisplay, dateType }) => {
11
+ export const DropdownLabel = React.memo(({ valueType, date, format, type, showTime, operatorKey, formatInputDisplay }) => {
12
12
  var _a;
13
13
  const { t } = i18nInstance;
14
14
  const title = (_a = Object.values(ADVANCED_PICKER_TYPE).find(({ value }) => value === type)) === null || _a === void 0 ? void 0 : _a.label;
@@ -31,11 +31,14 @@ export const DropdownLabel = React.memo(({ valueType, date, format, type, showTi
31
31
  const dayObj = dayjs(date || new Date(), format).locale('en');
32
32
  // const dayObj = dayjs(date || new Date(), format).locale(locale || 'en');
33
33
  formatLabel = `${WEEK_PLACEHOLDER}W, YYYY`;
34
- subLabel = `${dayjs(dayObj)
35
- .day(['today', 'first_day_of_week_mon_sun'].includes(dateType || '') ? 1 : 0)
36
- .format('MMMM DD, YYYY')} - ${dayjs(dayObj)
37
- .day(['today', 'first_day_of_week_mon_sun'].includes(dateType || '') ? 7 : 6)
34
+ subLabel = `${dayjs(dayObj).day(0).format('MMMM DD, YYYY')} - ${dayjs(dayObj)
35
+ .day(6)
38
36
  .format('MMMM DD, YYYY')}`;
37
+ // subLabel = `${dayjs(dayObj)
38
+ // .day(['today', 'first_day_of_week_mon_sun'].includes(dateType || '') ? 1 : 0)
39
+ // .format('MMMM DD, YYYY')} - ${dayjs(dayObj)
40
+ // .day(['today', 'first_day_of_week_mon_sun'].includes(dateType || '') ? 7 : 6)
41
+ // .format('MMMM DD, YYYY')}`;
39
42
  break;
40
43
  }
41
44
  case 'YEAR_MONTH_DAY_HOUR':
@@ -71,7 +71,7 @@ export const EditorScript = props => {
71
71
  transform: 'scaleX(-1)',
72
72
  } }),
73
73
  t(translations.expandEditor.title)))),
74
- React.createElement(Modal, { visible: isExpandEditor, title: expandModalLabel, onCancel: onCancelModal, centered: true, width: 1000, footer: React.createElement(Button, { onClick: onCancelModal }, t(translations.close)) }, renderAceEditor('500px'))));
74
+ React.createElement(Modal, { visible: isExpandEditor, title: expandModalLabel, onCancel: onCancelModal, centered: true, width: 1000, footer: React.createElement(Button, { onClick: onCancelModal }, t(translations.close.title)) }, renderAceEditor('500px'))));
75
75
  };
76
76
  EditorScript.defaultProps = {
77
77
  expandModalLabel: 'Editor Script',
@@ -25,6 +25,6 @@ export const PreviewModal = props => {
25
25
  React.createElement(ModalHeader, { className: modalHeaderClassName },
26
26
  React.createElement(Button, { className: "close-btn", onClick: onCancel },
27
27
  React.createElement(Icon, { type: "icon-ants-remove-slim", size: 12 }),
28
- t(translations.close))),
28
+ t(translations.close.title))),
29
29
  React.createElement(ModalBody, { className: modalBodyClassName }, children)));
30
30
  };
@@ -11,7 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  /* eslint-disable @typescript-eslint/no-use-before-define */
12
12
  /* eslint-disable react-hooks/exhaustive-deps */
13
13
  // Libraries
14
- import React, { lazy, Suspense, useEffect, useState, useRef } from 'react';
14
+ import React, { lazy, useEffect, useState, useRef } from 'react';
15
15
  import Upload from 'antd/lib/upload';
16
16
  // Hooks
17
17
  import { useDeepCompareEffect } from '@antscorp/antsomi-ui/es/hooks';
@@ -136,8 +136,7 @@ export const UploadImage = props => {
136
136
  var _a;
137
137
  return (React.createElement(WrapperListImages, { className: "ants-group", key: idx },
138
138
  React.createElement(Boxed, null,
139
- React.createElement(Suspense, { fallback: React.createElement(Image, { src: PlaceholderImage, alt: "fallback image" }) },
140
- React.createElement(LazyThumbnail, { mode: mode, media: media })),
139
+ React.createElement(Image, { src: mode === 'video' ? media.thumbnail : media.url, alt: "img", loading: "lazy" }),
141
140
  React.createElement(WrapperBtn, { className: "group-hover" },
142
141
  React.createElement(Button, { onClick: () => handleSelectMedia(media), style: { backgroundColor: 'rgb(255,255,255)' } }, "USE"),
143
142
  React.createElement(Button, { onClick: () => handleRemoveUploadedMedia(media), style: { backgroundColor: 'rgb(255,255,255)' } },
@@ -249,6 +248,7 @@ export const UploadImage = props => {
249
248
  name: data.fileName,
250
249
  properties: {
251
250
  url: data.url,
251
+ thumbnail: data.thumbnail || '',
252
252
  file: data.file,
253
253
  extension: data.extension,
254
254
  dimensions_file: data.dimensionsFile,
@@ -14,8 +14,8 @@
14
14
  "firstDayOfMonth": "First day of this month",
15
15
  "firstDayOfQuarter": "First day of this quarter",
16
16
  "firstDayOfYear": "First day of this year",
17
- "lastDayOfWeekMonSun": "Last day of this week (Mon - Sun)",
18
- "lastDayOfWeekSunSat": "Last day of this week (Sun - Sat)",
17
+ "lastDayOfWeekMonSun": "First day of this week (Mon - Sun)",
18
+ "lastDayOfWeekSunSat": "First day of this week (Sun - Sat)",
19
19
  "lastDayOfMonth": "Last day of this month",
20
20
  "lastDayOfQuarter": "Last day of this quarter",
21
21
  "lastDayOfYear": "Last day of this year",
@@ -34,6 +34,10 @@
34
34
  "title": "Edit",
35
35
  "description": ""
36
36
  },
37
+ "close": {
38
+ "title": "Close",
39
+ "description": ""
40
+ },
37
41
  "duplicate": {
38
42
  "title": "Duplicate"
39
43
  },
@@ -224,6 +228,5 @@
224
228
  "ninth": "Ninth",
225
229
  "tenth": "Tenth"
226
230
  },
227
- "close": "Close",
228
231
  "cellAction": "Click to add image"
229
232
  }
@@ -36,6 +36,10 @@ export declare const translationsJson: {
36
36
  title: string;
37
37
  description: string;
38
38
  };
39
+ close: {
40
+ title: string;
41
+ description: string;
42
+ };
39
43
  duplicate: {
40
44
  title: string;
41
45
  };
@@ -226,7 +230,6 @@ export declare const translationsJson: {
226
230
  ninth: string;
227
231
  tenth: string;
228
232
  };
229
- close: string;
230
233
  cellAction: string;
231
234
  };
232
235
  };
@@ -36,6 +36,10 @@ export declare const convertLanguageJsonToObject: (json: any, objToConvertTo?: C
36
36
  title: string;
37
37
  description: string;
38
38
  };
39
+ close: {
40
+ title: string;
41
+ description: string;
42
+ };
39
43
  duplicate: {
40
44
  title: string;
41
45
  };
@@ -226,7 +230,6 @@ export declare const convertLanguageJsonToObject: (json: any, objToConvertTo?: C
226
230
  ninth: string;
227
231
  tenth: string;
228
232
  };
229
- close: string;
230
233
  cellAction: string;
231
234
  }>, current?: string) => void;
232
235
  export declare const t: (id: string, ...rest: any[]) => [string, ...any[]];
@@ -6,6 +6,7 @@ export type TSavedMedia = {
6
6
  name: string;
7
7
  properties: {
8
8
  url: string;
9
+ thumbnail: string;
9
10
  size: number;
10
11
  file: {
11
12
  path: string;
@@ -26,6 +27,7 @@ export declare class SavedMedia extends Model<TSavedMedia> {
26
27
  get id(): string;
27
28
  get name(): string;
28
29
  get url(): string;
30
+ get thumbnail(): string;
29
31
  get createdAt(): moment.Moment | null;
30
32
  get size(): number;
31
33
  get sizeString(): string;
@@ -11,6 +11,10 @@ export class SavedMedia extends Model {
11
11
  var _a;
12
12
  return ((_a = this.model.properties) === null || _a === void 0 ? void 0 : _a.url) || '';
13
13
  }
14
+ get thumbnail() {
15
+ var _a;
16
+ return ((_a = this.model.properties) === null || _a === void 0 ? void 0 : _a.thumbnail) || '';
17
+ }
14
18
  get createdAt() {
15
19
  return moment(this.model.ctime, true).isValid() ? moment(this.model.ctime) : null;
16
20
  }
@@ -1,6 +1,7 @@
1
1
  import { Model } from './model';
2
2
  type TUpload = {
3
3
  url: string;
4
+ thumbnail: string;
4
5
  file: {
5
6
  path: string;
6
7
  };
@@ -20,6 +21,7 @@ export declare class Upload extends Model<TUpload> {
20
21
  path: string;
21
22
  } | undefined;
22
23
  get url(): string;
24
+ get thumbnail(): string | undefined;
23
25
  get extension(): string;
24
26
  get dimensionsFile(): {
25
27
  height: number;
@@ -9,6 +9,9 @@ export class Upload extends Model {
9
9
  get url() {
10
10
  return this.model.url || '';
11
11
  }
12
+ get thumbnail() {
13
+ return this.model.thumbnail;
14
+ }
12
15
  get extension() {
13
16
  return this.model.extension || '';
14
17
  }
@@ -78,6 +78,7 @@ export const uploadFile = (domainUrl, slug, infos, files) => __awaiter(void 0, v
78
78
  ? uploadData.map((file) => new Upload({
79
79
  url: file.url,
80
80
  file: file.file,
81
+ thumbnail: file.thumbnail || '',
81
82
  extension: file.extension,
82
83
  dimensions_file: file.dimensions_file,
83
84
  size: file.size,
package/es/test.js CHANGED
@@ -157,6 +157,29 @@ export const App = () => {
157
157
  // previewUrl: '',
158
158
  // });
159
159
  } })))));
160
+ // --------------------------- Test SlideBar end -------------------------------------------
161
+ // ---------------------------- Test Input Dynamic start ------------------------------
162
+ // return (
163
+ // <div
164
+ // style={{
165
+ // width: 500,
166
+ // height: 500,
167
+ // border: '1px solid black',
168
+ // margin: '0 auto',
169
+ // padding: 12,
170
+ // borderRadius: '10px',
171
+ // }}
172
+ // >
173
+ // <InputDynamic
174
+ // errors={[]}
175
+ // onChange={dataOut => setValueShortlink(dataOut)}
176
+ // onError={() => {}}
177
+ // isViewMode={false}
178
+ // canMultipleLine={false}
179
+ // value={valueShortlink}
180
+ // />
181
+ // </div>
182
+ // );
160
183
  // ---------------------------- Test Input Dynamic End ------------------------------
161
184
  // ---------------------------- Test Helps Start ------------------------------
162
185
  // return (
@@ -14,10 +14,10 @@ export type TConfigErrorInfo = {
14
14
  priority?: 'low' | 'medium' | 'high';
15
15
  from?: 'try-catch' | 'error-boundary';
16
16
  };
17
+ export * from './richMenu';
18
+ export * from './variables';
17
19
  export type PayloadInfo = {
18
20
  userId?: string;
19
21
  token?: string;
20
22
  accountId?: string;
21
23
  };
22
- export * from './richMenu';
23
- export * from './variables';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.3-beta.92",
3
+ "version": "1.3.3-beta.94",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",