pds-dev-kit-web-test 2.5.224 → 2.5.225

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 (48) hide show
  1. package/dist/src/common/assets/icons/fill/Duplicate.d.ts +4 -0
  2. package/dist/src/common/assets/icons/fill/Duplicate.js +30 -0
  3. package/dist/src/common/assets/icons/fill/index.d.ts +1 -0
  4. package/dist/src/common/assets/icons/fill/index.js +3 -1
  5. package/dist/src/common/assets/icons/line/Duplicate.d.ts +4 -0
  6. package/dist/src/common/assets/icons/line/Duplicate.js +30 -0
  7. package/dist/src/common/assets/icons/line/index.d.ts +1 -0
  8. package/dist/src/common/assets/icons/line/index.js +3 -1
  9. package/dist/src/common/services/i18n/resources/en.json +2 -1
  10. package/dist/src/common/services/i18n/resources/es.json +2 -1
  11. package/dist/src/common/services/i18n/resources/fil.json +2 -1
  12. package/dist/src/common/services/i18n/resources/index.d.ts +7 -0
  13. package/dist/src/common/services/i18n/resources/ja.json +2 -1
  14. package/dist/src/common/services/i18n/resources/ko.json +2 -1
  15. package/dist/src/common/services/i18n/resources/zh-cn.json +2 -1
  16. package/dist/src/common/services/i18n/resources/zh-tw.json +2 -1
  17. package/dist/src/desktop/components/MainButton/MainButton.js +16 -10
  18. package/dist/src/sub/DynamicLayout/mock_samplePage.js +133 -133
  19. package/dist/src/sub/DynamicLayout/mock_storybook.js +2 -2
  20. package/dist/src/sub/DynamicLayout/mocks.d.ts +1111 -0
  21. package/dist/src/sub/DynamicLayout/mocks.js +4775 -0
  22. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.js +22 -22
  23. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.js +2 -2
  24. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/types.d.ts +78 -1
  25. package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGoogleFonts/getGoogleFonts.d.ts +2 -4
  26. package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGoogleFonts/getGoogleFonts.js +3 -14
  27. package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGoogleFonts/index.d.ts +1 -1
  28. package/dist/src/sub/DynamicLayout/sections/CustomSection/hooks/useGoogleFonts/index.js +2 -3
  29. package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/colorUtil.d.ts +4 -4
  30. package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/fontSizeAdjustment.d.ts +1 -0
  31. package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/fontSizeAdjustment.js +333 -0
  32. package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/replaceUndefinedValues.js +8 -1
  33. package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/textUtil.d.ts +1 -6
  34. package/dist/src/sub/DynamicLayout/sections/CustomSection/newUtils/textUtil.js +1 -0
  35. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/parseStylePropTextSpec.d.ts +1 -1
  36. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/types.d.ts +1 -1
  37. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/stylePropParsers/types.js +1 -1
  38. package/dist/src/sub/DynamicLayout/sections/CustomSection/util/types.d.ts +3 -5
  39. package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateA/desktop/components/MembershipPlanSheet.js +1 -1
  40. package/dist/src/sub/DynamicLayout/sections/MembershipSection/EditType/templates/TemplateB/desktop/components/MembershipPlanSheet.js +1 -1
  41. package/package.json +1 -1
  42. package/release-note.md +3 -2
  43. package/dist/src/sub/DynamicLayout/pagesPreviewMock.d.ts +0 -14118
  44. package/dist/src/sub/DynamicLayout/pagesPreviewMock.js +0 -35988
  45. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/btnTypes.d.ts +0 -76
  46. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/btnTypes.js +0 -2
  47. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/types.d.ts +0 -38
  48. package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/types.js +0 -2
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import type IconType from '../IconType';
3
+ declare const Duplicate: ({ color, size, ...rest }: IconType) => JSX.Element;
4
+ export default Duplicate;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ var jsx_runtime_1 = require("react/jsx-runtime");
26
+ var Duplicate = function (_a) {
27
+ var color = _a.color, size = _a.size, rest = __rest(_a, ["color", "size"]);
28
+ return ((0, jsx_runtime_1.jsx)("svg", __assign({ width: size, height: size, viewBox: "0 0 24 24" }, rest, { children: (0, jsx_runtime_1.jsx)("path", { fill: color, fillRule: "evenodd", d: "M14.6161,2.2106 C16.2711,2.2106 17.6161,3.5556 17.6161,5.2106 L17.6161,5.4256 L18.1571,5.4256 C19.5911,5.4256 20.7571,6.5916 20.7571,8.0256 L20.7571,19.0486 C20.7571,20.4266 19.6351,21.5486 18.2571,21.5486 L8.9701,21.5486 C7.5371,21.5486 6.3701,20.3816 6.3701,18.9486 L6.3701,18.3336 L6.2291,18.3336 C4.5751,18.3336 3.2291,16.9876 3.2291,15.3336 L3.2291,5.2106 C3.2291,3.5556 4.5751,2.2106 6.2291,2.2106 Z M18.1571,7.4256 L12.0181,7.4256 L12.0181,9.8646 C12.0181,10.4716 11.5261,10.9636 10.9191,10.9636 L8.3701,10.9646 L8.3701,18.9486 C8.3701,19.2796 8.6391,19.5486 8.9701,19.5486 L18.2571,19.5486 C18.5331,19.5486 18.7571,19.3246 18.7571,19.0486 L18.7571,8.0256 C18.7571,7.6946 18.4881,7.4256 18.1571,7.4256 Z M13.529,10.9748 C14.081,10.9748 14.529,11.4228 14.529,11.9748 L14.529,13.7278 L16.282,13.7278 C16.834,13.7278 17.282,14.1758 17.282,14.7278 C17.282,15.2798 16.834,15.7278 16.282,15.7278 L14.529,15.7278 L14.529,17.4808 C14.529,18.0328 14.081,18.4808 13.529,18.4808 C12.977,18.4808 12.529,18.0328 12.529,17.4808 L12.529,15.7278 L10.776,15.7278 C10.224,15.7278 9.776,15.2798 9.776,14.7278 C9.776,14.1758 10.224,13.7278 10.776,13.7278 L12.529,13.7278 L12.529,11.9748 C12.529,11.4228 12.977,10.9748 13.529,10.9748 Z M14.6161,4.2106 L6.2291,4.2106 C5.6781,4.2106 5.2291,4.6586 5.2291,5.2106 L5.2291,15.3336 C5.2291,15.8846 5.6781,16.3336 6.2291,16.3336 L6.3701,16.3336 L6.3701,10.8696 C6.3701,10.7436 6.3991,10.6246 6.4421,10.5136 C6.4571,10.4736 6.4771,10.4456 6.4941,10.4126 L6.52676667,10.3398593 L6.5511,10.3066 L6.5961,10.2626 C6.6471,10.1966 6.7051,10.1406 6.7711,10.0896 L11.1231,5.7996 C11.1661,5.7466 11.2121,5.7026 11.2651,5.6596 L11.3011,5.6246 C11.3231,5.6026 11.3501,5.6016 11.3731,5.5866 C11.5251,5.4936 11.6941,5.4256 11.8851,5.4256 L15.6161,5.4256 L15.6161,5.2106 C15.6161,4.6586 15.1681,4.2106 14.6161,4.2106 Z" }) })));
29
+ };
30
+ exports.default = Duplicate;
@@ -156,5 +156,6 @@ declare const fillIcons: {
156
156
  readonly ic_move_forward: ({ color, size, ...rest }: import("../IconType").default) => JSX.Element;
157
157
  readonly ic_group: ({ color, size, ...rest }: import("../IconType").default) => JSX.Element;
158
158
  readonly ic_ungroup: ({ color, size, ...rest }: import("../IconType").default) => JSX.Element;
159
+ readonly ic_duplicate: ({ color, size, ...rest }: import("../IconType").default) => JSX.Element;
159
160
  };
