pds-dev-kit-web 2.2.319-alpha.2 → 2.2.320-trialguard.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.
- package/dist/index.d.ts +4 -6
- package/dist/index.js +2 -11
- package/dist/src/common/utils/sanitizeHtml.d.ts +2 -0
- package/dist/src/common/utils/sanitizeHtml.js +47 -0
- package/dist/src/core/pricing/index.d.ts +0 -4
- package/dist/src/core/pricing/index.js +0 -4
- package/dist/src/desktop/components/RichTextEditor/HTMLReader.js +2 -1
- package/dist/src/desktop/components/index.d.ts +1 -2
- package/dist/src/desktop/components/index.js +2 -4
- package/dist/src/desktop/index.d.ts +1 -1
- package/dist/src/desktop/index.js +1 -2
- package/dist/src/desktop/panels/LocalizedContentModal/LocalizedContentModal.js +2 -1
- package/dist/src/mobile/components/index.d.ts +1 -2
- package/dist/src/mobile/components/index.js +1 -3
- package/dist/src/mobile/index.d.ts +1 -1
- package/dist/src/mobile/index.js +1 -2
- package/dist/src/sub/DynamicLayout/DynamicLayout.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/DynamicLayout.js +3 -2
- package/dist/src/sub/DynamicLayout/components/ComponentBlocks/RichText/RichText.js +2 -1
- package/dist/src/sub/DynamicLayout/components/desktop/Item/Item.js +2 -1
- package/dist/src/sub/DynamicLayout/components/mobile/Item/Item.js +2 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.js +3 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/EmbedIframe.d.ts +6 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Embed/EmbedIframe.js +7 -15
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.js +3 -2
- package/dist/src/sub/DynamicLayout/sections/FullscreenIframeSection/templates/TemplateA/desktop/D_TemplateA.js +9 -14
- package/dist/src/sub/DynamicLayout/sections/FullscreenIframeSection/templates/TemplateA/mobile/M_TemplateA.js +9 -14
- package/dist/src/sub/DynamicLayout/types.d.ts +2 -0
- package/package.json +3 -6
- package/release-note.md +3 -11
- package/dist/src/core/pricing/hooks/useNewPriceTextField.d.ts +0 -68
- package/dist/src/core/pricing/hooks/useNewPriceTextField.js +0 -210
- package/dist/src/core/pricing/input-utils.d.ts +0 -32
- package/dist/src/core/pricing/input-utils.js +0 -119
- package/dist/src/core/pricing/policy-context.d.ts +0 -14
- package/dist/src/core/pricing/policy-context.js +0 -35
- package/dist/src/core/pricing/policy-model.d.ts +0 -39
- package/dist/src/core/pricing/policy-model.js +0 -79
- package/dist/src/desktop/components/NewPriceTextField/NewPriceTextField.d.ts +0 -8
- package/dist/src/desktop/components/NewPriceTextField/NewPriceTextField.js +0 -240
- package/dist/src/desktop/components/NewPriceTextField/index.d.ts +0 -1
- package/dist/src/desktop/components/NewPriceTextField/index.js +0 -8
- package/dist/src/mobile/components/NewPriceTextField/NewPriceTextField.d.ts +0 -8
- package/dist/src/mobile/components/NewPriceTextField/NewPriceTextField.js +0 -234
- package/dist/src/mobile/components/NewPriceTextField/index.d.ts +0 -1
- package/dist/src/mobile/components/NewPriceTextField/index.js +0 -8
- package/dist/storybook-static/0.b73eaee9a88f178d62ed.manager.bundle.d.ts +0 -0
- package/dist/storybook-static/0.b73eaee9a88f178d62ed.manager.bundle.js +0 -74
- package/dist/storybook-static/1.f296d183a17268696d73.manager.bundle.d.ts +0 -0
- package/dist/storybook-static/1.f296d183a17268696d73.manager.bundle.js +0 -190
- package/dist/storybook-static/10.9998ba67d65d81d20896.manager.bundle.d.ts +0 -0
- package/dist/storybook-static/10.9998ba67d65d81d20896.manager.bundle.js +0 -62
- package/dist/storybook-static/11.49c687eaa6261f8b7be2.manager.bundle.d.ts +0 -2
- package/dist/storybook-static/11.49c687eaa6261f8b7be2.manager.bundle.js +0 -534
- package/dist/storybook-static/12.c9538ed3766c96f289e7.manager.bundle.d.ts +0 -2
- package/dist/storybook-static/12.c9538ed3766c96f289e7.manager.bundle.js +0 -2
- package/dist/storybook-static/5.fa71488e730c5c7f885f.manager.bundle.d.ts +0 -18
- package/dist/storybook-static/5.fa71488e730c5c7f885f.manager.bundle.js +0 -527
- package/dist/storybook-static/6.8096ae4aadde0743697b.manager.bundle.d.ts +0 -3
- package/dist/storybook-static/6.8096ae4aadde0743697b.manager.bundle.js +0 -141
- package/dist/storybook-static/7.b34baecbd082bc7b188d.manager.bundle.d.ts +0 -0
- package/dist/storybook-static/7.b34baecbd082bc7b188d.manager.bundle.js +0 -8
- package/dist/storybook-static/8.15577edffecf900a8de2.manager.bundle.d.ts +0 -0
- package/dist/storybook-static/8.15577edffecf900a8de2.manager.bundle.js +0 -25
- package/dist/storybook-static/9.d7d85aa0a49a98f17218.manager.bundle.d.ts +0 -0
- package/dist/storybook-static/9.d7d85aa0a49a98f17218.manager.bundle.js +0 -94
- package/dist/storybook-static/main.ce406c7e93b98325390e.manager.bundle.d.ts +0 -2
- package/dist/storybook-static/main.ce406c7e93b98325390e.manager.bundle.js +0 -3824
- package/dist/storybook-static/runtime~main.909d038f912f063e8837.manager.bundle.d.ts +0 -1
- package/dist/storybook-static/runtime~main.909d038f912f063e8837.manager.bundle.js +0 -34
- package/dist/storybook-static/vendors~main.d3455eed64b243c89325.manager.bundle.d.ts +0 -3
- package/dist/storybook-static/vendors~main.d3455eed64b243c89325.manager.bundle.js +0 -11787
- package/storybook-static/0.b73eaee9a88f178d62ed.manager.bundle.js +0 -1
- package/storybook-static/1.f296d183a17268696d73.manager.bundle.js +0 -1
- package/storybook-static/10.9998ba67d65d81d20896.manager.bundle.js +0 -1
- package/storybook-static/11.49c687eaa6261f8b7be2.manager.bundle.js +0 -2
- package/storybook-static/11.49c687eaa6261f8b7be2.manager.bundle.js.LICENSE.txt +0 -12
- package/storybook-static/12.c9538ed3766c96f289e7.manager.bundle.js +0 -1
- package/storybook-static/5.fa71488e730c5c7f885f.manager.bundle.js +0 -2
- package/storybook-static/5.fa71488e730c5c7f885f.manager.bundle.js.LICENSE.txt +0 -8
- package/storybook-static/6.8096ae4aadde0743697b.manager.bundle.js +0 -1
- package/storybook-static/7.b34baecbd082bc7b188d.manager.bundle.js +0 -1
- package/storybook-static/8.15577edffecf900a8de2.manager.bundle.js +0 -1
- package/storybook-static/9.d7d85aa0a49a98f17218.manager.bundle.js +0 -1
- package/storybook-static/favicon.ico +0 -0
- package/storybook-static/index.html +0 -47
- package/storybook-static/main.ce406c7e93b98325390e.manager.bundle.js +0 -1
- package/storybook-static/runtime~main.909d038f912f063e8837.manager.bundle.js +0 -1
- package/storybook-static/vendors~main.d3455eed64b243c89325.manager.bundle.js +0 -2
- package/storybook-static/vendors~main.d3455eed64b243c89325.manager.bundle.js.LICENSE.txt +0 -88
- package/vitest.config.ts +0 -8
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
-
if (ar || !(i in from)) {
|
|
5
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
-
ar[i] = from[i];
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.DEFAULT_PRICING_POLICY = exports.createPricingPolicy = void 0;
|
|
13
|
-
var policy_1 = require("./policy");
|
|
14
|
-
var types_1 = require("./types");
|
|
15
|
-
function buildCurrencyPolicy(code, input) {
|
|
16
|
-
var _a, _b, _c, _d, _e, _f;
|
|
17
|
-
var defaults = policy_1.DEFAULT_CURRENCY_PRICE_POLICIES[code];
|
|
18
|
-
var currency = types_1.CURRENCY_MAP[code];
|
|
19
|
-
if (!defaults || !currency) {
|
|
20
|
-
throw new Error("createPricingPolicy: unsupported currency: ".concat(code));
|
|
21
|
-
}
|
|
22
|
-
var limits = (_a = input.limits) === null || _a === void 0 ? void 0 : _a[code];
|
|
23
|
-
return {
|
|
24
|
-
code: code,
|
|
25
|
-
decimalDigits: (_c = (_b = input.decimalDigits) === null || _b === void 0 ? void 0 : _b[code]) !== null && _c !== void 0 ? _c : currency.decimalDigits,
|
|
26
|
-
minAmount: (_d = limits === null || limits === void 0 ? void 0 : limits.minAmount) !== null && _d !== void 0 ? _d : Number(defaults.minPayment.amount),
|
|
27
|
-
maxAmount: (_e = limits === null || limits === void 0 ? void 0 : limits.maxAmount) !== null && _e !== void 0 ? _e : Number(defaults.maxPayment.amount),
|
|
28
|
-
paymentUnit: (_f = limits === null || limits === void 0 ? void 0 : limits.paymentUnit) !== null && _f !== void 0 ? _f : defaults.paymentUnit
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* 환율을 "기준 통화 = 1" 기준으로 정규화한다.
|
|
33
|
-
* 입력이 {KRW: 1300, USD: 1}(USD 기준)이어도 기준 통화 KRW면 {KRW: 1, USD: 1/1300}이 된다.
|
|
34
|
-
* 보조 통화에 환율이 없거나 0·음수·NaN이면 조용히 틀린 금액을 보여주는 대신 에러를 낸다.
|
|
35
|
-
*/
|
|
36
|
-
function normalizeExchangeRates(baseCurrency, altCurrencies, input) {
|
|
37
|
-
var _a;
|
|
38
|
-
var rates = input !== null && input !== void 0 ? input : {};
|
|
39
|
-
// API가 Decimal을 문자열("1500.0000000000")로 내려주는 경우가 있어 숫자로 강제 변환한다
|
|
40
|
-
var baseRateRaw = rates[baseCurrency];
|
|
41
|
-
var baseRate = baseRateRaw === undefined ? 1 : Number(baseRateRaw);
|
|
42
|
-
if (!Number.isFinite(baseRate) || baseRate <= 0) {
|
|
43
|
-
throw new Error("createPricingPolicy: invalid exchange rate for ".concat(baseCurrency));
|
|
44
|
-
}
|
|
45
|
-
var normalized = (_a = {}, _a[baseCurrency] = 1, _a);
|
|
46
|
-
altCurrencies.forEach(function (code) {
|
|
47
|
-
var rateRaw = rates[code];
|
|
48
|
-
if (rateRaw === undefined || rateRaw === null) {
|
|
49
|
-
throw new Error("createPricingPolicy: missing exchange rate for ".concat(code));
|
|
50
|
-
}
|
|
51
|
-
var rate = Number(rateRaw);
|
|
52
|
-
if (!Number.isFinite(rate) || rate <= 0) {
|
|
53
|
-
throw new Error("createPricingPolicy: invalid exchange rate for ".concat(code));
|
|
54
|
-
}
|
|
55
|
-
normalized[code] = rate / baseRate;
|
|
56
|
-
});
|
|
57
|
-
return normalized;
|
|
58
|
-
}
|
|
59
|
-
function createPricingPolicy(input) {
|
|
60
|
-
var _a, _b;
|
|
61
|
-
var altCurrencies = ((_a = input.altCurrencies) !== null && _a !== void 0 ? _a : []).filter(function (code, index, list) { return code !== input.baseCurrency && list.indexOf(code) === index; });
|
|
62
|
-
var currencies = __spreadArray([input.baseCurrency], altCurrencies, true);
|
|
63
|
-
var policies = {};
|
|
64
|
-
currencies.forEach(function (code) {
|
|
65
|
-
policies[code] = buildCurrencyPolicy(code, input);
|
|
66
|
-
});
|
|
67
|
-
return {
|
|
68
|
-
baseCurrency: input.baseCurrency,
|
|
69
|
-
currencies: currencies,
|
|
70
|
-
exchangeRates: normalizeExchangeRates(input.baseCurrency, altCurrencies, input.exchangeRates),
|
|
71
|
-
multiCurrency: (_b = input.multiCurrency) !== null && _b !== void 0 ? _b : altCurrencies.length > 0,
|
|
72
|
-
policies: policies
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
exports.createPricingPolicy = createPricingPolicy;
|
|
76
|
-
/** Provider가 없을 때 쓰는 기본 정책: KRW 단일 통화 */
|
|
77
|
-
exports.DEFAULT_PRICING_POLICY = createPricingPolicy({
|
|
78
|
-
baseCurrency: types_1.CurrencyCode.KRW
|
|
79
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { NewPriceTextFieldProps } from '../../../core/pricing';
|
|
3
|
-
/**
|
|
4
|
-
* 문서: Web - PriceTextField (Added in 2.2)
|
|
5
|
-
* 통화 정책은 PricingPolicyProvider에서 받고, 값은 react-hook-form 폼이 단일 원천이다.
|
|
6
|
-
*/
|
|
7
|
-
declare function NewPriceTextField(props: NewPriceTextFieldProps): JSX.Element;
|
|
8
|
-
export default NewPriceTextField;
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(o, k2, desc);
|
|
24
|
-
}) : (function(o, m, k, k2) {
|
|
25
|
-
if (k2 === undefined) k2 = k;
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
-
}) : function(o, v) {
|
|
31
|
-
o["default"] = v;
|
|
32
|
-
});
|
|
33
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
-
};
|
|
43
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
45
|
-
/* eslint-disable react/jsx-no-bind */
|
|
46
|
-
var react_1 = require("react");
|
|
47
|
-
var react_dom_1 = require("react-dom");
|
|
48
|
-
var clickTypeSystemUICssGenerator_1 = __importDefault(require("../../../common/utils/SystemUIPositionGenerator/clickTypeSystemUICssGenerator"));
|
|
49
|
-
var pricing_1 = require("../../../core/pricing");
|
|
50
|
-
var styled_components_1 = __importStar(require("styled-components"));
|
|
51
|
-
var transitionStyle_1 = require("../../../common/styles/movement/transitionStyle");
|
|
52
|
-
var hybrid_1 = require("../../../hybrid");
|
|
53
|
-
var components_1 = require("../../common/components");
|
|
54
|
-
var ContextMenu_1 = require("../ContextMenu");
|
|
55
|
-
var ContextMenuItem_1 = require("../ContextMenuItem");
|
|
56
|
-
var TextLabel_1 = require("../TextLabel");
|
|
57
|
-
/**
|
|
58
|
-
* 문서: Web - PriceTextField (Added in 2.2)
|
|
59
|
-
* 통화 정책은 PricingPolicyProvider에서 받고, 값은 react-hook-form 폼이 단일 원천이다.
|
|
60
|
-
*/
|
|
61
|
-
function NewPriceTextField(props) {
|
|
62
|
-
var name = props.name, _a = props.size, size = _a === void 0 ? 'large' : _a, _b = props.state, state = _b === void 0 ? 'normal' : _b, _c = props.responsiveMode, responsiveMode = _c === void 0 ? 'none' : _c, customWidth = props.customWidth, _d = props.deleteBtnMode, deleteBtnMode = _d === void 0 ? 'use' : _d;
|
|
63
|
-
var _e = (0, pricing_1.useNewPriceTextField)(props), hintText = _e.hintText, displayValue = _e.displayValue, rules = _e.rules, errorMessage = _e.errorMessage, isFocused = _e.isFocused, isInputReadOnly = _e.isInputReadOnly, selectedCurrency = _e.selectedCurrency, currencyOptions = _e.currencyOptions, dropdownState = _e.dropdownState, handlers = _e.handlers;
|
|
64
|
-
var _f = (0, react_1.useState)(false), isDropdownOpen = _f[0], setIsDropdownOpen = _f[1];
|
|
65
|
-
var _g = (0, react_1.useState)(null), contextMenuSizeOffset = _g[0], setContextMenuSizeOffset = _g[1];
|
|
66
|
-
var _h = (0, react_1.useState)(null), dropdownPositionOffset = _h[0], setDropdownPositionOffset = _h[1];
|
|
67
|
-
var contextMenuRef = (0, react_1.useRef)(null);
|
|
68
|
-
var dropdownRef = (0, react_1.useRef)(null);
|
|
69
|
-
var isLargeSize = size === 'large' || size === 'rlarge';
|
|
70
|
-
var isError = Boolean(errorMessage);
|
|
71
|
-
var isDropdownReadOnly = dropdownState === 'read_only' || state === 'read_only';
|
|
72
|
-
/** 드롭다운 위치 계산 (포털) */
|
|
73
|
-
(0, react_1.useEffect)(function () {
|
|
74
|
-
if (!isDropdownOpen) {
|
|
75
|
-
setContextMenuSizeOffset(null);
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
if (dropdownRef.current) {
|
|
79
|
-
var _a = dropdownRef.current.getBoundingClientRect(), top_1 = _a.top, right = _a.right, left = _a.left, bottom = _a.bottom;
|
|
80
|
-
setDropdownPositionOffset({
|
|
81
|
-
top: top_1 + window.scrollY,
|
|
82
|
-
right: right + window.scrollX,
|
|
83
|
-
bottom: bottom + window.scrollY,
|
|
84
|
-
left: left + window.scrollX
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
if (contextMenuRef.current) {
|
|
88
|
-
setContextMenuSizeOffset({
|
|
89
|
-
height: contextMenuRef.current.offsetHeight,
|
|
90
|
-
width: contextMenuRef.current.offsetWidth
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
}, [isDropdownOpen]);
|
|
94
|
-
var contextMenuPositionCss = (0, clickTypeSystemUICssGenerator_1.default)({
|
|
95
|
-
sizeOffset: contextMenuSizeOffset,
|
|
96
|
-
positionOffset: dropdownPositionOffset
|
|
97
|
-
});
|
|
98
|
-
var handleDropdownClick = function () {
|
|
99
|
-
if (isDropdownReadOnly) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
setIsDropdownOpen(function (open) { return !open; });
|
|
103
|
-
};
|
|
104
|
-
var handleDropdownBlur = function () {
|
|
105
|
-
setIsDropdownOpen(false);
|
|
106
|
-
};
|
|
107
|
-
var handleCurrencySelect = function (option) {
|
|
108
|
-
setIsDropdownOpen(false);
|
|
109
|
-
handlers.selectCurrency(option.currency);
|
|
110
|
-
};
|
|
111
|
-
var contextMenuWidth = customWidth || (dropdownRef.current ? "".concat(dropdownRef.current.offsetWidth, "px") : '');
|
|
112
|
-
return ((0, jsx_runtime_1.jsxs)(S_NewPriceTextField, __assign({ "x-pds-name": "NewPriceTextField", "x-pds-element-type": "component", "x-pds-device-type": "desktop", inputSize: size, responsiveMode: responsiveMode, customWidth: customWidth }, { children: [(0, jsx_runtime_1.jsxs)(S_ComponentBox, __assign({ inputSize: size, responsiveMode: responsiveMode, isFocused: isFocused, isError: isError, state: state, customWidth: customWidth, isInputReadOnly: isInputReadOnly }, { children: [(0, jsx_runtime_1.jsx)(S_TextFieldBaseWrapper, __assign({ state: state, inputSize: size, isInputReadOnly: isInputReadOnly }, { children: (0, jsx_runtime_1.jsx)(components_1.TextFieldBase, { name: name, hintText: hintText, value: displayValue, validation: rules, textAlign: "right", textLineType: "single", inputType: "text", inputMode: "decimal", preventBlankMode: "all", enterSubmitMode: "none", state: isInputReadOnly ? 'read_only' : 'normal', textSize: "form2", textWeight: "bold", hintTextWeight: "normal", fieldPaddingRight: 12, deleteIconMode: isLargeSize && deleteBtnMode === 'use' && !isInputReadOnly ? 'use' : 'none', deleteIconSize: 20, deleteIconColor: "ui_cpnt_button_icon_disabled", isFocused: isFocused, suffixTextRightSpacingMode: isLargeSize ? 'use' : 'none', onChange: handlers.onChange, onFocus: handlers.onFocus, onBlur: handlers.onBlur, onKeyDown: handlers.onKeyDown, onKeyUp: handlers.onKeyUp, onTarget: handlers.onTarget, onDelete: handlers.onDelete }) })), (0, jsx_runtime_1.jsx)(S_DropdownWrapper, __assign({ ref: dropdownRef, inputSize: size, onClick: handleDropdownClick, onBlur: handleDropdownBlur, tabIndex: 0, isFocused: isDropdownOpen, dropdownState: isDropdownReadOnly ? 'read_only' : 'normal', isError: isError }, { children: (0, jsx_runtime_1.jsxs)(S_Select, { children: [(0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: selectedCurrency, styleTheme: "caption1Bold", singleLineMode: "use", colorTheme: "sysTextPrimary", ellipsisMode: "use", colorOverride: isDropdownReadOnly ? 'ui_cpnt_button_text_disabled' : 'ui_cpnt_button_text_enabled', lineLimit: 1 }), (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_a", spacingType: "width" }), (0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: 16, fillType: "line", iconName: isDropdownOpen ? 'ic_arrow_up' : 'ic_arrow_down', colorKey: isDropdownReadOnly ? 'ui_cpnt_dropdown_icon_02' : 'ui_cpnt_dropdown_icon_01' })] }) }))] })), isDropdownOpen &&
|
|
113
|
-
(0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(S_ContextMenuWrapper, __assign({ ref: contextMenuRef, contextMenuPositionCss: contextMenuPositionCss }, { children: (0, jsx_runtime_1.jsx)(ContextMenu_1.ContextMenu, __assign({ autoWidthMode: "use", customWidth: contextMenuWidth }, { children: currencyOptions.map(function (option) { return ((0, jsx_runtime_1.jsx)("div", __assign({ onMouseDown: function () { return handleCurrencySelect(option); } }, { children: (0, jsx_runtime_1.jsx)(ContextMenuItem_1.ContextMenuItem, { option: option, size: size === 'rlarge' ? 'large' : size, isSelected: selectedCurrency === option.currency, state: option.state, displayType: "text_only" }) }), option.value)); }) })) })), document.body), errorMessage && state === 'normal' && (0, jsx_runtime_1.jsx)(S_Error, { children: errorMessage })] })));
|
|
114
|
-
}
|
|
115
|
-
var S_NewPriceTextField = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", ";\n ", ";\n ", "\n"], ["\n ", ";\n ", ";\n ", "\n"])), function (_a) {
|
|
116
|
-
var inputSize = _a.inputSize;
|
|
117
|
-
return inputSize &&
|
|
118
|
-
{
|
|
119
|
-
small: 'width: 188px;',
|
|
120
|
-
medium: 'width: 188px;',
|
|
121
|
-
large: 'width: 432px;',
|
|
122
|
-
rlarge: 'width: 100%'
|
|
123
|
-
}[inputSize];
|
|
124
|
-
}, function (_a) {
|
|
125
|
-
var responsiveMode = _a.responsiveMode;
|
|
126
|
-
return responsiveMode === 'use' && 'width: 100%';
|
|
127
|
-
}, function (_a) {
|
|
128
|
-
var customWidth = _a.customWidth;
|
|
129
|
-
return customWidth && "width: ".concat(customWidth, ";");
|
|
130
|
-
});
|
|
131
|
-
var small = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-radius: 10px;\n height: 32px;\n width: 188px;\n"], ["\n border-radius: 10px;\n height: 32px;\n width: 188px;\n"])));
|
|
132
|
-
var medium = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border-radius: 12px;\n height: 40px;\n width: 188px;\n"], ["\n border-radius: 12px;\n height: 40px;\n width: 188px;\n"])));
|
|
133
|
-
var large = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border-radius: 14px;\n height: 48px;\n width: ", ";\n"], ["\n border-radius: 14px;\n height: 48px;\n width: ", ";\n"])), function (_a) {
|
|
134
|
-
var inputSize = _a.inputSize;
|
|
135
|
-
return (inputSize === 'rlarge' ? '100%' : '432px');
|
|
136
|
-
});
|
|
137
|
-
var S_Select = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n justify-content: center;\n width: 100%;\n"], ["\n align-items: center;\n display: flex;\n justify-content: center;\n width: 100%;\n"])));
|
|
138
|
-
var S_ContextMenuWrapper = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: block;\n position: absolute;\n ", ";\n"], ["\n display: block;\n position: absolute;\n ", ";\n"])), function (_a) {
|
|
139
|
-
var contextMenuPositionCss = _a.contextMenuPositionCss;
|
|
140
|
-
return contextMenuPositionCss;
|
|
141
|
-
});
|
|
142
|
-
var S_Error = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n color: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-top: ", ";\n text-align: left;\n white-space: pre-wrap;\n"], ["\n color: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-top: ", ";\n text-align: left;\n white-space: pre-wrap;\n"])), function (_a) {
|
|
143
|
-
var theme = _a.theme;
|
|
144
|
-
return theme.ui_cpnt_textfield_text_error;
|
|
145
|
-
}, function (_a) {
|
|
146
|
-
var theme = _a.theme;
|
|
147
|
-
return theme.desktopFontSize.caption2;
|
|
148
|
-
}, function (_a) {
|
|
149
|
-
var theme = _a.theme;
|
|
150
|
-
return theme.fontWeight.normal;
|
|
151
|
-
}, function (_a) {
|
|
152
|
-
var theme = _a.theme;
|
|
153
|
-
return theme.desktopLineHeight.caption2;
|
|
154
|
-
}, function (_a) {
|
|
155
|
-
var theme = _a.theme;
|
|
156
|
-
return theme.spacing.spacingA;
|
|
157
|
-
});
|
|
158
|
-
var S_ComponentBox = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n align-items: center;\n border: solid 2px\n ", ";\n box-sizing: border-box;\n cursor: ", ";\n ", ";\n display: flex;\n ", "\n ", ";\n ", "\n"], ["\n align-items: center;\n border: solid 2px\n ", ";\n box-sizing: border-box;\n cursor: ", ";\n ", ";\n display: flex;\n ", "\n ", ";\n ", "\n"])), function (_a) {
|
|
159
|
-
var theme = _a.theme, isError = _a.isError, isFocused = _a.isFocused, state = _a.state;
|
|
160
|
-
if (state === 'read_only') {
|
|
161
|
-
return theme.ui_cpnt_textfield_border_disabled;
|
|
162
|
-
}
|
|
163
|
-
if (isError) {
|
|
164
|
-
return theme.ui_cpnt_textfield_border_error;
|
|
165
|
-
}
|
|
166
|
-
if (isFocused) {
|
|
167
|
-
return theme.ui_cpnt_textfield_border_focus;
|
|
168
|
-
}
|
|
169
|
-
return theme.ui_cpnt_textfield_border_normal;
|
|
170
|
-
}, function (_a) {
|
|
171
|
-
var isInputReadOnly = _a.isInputReadOnly;
|
|
172
|
-
return (isInputReadOnly ? 'default' : 'text');
|
|
173
|
-
}, function (_a) {
|
|
174
|
-
var inputSize = _a.inputSize;
|
|
175
|
-
return inputSize &&
|
|
176
|
-
{
|
|
177
|
-
small: small,
|
|
178
|
-
medium: medium,
|
|
179
|
-
large: large,
|
|
180
|
-
rlarge: large
|
|
181
|
-
}[inputSize];
|
|
182
|
-
}, transitionStyle_1.InputTransition, function (_a) {
|
|
183
|
-
var responsiveMode = _a.responsiveMode;
|
|
184
|
-
return responsiveMode === 'use' && 'width: 100%';
|
|
185
|
-
}, function (_a) {
|
|
186
|
-
var customWidth = _a.customWidth;
|
|
187
|
-
return customWidth && "width: ".concat(customWidth, ";");
|
|
188
|
-
});
|
|
189
|
-
var S_TextFieldBaseWrapper = styled_components_1.default.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n border-radius: ", ";\n display: flex;\n flex: 1;\n height: 100%;\n min-width: 0;\n padding-left: ", ";\n\n ", "\n"], ["\n align-items: center;\n background-color: ", ";\n border-radius: ", ";\n display: flex;\n flex: 1;\n height: 100%;\n min-width: 0;\n padding-left: ", ";\n\n ", "\n"])), function (_a) {
|
|
190
|
-
var theme = _a.theme, state = _a.state, isInputReadOnly = _a.isInputReadOnly;
|
|
191
|
-
return isInputReadOnly || state === 'read_only'
|
|
192
|
-
? theme.ui_cpnt_textfield_base_disabled
|
|
193
|
-
: theme.ui_cpnt_textfield_base_normal;
|
|
194
|
-
}, function (_a) {
|
|
195
|
-
var inputSize = _a.inputSize;
|
|
196
|
-
switch (inputSize) {
|
|
197
|
-
case 'small':
|
|
198
|
-
return '8px 0 0 8px';
|
|
199
|
-
case 'medium':
|
|
200
|
-
return '10px 0 0 10px';
|
|
201
|
-
default:
|
|
202
|
-
return '12px 0 0 12px';
|
|
203
|
-
}
|
|
204
|
-
}, function (_a) {
|
|
205
|
-
var theme = _a.theme;
|
|
206
|
-
return theme.spacing.spacingD;
|
|
207
|
-
}, function (_a) {
|
|
208
|
-
var state = _a.state, isInputReadOnly = _a.isInputReadOnly, theme = _a.theme;
|
|
209
|
-
return state === 'normal' &&
|
|
210
|
-
!isInputReadOnly && (0, styled_components_1.css)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n "], ["\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n "])), theme.ui_cpnt_textfield_base_hover, theme.ui_cpnt_textfield_base_pressed);
|
|
211
|
-
});
|
|
212
|
-
var S_DropdownWrapper = styled_components_1.default.div(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n border-radius: ", ";\n cursor: ", ";\n display: flex;\n height: 100%;\n min-width: 50px;\n outline: none;\n padding: 0\n ", ";\n\n ", "\n"], ["\n align-items: center;\n background-color: ", ";\n border-radius: ", ";\n cursor: ", ";\n display: flex;\n height: 100%;\n min-width: 50px;\n outline: none;\n padding: 0\n ", ";\n\n ", "\n"])), function (_a) {
|
|
213
|
-
var theme = _a.theme, dropdownState = _a.dropdownState;
|
|
214
|
-
return dropdownState === 'read_only'
|
|
215
|
-
? theme.ui_cpnt_textfield_base_disabled
|
|
216
|
-
: theme.ui_cpnt_textfield_base_normal;
|
|
217
|
-
}, function (_a) {
|
|
218
|
-
var inputSize = _a.inputSize;
|
|
219
|
-
switch (inputSize) {
|
|
220
|
-
case 'small':
|
|
221
|
-
return '0 8px 8px 0';
|
|
222
|
-
case 'medium':
|
|
223
|
-
return '0 10px 10px 0';
|
|
224
|
-
default:
|
|
225
|
-
return '0 12px 12px 0';
|
|
226
|
-
}
|
|
227
|
-
}, function (_a) {
|
|
228
|
-
var dropdownState = _a.dropdownState;
|
|
229
|
-
return (dropdownState === 'read_only' ? 'auto' : 'pointer');
|
|
230
|
-
}, function (_a) {
|
|
231
|
-
var theme = _a.theme, inputSize = _a.inputSize;
|
|
232
|
-
return inputSize === 'small' || inputSize === 'medium'
|
|
233
|
-
? theme.spacing.spacingB
|
|
234
|
-
: theme.spacing.spacingD;
|
|
235
|
-
}, function (_a) {
|
|
236
|
-
var dropdownState = _a.dropdownState, theme = _a.theme;
|
|
237
|
-
return dropdownState === 'normal' && (0, styled_components_1.css)(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n "], ["\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n "])), theme.ui_cpnt_textfield_base_hover, theme.ui_cpnt_textfield_base_pressed);
|
|
238
|
-
});
|
|
239
|
-
exports.default = NewPriceTextField;
|
|
240
|
-
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;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as NewPriceTextField } from './NewPriceTextField';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.NewPriceTextField = void 0;
|
|
7
|
-
var NewPriceTextField_1 = require("./NewPriceTextField");
|
|
8
|
-
Object.defineProperty(exports, "NewPriceTextField", { enumerable: true, get: function () { return __importDefault(NewPriceTextField_1).default; } });
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { NewPriceTextFieldProps } from '../../../core/pricing';
|
|
3
|
-
/**
|
|
4
|
-
* 문서: Web - PriceTextField (Added in 2.2) — Mobile
|
|
5
|
-
* 통화 정책은 PricingPolicyProvider에서 받고, 값은 react-hook-form 폼이 단일 원천이다.
|
|
6
|
-
*/
|
|
7
|
-
declare function NewPriceTextField(props: NewPriceTextFieldProps): JSX.Element;
|
|
8
|
-
export default NewPriceTextField;
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(o, k2, desc);
|
|
24
|
-
}) : (function(o, m, k, k2) {
|
|
25
|
-
if (k2 === undefined) k2 = k;
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
-
}) : function(o, v) {
|
|
31
|
-
o["default"] = v;
|
|
32
|
-
});
|
|
33
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
-
};
|
|
43
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
45
|
-
/* eslint-disable react/jsx-no-bind */
|
|
46
|
-
var react_1 = require("react");
|
|
47
|
-
var react_dom_1 = require("react-dom");
|
|
48
|
-
var clickTypeSystemUICssGenerator_1 = __importDefault(require("../../../common/utils/SystemUIPositionGenerator/clickTypeSystemUICssGenerator"));
|
|
49
|
-
var pricing_1 = require("../../../core/pricing");
|
|
50
|
-
var styled_components_1 = __importStar(require("styled-components"));
|
|
51
|
-
var transitionStyle_1 = require("../../../common/styles/movement/transitionStyle");
|
|
52
|
-
var hybrid_1 = require("../../../hybrid");
|
|
53
|
-
var components_1 = require("../../common/components");
|
|
54
|
-
var ContextMenu_1 = require("../ContextMenu");
|
|
55
|
-
var ContextMenuItem_1 = require("../ContextMenuItem");
|
|
56
|
-
var TextLabel_1 = require("../TextLabel");
|
|
57
|
-
/**
|
|
58
|
-
* 문서: Web - PriceTextField (Added in 2.2) — Mobile
|
|
59
|
-
* 통화 정책은 PricingPolicyProvider에서 받고, 값은 react-hook-form 폼이 단일 원천이다.
|
|
60
|
-
*/
|
|
61
|
-
function NewPriceTextField(props) {
|
|
62
|
-
var name = props.name, _a = props.size, size = _a === void 0 ? 'large' : _a, _b = props.state, state = _b === void 0 ? 'normal' : _b, _c = props.responsiveMode, responsiveMode = _c === void 0 ? 'none' : _c, customWidth = props.customWidth, _d = props.deleteBtnMode, deleteBtnMode = _d === void 0 ? 'use' : _d;
|
|
63
|
-
var _e = (0, pricing_1.useNewPriceTextField)(props), hintText = _e.hintText, displayValue = _e.displayValue, rules = _e.rules, errorMessage = _e.errorMessage, isFocused = _e.isFocused, isInputReadOnly = _e.isInputReadOnly, selectedCurrency = _e.selectedCurrency, currencyOptions = _e.currencyOptions, dropdownState = _e.dropdownState, handlers = _e.handlers;
|
|
64
|
-
var _f = (0, react_1.useState)(false), isDropdownOpen = _f[0], setIsDropdownOpen = _f[1];
|
|
65
|
-
var _g = (0, react_1.useState)(null), contextMenuSizeOffset = _g[0], setContextMenuSizeOffset = _g[1];
|
|
66
|
-
var _h = (0, react_1.useState)(null), dropdownPositionOffset = _h[0], setDropdownPositionOffset = _h[1];
|
|
67
|
-
var contextMenuRef = (0, react_1.useRef)(null);
|
|
68
|
-
var dropdownRef = (0, react_1.useRef)(null);
|
|
69
|
-
var isLargeSize = size === 'large' || size === 'rlarge';
|
|
70
|
-
var isError = Boolean(errorMessage);
|
|
71
|
-
var isDropdownReadOnly = dropdownState === 'read_only' || state === 'read_only';
|
|
72
|
-
/** 드롭다운 위치 계산 (포털) */
|
|
73
|
-
(0, react_1.useEffect)(function () {
|
|
74
|
-
if (!isDropdownOpen) {
|
|
75
|
-
setContextMenuSizeOffset(null);
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
if (dropdownRef.current) {
|
|
79
|
-
var _a = dropdownRef.current.getBoundingClientRect(), top_1 = _a.top, right = _a.right, left = _a.left, bottom = _a.bottom;
|
|
80
|
-
setDropdownPositionOffset({
|
|
81
|
-
top: top_1 + window.scrollY,
|
|
82
|
-
right: right + window.scrollX,
|
|
83
|
-
bottom: bottom + window.scrollY,
|
|
84
|
-
left: left + window.scrollX
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
if (contextMenuRef.current) {
|
|
88
|
-
setContextMenuSizeOffset({
|
|
89
|
-
height: contextMenuRef.current.offsetHeight,
|
|
90
|
-
width: contextMenuRef.current.offsetWidth
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
}, [isDropdownOpen]);
|
|
94
|
-
var contextMenuPositionCss = (0, clickTypeSystemUICssGenerator_1.default)({
|
|
95
|
-
sizeOffset: contextMenuSizeOffset,
|
|
96
|
-
positionOffset: dropdownPositionOffset
|
|
97
|
-
});
|
|
98
|
-
var handleDropdownClick = function () {
|
|
99
|
-
if (isDropdownReadOnly) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
setIsDropdownOpen(function (open) { return !open; });
|
|
103
|
-
};
|
|
104
|
-
var handleDropdownBlur = function () {
|
|
105
|
-
setIsDropdownOpen(false);
|
|
106
|
-
};
|
|
107
|
-
var handleCurrencySelect = function (option) {
|
|
108
|
-
setIsDropdownOpen(false);
|
|
109
|
-
handlers.selectCurrency(option.currency);
|
|
110
|
-
};
|
|
111
|
-
var contextMenuWidth = customWidth || (dropdownRef.current ? "".concat(dropdownRef.current.offsetWidth, "px") : '');
|
|
112
|
-
return ((0, jsx_runtime_1.jsxs)(S_NewPriceTextField, __assign({ "x-pds-name": "NewPriceTextField", "x-pds-element-type": "component", "x-pds-device-type": "mobile", inputSize: size, responsiveMode: responsiveMode, customWidth: customWidth }, { children: [(0, jsx_runtime_1.jsxs)(S_ComponentBox, __assign({ inputSize: size, responsiveMode: responsiveMode, isFocused: isFocused, isError: isError, state: state, customWidth: customWidth, isInputReadOnly: isInputReadOnly }, { children: [(0, jsx_runtime_1.jsx)(S_TextFieldBaseWrapper, __assign({ state: state, inputSize: size, isInputReadOnly: isInputReadOnly }, { children: (0, jsx_runtime_1.jsx)(components_1.TextFieldBase, { name: name, hintText: hintText, value: displayValue, validation: rules, textAlign: "right", textLineType: "single", inputType: "text", inputMode: "decimal", preventBlankMode: "all", enterSubmitMode: "none", state: isInputReadOnly ? 'read_only' : 'normal', textSize: "form2", textWeight: "bold", hintTextWeight: "normal", fieldPaddingRight: 12, deleteIconMode: isLargeSize && deleteBtnMode === 'use' && !isInputReadOnly ? 'use' : 'none', deleteIconSize: 20, deleteIconColor: "ui_cpnt_button_icon_disabled", isFocused: isFocused, suffixTextRightSpacingMode: isLargeSize ? 'use' : 'none', onChange: handlers.onChange, onFocus: handlers.onFocus, onBlur: handlers.onBlur, onKeyDown: handlers.onKeyDown, onKeyUp: handlers.onKeyUp, onTarget: handlers.onTarget }) })), (0, jsx_runtime_1.jsx)(S_DropdownWrapper, __assign({ ref: dropdownRef, inputSize: size, onClick: handleDropdownClick, onBlur: handleDropdownBlur, tabIndex: 0, isFocused: isDropdownOpen, dropdownState: isDropdownReadOnly ? 'read_only' : 'normal', isError: isError }, { children: (0, jsx_runtime_1.jsxs)(S_Select, { children: [(0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: selectedCurrency, styleTheme: "caption1Bold", singleLineMode: "use", colorTheme: "sysTextPrimary", ellipsisMode: "use", colorOverride: isDropdownReadOnly ? 'ui_cpnt_button_text_disabled' : 'ui_cpnt_button_text_enabled', lineLimit: 1 }), (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_a", spacingType: "width" }), (0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: 16, fillType: "line", iconName: isDropdownOpen ? 'ic_arrow_up' : 'ic_arrow_down', colorKey: isDropdownReadOnly ? 'ui_cpnt_dropdown_icon_02' : 'ui_cpnt_dropdown_icon_01' })] }) }))] })), isDropdownOpen &&
|
|
113
|
-
(0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(S_ContextMenuWrapper, __assign({ ref: contextMenuRef, contextMenuPositionCss: contextMenuPositionCss }, { children: (0, jsx_runtime_1.jsx)(ContextMenu_1.ContextMenu, __assign({ autoWidthMode: "use", customWidth: contextMenuWidth }, { children: currencyOptions.map(function (option) { return ((0, jsx_runtime_1.jsx)("div", __assign({ onMouseDown: function () { return handleCurrencySelect(option); } }, { children: (0, jsx_runtime_1.jsx)(ContextMenuItem_1.ContextMenuItem, { option: option, size: size === 'rlarge' ? 'large' : size, isSelected: selectedCurrency === option.currency, state: option.state, displayType: "text_only" }) }), option.value)); }) })) })), document.body), errorMessage && state === 'normal' && (0, jsx_runtime_1.jsx)(S_Error, { children: errorMessage })] })));
|
|
114
|
-
}
|
|
115
|
-
var S_NewPriceTextField = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", ";\n ", ";\n ", "\n"], ["\n ", ";\n ", ";\n ", "\n"])), function (_a) {
|
|
116
|
-
var inputSize = _a.inputSize;
|
|
117
|
-
return inputSize &&
|
|
118
|
-
{
|
|
119
|
-
small: 'width: 188px;',
|
|
120
|
-
medium: 'width: 188px;',
|
|
121
|
-
large: 'width: 432px;',
|
|
122
|
-
rlarge: 'width: 100%'
|
|
123
|
-
}[inputSize];
|
|
124
|
-
}, function (_a) {
|
|
125
|
-
var responsiveMode = _a.responsiveMode;
|
|
126
|
-
return responsiveMode === 'use' && 'width: 100%';
|
|
127
|
-
}, function (_a) {
|
|
128
|
-
var customWidth = _a.customWidth;
|
|
129
|
-
return customWidth && "width: ".concat(customWidth, ";");
|
|
130
|
-
});
|
|
131
|
-
var small = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-radius: 10px;\n height: 32px;\n width: 188px;\n"], ["\n border-radius: 10px;\n height: 32px;\n width: 188px;\n"])));
|
|
132
|
-
var medium = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border-radius: 12px;\n height: 40px;\n width: 188px;\n"], ["\n border-radius: 12px;\n height: 40px;\n width: 188px;\n"])));
|
|
133
|
-
var large = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border-radius: 14px;\n height: 48px;\n width: ", ";\n"], ["\n border-radius: 14px;\n height: 48px;\n width: ", ";\n"])), function (_a) {
|
|
134
|
-
var inputSize = _a.inputSize;
|
|
135
|
-
return (inputSize === 'rlarge' ? '100%' : '432px');
|
|
136
|
-
});
|
|
137
|
-
var S_Select = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n justify-content: center;\n width: 100%;\n"], ["\n align-items: center;\n display: flex;\n justify-content: center;\n width: 100%;\n"])));
|
|
138
|
-
var S_ContextMenuWrapper = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: block;\n position: absolute;\n ", ";\n"], ["\n display: block;\n position: absolute;\n ", ";\n"])), function (_a) {
|
|
139
|
-
var contextMenuPositionCss = _a.contextMenuPositionCss;
|
|
140
|
-
return contextMenuPositionCss;
|
|
141
|
-
});
|
|
142
|
-
var S_Error = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n color: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-top: ", ";\n text-align: left;\n white-space: pre-wrap;\n"], ["\n color: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-top: ", ";\n text-align: left;\n white-space: pre-wrap;\n"])), function (_a) {
|
|
143
|
-
var theme = _a.theme;
|
|
144
|
-
return theme.ui_cpnt_textfield_text_error;
|
|
145
|
-
}, function (_a) {
|
|
146
|
-
var theme = _a.theme;
|
|
147
|
-
return theme.mobileFontSize.caption2;
|
|
148
|
-
}, function (_a) {
|
|
149
|
-
var theme = _a.theme;
|
|
150
|
-
return theme.fontWeight.normal;
|
|
151
|
-
}, function (_a) {
|
|
152
|
-
var theme = _a.theme;
|
|
153
|
-
return theme.mobileLineHeight.caption2;
|
|
154
|
-
}, function (_a) {
|
|
155
|
-
var theme = _a.theme;
|
|
156
|
-
return theme.spacing.spacingA;
|
|
157
|
-
});
|
|
158
|
-
var S_ComponentBox = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n align-items: center;\n border: solid 2px\n ", ";\n box-sizing: border-box;\n ", ";\n display: flex;\n ", "\n ", ";\n ", "\n"], ["\n align-items: center;\n border: solid 2px\n ", ";\n box-sizing: border-box;\n ", ";\n display: flex;\n ", "\n ", ";\n ", "\n"])), function (_a) {
|
|
159
|
-
var theme = _a.theme, isError = _a.isError, isFocused = _a.isFocused, state = _a.state;
|
|
160
|
-
if (state === 'read_only') {
|
|
161
|
-
return theme.ui_cpnt_textfield_border_disabled;
|
|
162
|
-
}
|
|
163
|
-
if (isError) {
|
|
164
|
-
return theme.ui_cpnt_textfield_border_error;
|
|
165
|
-
}
|
|
166
|
-
if (isFocused) {
|
|
167
|
-
return theme.ui_cpnt_textfield_border_focus;
|
|
168
|
-
}
|
|
169
|
-
return theme.ui_cpnt_textfield_border_normal;
|
|
170
|
-
}, function (_a) {
|
|
171
|
-
var inputSize = _a.inputSize;
|
|
172
|
-
return inputSize &&
|
|
173
|
-
{
|
|
174
|
-
small: small,
|
|
175
|
-
medium: medium,
|
|
176
|
-
large: large,
|
|
177
|
-
rlarge: large
|
|
178
|
-
}[inputSize];
|
|
179
|
-
}, transitionStyle_1.InputTransition, function (_a) {
|
|
180
|
-
var responsiveMode = _a.responsiveMode;
|
|
181
|
-
return responsiveMode === 'use' && 'width: 100%';
|
|
182
|
-
}, function (_a) {
|
|
183
|
-
var customWidth = _a.customWidth;
|
|
184
|
-
return customWidth && "width: ".concat(customWidth, ";");
|
|
185
|
-
});
|
|
186
|
-
var S_TextFieldBaseWrapper = styled_components_1.default.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n border-radius: ", ";\n display: flex;\n flex: 1;\n height: 100%;\n min-width: 0;\n padding-left: ", ";\n\n ", "\n"], ["\n align-items: center;\n background-color: ", ";\n border-radius: ", ";\n display: flex;\n flex: 1;\n height: 100%;\n min-width: 0;\n padding-left: ", ";\n\n ", "\n"])), function (_a) {
|
|
187
|
-
var theme = _a.theme, state = _a.state, isInputReadOnly = _a.isInputReadOnly;
|
|
188
|
-
return isInputReadOnly || state === 'read_only'
|
|
189
|
-
? theme.ui_cpnt_textfield_base_disabled
|
|
190
|
-
: theme.ui_cpnt_textfield_base_normal;
|
|
191
|
-
}, function (_a) {
|
|
192
|
-
var inputSize = _a.inputSize;
|
|
193
|
-
switch (inputSize) {
|
|
194
|
-
case 'small':
|
|
195
|
-
return '8px 0 0 8px';
|
|
196
|
-
case 'medium':
|
|
197
|
-
return '10px 0 0 10px';
|
|
198
|
-
default:
|
|
199
|
-
return '12px 0 0 12px';
|
|
200
|
-
}
|
|
201
|
-
}, function (_a) {
|
|
202
|
-
var theme = _a.theme;
|
|
203
|
-
return theme.spacing.spacingD;
|
|
204
|
-
}, function (_a) {
|
|
205
|
-
var state = _a.state, isInputReadOnly = _a.isInputReadOnly, theme = _a.theme;
|
|
206
|
-
return state === 'normal' &&
|
|
207
|
-
!isInputReadOnly && (0, styled_components_1.css)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n &:active {\n background-color: ", ";\n }\n "], ["\n &:active {\n background-color: ", ";\n }\n "])), theme.ui_cpnt_textfield_base_pressed);
|
|
208
|
-
});
|
|
209
|
-
var S_DropdownWrapper = styled_components_1.default.div(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n border-radius: ", ";\n display: flex;\n height: 100%;\n min-width: 50px;\n outline: none;\n padding: 0\n ", ";\n\n ", "\n"], ["\n align-items: center;\n background-color: ", ";\n border-radius: ", ";\n display: flex;\n height: 100%;\n min-width: 50px;\n outline: none;\n padding: 0\n ", ";\n\n ", "\n"])), function (_a) {
|
|
210
|
-
var theme = _a.theme, dropdownState = _a.dropdownState;
|
|
211
|
-
return dropdownState === 'read_only'
|
|
212
|
-
? theme.ui_cpnt_textfield_base_disabled
|
|
213
|
-
: theme.ui_cpnt_textfield_base_normal;
|
|
214
|
-
}, function (_a) {
|
|
215
|
-
var inputSize = _a.inputSize;
|
|
216
|
-
switch (inputSize) {
|
|
217
|
-
case 'small':
|
|
218
|
-
return '0 8px 8px 0';
|
|
219
|
-
case 'medium':
|
|
220
|
-
return '0 10px 10px 0';
|
|
221
|
-
default:
|
|
222
|
-
return '0 12px 12px 0';
|
|
223
|
-
}
|
|
224
|
-
}, function (_a) {
|
|
225
|
-
var theme = _a.theme, inputSize = _a.inputSize;
|
|
226
|
-
return inputSize === 'small' || inputSize === 'medium'
|
|
227
|
-
? theme.spacing.spacingB
|
|
228
|
-
: theme.spacing.spacingD;
|
|
229
|
-
}, function (_a) {
|
|
230
|
-
var dropdownState = _a.dropdownState, theme = _a.theme;
|
|
231
|
-
return dropdownState === 'normal' && (0, styled_components_1.css)(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n &:active {\n background-color: ", ";\n }\n "], ["\n &:active {\n background-color: ", ";\n }\n "])), theme.ui_cpnt_textfield_base_pressed);
|
|
232
|
-
});
|
|
233
|
-
exports.default = NewPriceTextField;
|
|
234
|
-
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;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as NewPriceTextField } from './NewPriceTextField';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.NewPriceTextField = void 0;
|
|
7
|
-
var NewPriceTextField_1 = require("./NewPriceTextField");
|
|
8
|
-
Object.defineProperty(exports, "NewPriceTextField", { enumerable: true, get: function () { return __importDefault(NewPriceTextField_1).default; } });
|
|
File without changes
|