160
161
  export default fillIcons;
@@ -48,6 +48,7 @@ var DeviceMobileNotification_1 = __importDefault(require("./DeviceMobileNotifica
48
48
  var Divider_1 = __importDefault(require("./Divider"));
49
49
  var Download_1 = __importDefault(require("./Download"));
50
50
  var Downloaded_1 = __importDefault(require("./Downloaded"));
51
+ var Duplicate_1 = __importDefault(require("./Duplicate"));
51
52
  var Edit_1 = __importDefault(require("./Edit"));
52
53
  var EditorLeftSide_1 = __importDefault(require("./EditorLeftSide"));
53
54
  var EditorRightSide_1 = __importDefault(require("./EditorRightSide"));
@@ -315,6 +316,7 @@ var fillIcons = {
315
316
  ic_move_backward: MoveBackward_1.default,
316
317
  ic_move_forward: MoveForward_1.default,
317
318
  ic_group: Group_1.default,
318
- ic_ungroup: Ungroup_1.default
319
+ ic_ungroup: Ungroup_1.default,
320
+ ic_duplicate: Duplicate_1.default
319
321
  };
320
322
  exports.default = fillIcons;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import type IconType from '../IconType';
3
+ declare const Duplicate: ({ color, size, ...rest }: IconType) => JSX.Element;
4
+ export default Duplicate;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ var jsx_runtime_1 = require("react/jsx-runtime");
26
+ var Duplicate = function (_a) {
27
+ var color = _a.color, size = _a.size, rest = __rest(_a, ["color", "size"]);
28
+ return ((0, jsx_runtime_1.jsx)("svg", __assign({ width: size, height: size, viewBox: "0 0 24 24" }, rest, { children: (0, jsx_runtime_1.jsx)("path", { fill: color, fillRule: "evenodd", d: "M14.6164,2.4606 C16.1324,2.4606 17.3664,3.6946 17.3664,5.2106 L17.3664,5.6756 L18.1574,5.6756 C19.4534,5.6756 20.5074,6.7296 20.5074,8.0256 L20.5074,19.0486 C20.5074,20.2896 19.4984,21.2986 18.2574,21.2986 L8.9704,21.2986 C7.6744,21.2986 6.6204,20.2446 6.6204,18.9486 L6.6204,18.0836 L6.2294,18.0836 C4.7134,18.0836 3.4794,16.8496 3.4794,15.3336 L3.4794,5.2106 C3.4794,3.6946 4.7134,2.4606 6.2294,2.4606 Z M18.1574,7.1756 L12.0894,7.1756 L12.0894,9.9866 C12.0904,10.5776 11.6104,11.0576 11.0184,11.0576 L8.1204,11.0586 L8.1204,18.9486 C8.1204,19.4176 8.5024,19.7986 8.9704,19.7986 L18.2574,19.7986 C18.6714,19.7986 19.0074,19.4626 19.0074,19.0486 L19.0074,8.0256 C19.0074,7.5566 18.6264,7.1756 18.1574,7.1756 Z M13.5288,11.2248 C13.9428,11.2248 14.2788,11.5608 14.2788,11.9748 L14.2788,13.9778 L16.2818,13.9778 C16.6958,13.9778 17.0318,14.3138 17.0318,14.7278 C17.0318,15.1418 16.6958,15.4778 16.2818,15.4778 L14.2788,15.4778 L14.2788,17.4808 C14.2788,17.8948 13.9428,18.2308 13.5288,18.2308 C13.1148,18.2308 12.7788,17.8948 12.7788,17.4808 L12.7788,15.4778 L10.7758,15.4778 C10.3618,15.4778 10.0258,15.1418 10.0258,14.7278 C10.0258,14.3138 10.3618,13.9778 10.7758,13.9778 L12.7788,13.9778 L12.7788,11.9748 C12.7788,11.5608 13.1148,11.2248 13.5288,11.2248 Z M14.6164,3.9606 L6.2294,3.9606 C5.5404,3.9606 4.9794,4.5216 4.9794,5.2106 L4.9794,15.3336 C4.9794,16.0236 5.5404,16.5836 6.2294,16.5836 L6.6204,16.5836 L6.6204,10.8696 C6.6204,10.7986 6.6424,10.7356 6.6604,10.6706 C6.6634,10.5806 6.6864,10.4906 6.7614,10.4166 L6.8404,10.3396 L11.3914,5.8536 C11.4244,5.8206 11.4654,5.8136 11.5044,5.7946 C11.6174,5.7256 11.7434,5.6756 11.8854,5.6756 L15.8664,5.6756 L15.8664,5.2106 C15.8664,4.5216 15.3054,3.9606 14.6164,3.9606 Z" }) })));
29
+ };
30
+ exports.default = Duplicate;
@@ -307,5 +307,6 @@ declare const lineIcons: {
307
307
  readonly ic_move_forward: ({ color, size, ...rest }: import("../IconType").default) => JSX.Element;
308
308
  readonly ic_group: ({ color, size, ...rest }: import("../IconType").default) => JSX.Element;
309
309
  readonly ic_ungroup: ({ color, size, ...rest }: import("../IconType").default) => JSX.Element;
310
+ readonly ic_duplicate: ({ color, size, ...rest }: import("../IconType").default) => JSX.Element;
310
311
  };
311
312
  export default lineIcons;
@@ -81,6 +81,7 @@ var DeviceMobileNotification_1 = __importDefault(require("./DeviceMobileNotifica
81
81
  var Divider_1 = __importDefault(require("./Divider"));
82
82
  var DottedCircle_1 = __importDefault(require("./DottedCircle"));
83
83
  var Download_1 = __importDefault(require("./Download"));
84
+ var Duplicate_1 = __importDefault(require("./Duplicate"));
84
85
  var DynamicLayout_1 = __importDefault(require("./DynamicLayout"));
85
86
  var Edit_1 = __importDefault(require("./Edit"));
86
87
  var Editor_1 = __importDefault(require("./Editor"));
@@ -617,6 +618,7 @@ var lineIcons = {
617
618
  ic_move_backward: MoveBackward_1.default,
618
619
  ic_move_forward: MoveForward_1.default,
619
620
  ic_group: Group_1.default,
620
- ic_ungroup: Ungroup_1.default
621
+ ic_ungroup: Ungroup_1.default,
622
+ ic_duplicate: Duplicate_1.default
621
623
  };
622
624
  exports.default = lineIcons;
@@ -24,6 +24,7 @@
24
24
  "str_5831": "{{price}} USD",
25
25
  "str_start": "Start",
26
26
  "str_free": "FREE",
27
- "str_key_user_scene_x00001pages_notconnectdomain_embedcb_hide_info": "Unable to run because the provider's domain is disconnected."
27
+ "str_key_user_scene_x00001pages_notconnectdomain_embedcb_hide_info": "Unable to run because the provider's domain is disconnected.",
28
+ "str_1460": "Start for Free"
28
29
  }
29
30
  }
@@ -24,6 +24,7 @@
24
24
  "str_5831": "{{price}} USD",
25
25
  "str_start": "Start",
26
26
  "str_free": "FREE",
27
- "str_key_user_scene_x00001pages_notconnectdomain_embedcb_hide_info": "Unable to run because the provider's domain is disconnected."
27
+ "str_key_user_scene_x00001pages_notconnectdomain_embedcb_hide_info": "Unable to run because the provider's domain is disconnected.",
28
+ "str_1460": "Start for Free"
28
29
  }
29
30
  }
@@ -24,6 +24,7 @@
24
24
  "str_5831": "{{price}} USD",
25
25
  "str_start": "Start",
26
26
  "str_free": "FREE",
27
- "str_key_user_scene_x00001pages_notconnectdomain_embedcb_hide_info": "Unable to run because the provider's domain is disconnected."
27
+ "str_key_user_scene_x00001pages_notconnectdomain_embedcb_hide_info": "Unable to run because the provider's domain is disconnected.",
28
+ "str_1460": "Magsimula nang Libre"
28
29
  }
29
30
  }
@@ -26,6 +26,7 @@ declare const locale: {
26
26
  str_start: string;
27
27
  str_free: string;
28
28
  str_key_user_scene_x00001pages_notconnectdomain_embedcb_hide_info: string;
29
+ str_1460: string;
29
30
  };
30
31
  };
31
32
  readonly en: {
@@ -55,6 +56,7 @@ declare const locale: {
55
56
  str_start: string;
56
57
  str_free: string;
57
58
  str_key_user_scene_x00001pages_notconnectdomain_embedcb_hide_info: string;
59
+ str_1460: string;
58
60
  };
59
61
  };
60
62
  readonly ja: {
@@ -84,6 +86,7 @@ declare const locale: {
84
86
  str_start: string;
85
87
  str_free: string;
86
88
  str_key_user_scene_x00001pages_notconnectdomain_embedcb_hide_info: string;
89
+ str_1460: string;
87
90
  };
88
91
  };
89
92
  readonly es: {
@@ -113,6 +116,7 @@ declare const locale: {
113
116
  str_start: string;
114
117
  str_free: string;
115
118
  str_key_user_scene_x00001pages_notconnectdomain_embedcb_hide_info: string;
119
+ str_1460: string;
116
120
  };
117
121
  };
118
122
  readonly 'zh-cn': {
@@ -142,6 +146,7 @@ declare const locale: {
142
146
  str_start: string;
143
147
  str_free: string;
144
148
  str_key_user_scene_x00001pages_notconnectdomain_embedcb_hide_info: string;
149
+ str_1460: string;
145
150
  };
146
151
  };
147
152
  readonly 'zh-tw': {
@@ -171,6 +176,7 @@ declare const locale: {
171
176
  str_start: string;
172
177
  str_free: string;
173
178
  str_key_user_scene_x00001pages_notconnectdomain_embedcb_hide_info: string;
179
+ str_1460: string;
174
180
  };
175
181
  };
176
182
  readonly fil: {
@@ -200,6 +206,7 @@ declare const locale: {
200
206
  str_start: string;
201
207
  str_free: string;
202
208
  str_key_user_scene_x00001pages_notconnectdomain_embedcb_hide_info: string;
209
+ str_1460: string;
203
210
  };
204
211
  };
205
212
  };
@@ -24,6 +24,7 @@
24
24
  "str_5831": "{{price}} USD",
25
25
  "str_start": "Start",
26
26
  "str_free": "FREE",
27
- "str_key_user_scene_x00001pages_notconnectdomain_embedcb_hide_info": "Unable to run because the provider's domain is disconnected."
27
+ "str_key_user_scene_x00001pages_notconnectdomain_embedcb_hide_info": "Unable to run because the provider's domain is disconnected.",
28
+ "str_1460": "無料で始める"
28
29
  }
29
30
  }
@@ -24,6 +24,7 @@
24
24
  "str_5831": "{{price}} USD",
25
25
  "str_start": "시작하기",
26
26
  "str_free": "무료",
27
- "str_key_user_scene_x00001pages_notconnectdomain_embedcb_hide_info": "사업자의 도메인이 연결되지 않아 실행할 수 없습니다."
27
+ "str_key_user_scene_x00001pages_notconnectdomain_embedcb_hide_info": "사업자의 도메인이 연결되지 않아 실행할 수 없습니다.",
28
+ "str_1460": "무료로 시작하기"
28
29
  }
29
30
  }
@@ -24,6 +24,7 @@
24
24
  "str_5831": "{{price}} USD",
25
25
  "str_start": "Start",
26
26
  "str_free": "FREE",
27
- "str_key_user_scene_x00001pages_notconnectdomain_embedcb_hide_info": "Unable to run because the provider's domain is disconnected."
27
+ "str_key_user_scene_x00001pages_notconnectdomain_embedcb_hide_info": "Unable to run because the provider's domain is disconnected.",
28
+ "str_1460": "免费开始"
28
29
  }
29
30
  }
@@ -24,6 +24,7 @@
24
24
  "str_5831": "{{price}} USD",
25
25
  "str_start": "Start",
26
26
  "str_free": "FREE",
27
- "str_key_user_scene_x00001pages_notconnectdomain_embedcb_hide_info": "Unable to run because the provider's domain is disconnected."
27
+ "str_key_user_scene_x00001pages_notconnectdomain_embedcb_hide_info": "Unable to run because the provider's domain is disconnected.",
28
+ "str_1460": "免費開始"
28
29
  }
29
30
  }
@@ -39,9 +39,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
39
39
  };
40
40
  Object.defineProperty(exports, "__esModule", { value: true });
41
41
  var jsx_runtime_1 = require("react/jsx-runtime");
42
+ var react_1 = require("react");
42
43
  var styled_components_1 = __importStar(require("styled-components"));
43
44
  var components_1 = require("../../../common/components");
44
- var styles_1 = require("../../../common/styles");
45
45
  var transitionStyle_1 = require("../../../common/styles/movement/transitionStyle");
46
46
  var hybrid_1 = require("../../../hybrid");
47
47
  var TextLabel_1 = require("../TextLabel");
@@ -52,6 +52,16 @@ var TextLabel_1 = require("../TextLabel");
52
52
  // shadow?: 'hidden' | 'visible';
53
53
  function MainButton(_a) {
54
54
  var text = _a.text, _b = _a.shapeType, shapeType = _b === void 0 ? 'round' : _b, fillType = _a.fillType, _c = _a.styleTheme, styleTheme = _c === void 0 ? 'primary' : _c, _d = _a.size, size = _d === void 0 ? 'large' : _d, _e = _a.responsiveMode, responsiveMode = _e === void 0 ? 'none' : _e, fontWeight = _a.fontWeight, _f = _a.iconMode, iconMode = _f === void 0 ? 'none' : _f, _g = _a.iconFillType, iconFillType = _g === void 0 ? 'line' : _g, iconName = _a.iconName, _h = _a.colorTheme, colorTheme = _h === void 0 ? 'none' : _h, _j = _a.type, type = _j === void 0 ? 'button' : _j, _k = _a.state, state = _k === void 0 ? 'normal' : _k, isLoading = _a.isLoading, isSubmitting = _a.isSubmitting, onClick = _a.onClick, onMouseDown = _a.onMouseDown;
55
+ var buttonRef = (0, react_1.useRef)(null);
56
+ var _l = (0, react_1.useState)(), buttonWidth = _l[0], setButtonWidth = _l[1];
57
+ (0, react_1.useLayoutEffect)(function () {
58
+ if (buttonRef.current) {
59
+ var shouldCalculateWidth = Boolean(isLoading) || Boolean(isSubmitting);
60
+ if (!shouldCalculateWidth) {
61
+ setButtonWidth(buttonRef.current.offsetWidth);
62
+ }
63
+ }
64
+ }, [text, iconMode, size, isLoading, isSubmitting]);
55
65
  var handleClick = function (e) {
56
66
  if (onClick) {
57
67
  onClick(e);
@@ -196,13 +206,10 @@ function MainButton(_a) {
196
206
  }
197
207
  };
198
208
  var MainButtonVariation = function () {
199
- if (isLoading) {
200
- return ((0, jsx_runtime_1.jsx)(S_LoadingMainButton, { shapeType: shapeType, size: size, responsiveMode: responsiveMode, state: "disabled", disabled: true }));
201
- }
202
- if (isSubmitting) {
203
- return ((0, jsx_runtime_1.jsx)(S_SubmittingMainButton, __assign({ shapeType: shapeType, fillType: fillType, styleTheme: styleTheme, size: size, responsiveMode: responsiveMode, colorTheme: colorTheme, state: "normal", disabled: true }, { children: (0, jsx_runtime_1.jsx)(components_1.CircularProgress, { colorKey: submittingProgressColor(), size: size === 'rlarge' ? 'large' : size }) })));
209
+ if (isSubmitting || isLoading) {
210
+ return ((0, jsx_runtime_1.jsx)(S_SubmittingMainButton, __assign({ shapeType: shapeType, fillType: fillType, styleTheme: styleTheme, size: size, responsiveMode: responsiveMode, colorTheme: colorTheme, state: "normal", disabled: true, style: buttonWidth ? { width: "".concat(buttonWidth, "px") } : undefined }, { children: (0, jsx_runtime_1.jsx)(components_1.CircularProgress, { colorKey: submittingProgressColor(), size: size === 'rlarge' ? 'large' : size }) })));
204
211
  }
205
- return ((0, jsx_runtime_1.jsxs)(S_MainButton, __assign({ "x-pds-name": "MainButton", "x-pds-element-type": "component", "x-pds-device-type": "desktop", shapeType: shapeType, fillType: fillType, styleTheme: styleTheme, size: size, responsiveMode: responsiveMode, fontWeight: fontWeight, colorTheme: colorTheme, type: type, state: state, disabled: state === 'disabled', onClick: handleClick, onMouseDown: handleMouseDown }, { children: [size !== 'xsmall' && iconMode === 'left' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(hybrid_1.Icon, { iconName: iconName, size: size === 'large' || size === 'rlarge' ? 20 : 16, colorKey: iconColor(), fillType: iconFillType }), (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: size === 'large' || size === 'rlarge' ? 'spacing_b' : 'spacing_a', spacingType: "width" })] })), (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: text, styleTheme: textStyle[size], singleLineMode: "use", colorTheme: state === 'disabled' ? 'sysTextTertiary' : textColor(), colorOverride: textColorOverride(), ellipsisMode: "use", lineLimit: 1, wordBreak: "break_all" }), size !== 'xsmall' && iconMode === 'right' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: size === 'large' || size === 'rlarge' ? 'spacing_b' : 'spacing_a', spacingType: "width" }), (0, jsx_runtime_1.jsx)(hybrid_1.Icon, { iconName: iconName, size: size === 'large' || size === 'rlarge' ? 20 : 16, colorKey: iconColor(), fillType: iconFillType })] }))] })));
212
+ return ((0, jsx_runtime_1.jsxs)(S_MainButton, __assign({ "x-pds-name": "MainButton", "x-pds-element-type": "component", "x-pds-device-type": "desktop", ref: buttonRef, shapeType: shapeType, fillType: fillType, styleTheme: styleTheme, size: size, responsiveMode: responsiveMode, fontWeight: fontWeight, colorTheme: colorTheme, type: type, state: state, disabled: state === 'disabled', onClick: handleClick, onMouseDown: handleMouseDown }, { children: [size !== 'xsmall' && iconMode === 'left' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(hybrid_1.Icon, { iconName: iconName, size: size === 'large' || size === 'rlarge' ? 20 : 16, colorKey: iconColor(), fillType: iconFillType }), (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: size === 'large' || size === 'rlarge' ? 'spacing_b' : 'spacing_a', spacingType: "width" })] })), (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: text, styleTheme: textStyle[size], singleLineMode: "use", colorTheme: state === 'disabled' ? 'sysTextTertiary' : textColor(), colorOverride: textColorOverride(), ellipsisMode: "use", lineLimit: 1, wordBreak: "break_all" }), size !== 'xsmall' && iconMode === 'right' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: size === 'large' || size === 'rlarge' ? 'spacing_b' : 'spacing_a', spacingType: "width" }), (0, jsx_runtime_1.jsx)(hybrid_1.Icon, { iconName: iconName, size: size === 'large' || size === 'rlarge' ? 20 : 16, colorKey: iconColor(), fillType: iconFillType })] }))] })));
206
213
  };
207
214
  return MainButtonVariation();
208
215
  }
@@ -401,7 +408,6 @@ var S_MainButton = styled_components_1.default.button(templateObject_20 || (temp
401
408
  regular: "font-weight: ".concat(theme.fontWeight.normal)
402
409
  }[fontWeight];
403
410
  });
404
- var S_LoadingMainButton = (0, styled_components_1.default)(S_MainButton)(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.skeletonLoadingStyle);
405
- var S_SubmittingMainButton = (0, styled_components_1.default)(S_MainButton)(templateObject_22 || (templateObject_22 = __makeTemplateObject(["\n cursor: default;\n"], ["\n cursor: default;\n"])));
411
+ var S_SubmittingMainButton = (0, styled_components_1.default)(S_MainButton)(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n cursor: default;\n"], ["\n cursor: default;\n"])));
406
412
  exports.default = MainButton;
407
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22;
413
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21;