@sellmate/design-system 1.0.15 → 1.0.16
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/cjs/design-system.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{sd-button_17.cjs.entry.js → sd-button_18.cjs.entry.js} +283 -15
- package/dist/cjs/sd-popover.cjs.entry.js +2 -2
- package/dist/cjs/sd-progress.cjs.entry.js +2 -2
- package/dist/cjs/sd-select-multiple.cjs.entry.js +1 -1
- package/dist/cjs/sd-select-option-group.cjs.entry.js +3 -3
- package/dist/cjs/sd-toggle-button.cjs.entry.js +1 -1
- package/dist/cjs/sd-toggle.cjs.entry.js +1 -1
- package/dist/collection/components/sd-field/sd-field.js +4 -3
- package/dist/collection/components/sd-field/sd-field.js.map +1 -1
- package/dist/collection/components/sd-number-input/sd-number-input.css +4 -25
- package/dist/collection/components/sd-number-input/sd-number-input.js +186 -27
- package/dist/collection/components/sd-number-input/sd-number-input.js.map +1 -1
- package/dist/collection/components/sd-pagination/sd-pagination.js +2 -2
- package/dist/collection/components/sd-popover/sd-popover.js +2 -2
- package/dist/collection/components/sd-portal/sd-portal.js +1 -1
- package/dist/collection/components/sd-progress/sd-progress.js +2 -2
- package/dist/collection/components/sd-select/sd-select-dropdown/sd-select-dropdown.js +2 -2
- package/dist/collection/components/sd-select/sd-select-option/sd-select-option.js +1 -1
- package/dist/collection/components/sd-select/sd-select-search-input/sd-select-search-input.js +3 -3
- package/dist/collection/components/sd-select-multiple/sd-select-multiple.js +1 -1
- package/dist/collection/components/sd-select-multiple-group/sd-select-option-group/sd-select-option-group.js +3 -3
- package/dist/collection/components/sd-textarea/sd-textarea.js +2 -2
- package/dist/collection/components/sd-toggle/sd-toggle.js +1 -1
- package/dist/collection/components/sd-toggle-button/sd-toggle-button.js +1 -1
- package/dist/components/{p-Bgf0RnXW.js → p-B-8YfRUg.js} +5 -5
- package/dist/components/{p-Bgf0RnXW.js.map → p-B-8YfRUg.js.map} +1 -1
- package/dist/components/{p-SUihbngJ.js → p-C2pN-_wD.js} +6 -5
- package/dist/components/p-C2pN-_wD.js.map +1 -0
- package/dist/components/p-CCwNgVmC.js +16 -0
- package/dist/components/p-CCwNgVmC.js.map +1 -0
- package/dist/components/{p-CYr3YYfa.js → p-CFHNnfIq.js} +7 -7
- package/dist/components/{p-CYr3YYfa.js.map → p-CFHNnfIq.js.map} +1 -1
- package/dist/components/{p-CXyVUgP3.js → p-CkzAorp3.js} +8 -8
- package/dist/components/{p-CXyVUgP3.js.map → p-CkzAorp3.js.map} +1 -1
- package/dist/components/{p-CbEUJ3R6.js → p-D16-dM6f.js} +3 -3
- package/dist/components/{p-CbEUJ3R6.js.map → p-D16-dM6f.js.map} +1 -1
- package/dist/components/{p-wRu9w6Gl.js → p-DUh9r-hn.js} +4 -4
- package/dist/components/{p-wRu9w6Gl.js.map → p-DUh9r-hn.js.map} +1 -1
- package/dist/components/{p-B0HvHSm3.js → p-DjZ8vXCq.js} +9 -8
- package/dist/components/p-DjZ8vXCq.js.map +1 -0
- package/dist/components/{p-CYYaSMIB.js → p-Dv4dN3Y5.js} +3 -3
- package/dist/components/{p-CYYaSMIB.js.map → p-Dv4dN3Y5.js.map} +1 -1
- package/dist/components/{p-DQE5-tOR.js → p-xfqZA_70.js} +5 -16
- package/dist/components/p-xfqZA_70.js.map +1 -0
- package/dist/components/sd-date-picker.js +3 -3
- package/dist/components/sd-date-range-picker.js +3 -3
- package/dist/components/sd-field.js +1 -1
- package/dist/components/sd-guide.js +1 -1
- package/dist/components/sd-input.js +1 -1
- package/dist/components/sd-number-input.js +64 -23
- package/dist/components/sd-number-input.js.map +1 -1
- package/dist/components/sd-pagination.js +1 -1
- package/dist/components/sd-popover.js +2 -2
- package/dist/components/sd-portal.js +1 -1
- package/dist/components/sd-progress.js +2 -2
- package/dist/components/sd-select-dropdown.js +1 -1
- package/dist/components/sd-select-multiple-group.js +5 -5
- package/dist/components/sd-select-multiple.js +7 -7
- package/dist/components/sd-select-option-group.js +1 -1
- package/dist/components/sd-select-option.js +1 -1
- package/dist/components/sd-select-search-input.js +1 -1
- package/dist/components/sd-select.js +1 -1
- package/dist/components/sd-table.js +8 -8
- package/dist/components/sd-textarea.js +2 -2
- package/dist/components/sd-toggle-button.js +1 -1
- package/dist/components/sd-toggle.js +1 -1
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/design-system/p-35a79a70.entry.js +2 -0
- package/dist/design-system/p-559728ad.entry.js +2 -0
- package/dist/design-system/p-559728ad.entry.js.map +1 -0
- package/dist/design-system/{p-cb3dd19f.entry.js → p-c77a42a2.entry.js} +2 -2
- package/dist/design-system/{p-1d6dabd7.entry.js → p-d7258320.entry.js} +2 -2
- package/dist/design-system/{p-44af67a6.entry.js → p-e5272c50.entry.js} +2 -2
- package/dist/design-system/{p-1616a1f6.entry.js → p-e6d39e65.entry.js} +2 -2
- package/dist/design-system/{p-cb502581.entry.js → p-ee96032f.entry.js} +2 -2
- package/dist/esm/design-system.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{sd-button_17.entry.js → sd-button_18.entry.js} +283 -16
- package/dist/esm/sd-popover.entry.js +2 -2
- package/dist/esm/sd-progress.entry.js +2 -2
- package/dist/esm/sd-select-multiple.entry.js +1 -1
- package/dist/esm/sd-select-option-group.entry.js +3 -3
- package/dist/esm/sd-toggle-button.entry.js +1 -1
- package/dist/esm/sd-toggle.entry.js +1 -1
- package/dist/types/components/sd-number-input/sd-number-input.d.ts +12 -3
- package/dist/types/components.d.ts +44 -2
- package/hydrate/index.js +62 -45
- package/hydrate/index.mjs +62 -45
- package/package.json +1 -1
- package/dist/cjs/sd-number-input.cjs.entry.js +0 -262
- package/dist/components/p-B0HvHSm3.js.map +0 -1
- package/dist/components/p-DQE5-tOR.js.map +0 -1
- package/dist/components/p-SUihbngJ.js.map +0 -1
- package/dist/design-system/p-29b74787.entry.js +0 -2
- package/dist/design-system/p-29b74787.entry.js.map +0 -1
- package/dist/design-system/p-390feb8e.entry.js +0 -2
- package/dist/design-system/p-54376630.entry.js +0 -2
- package/dist/design-system/p-54376630.entry.js.map +0 -1
- package/dist/esm/sd-number-input.entry.js +0 -260
- package/dist/esm/sd-number-input.entry.js.map +0 -1
- /package/dist/design-system/{p-390feb8e.entry.js.map → p-35a79a70.entry.js.map} +0 -0
- /package/dist/design-system/{p-cb3dd19f.entry.js.map → p-c77a42a2.entry.js.map} +0 -0
- /package/dist/design-system/{p-1d6dabd7.entry.js.map → p-d7258320.entry.js.map} +0 -0
- /package/dist/design-system/{p-44af67a6.entry.js.map → p-e5272c50.entry.js.map} +0 -0
- /package/dist/design-system/{p-1616a1f6.entry.js.map → p-e6d39e65.entry.js.map} +0 -0
- /package/dist/design-system/{p-cb502581.entry.js.map → p-ee96032f.entry.js.map} +0 -0
package/hydrate/index.mjs
CHANGED
|
@@ -4436,6 +4436,7 @@ const FORM_PARENT_TAGS = [
|
|
|
4436
4436
|
'sd-select-multiple-group',
|
|
4437
4437
|
'sd-input',
|
|
4438
4438
|
'sd-textarea',
|
|
4439
|
+
'sd-number-input',
|
|
4439
4440
|
];
|
|
4440
4441
|
class SdField {
|
|
4441
4442
|
constructor(hostRef) {
|
|
@@ -4547,15 +4548,15 @@ class SdField {
|
|
|
4547
4548
|
}
|
|
4548
4549
|
}
|
|
4549
4550
|
render() {
|
|
4550
|
-
return (hAsync("div", { key: '
|
|
4551
|
+
return (hAsync("div", { key: '3c69abe493110b5665795706a9ae0e525f213aca', class: {
|
|
4551
4552
|
'sd-field': true,
|
|
4552
4553
|
'sd-field--has-label': !!this.label,
|
|
4553
4554
|
'sd-field--has-label-inside': !!this.label && this.insideLabel,
|
|
4554
4555
|
[this.fieldStatus]: !!this.fieldStatus,
|
|
4555
|
-
} }, hAsync("div", { key: '
|
|
4556
|
+
} }, hAsync("div", { key: 'decc6821b7172f5ecc2343472014c08674725904', class: "sd-field__wrapper" }, this.renderLabel(this.label), hAsync("div", { key: 'ca5e93f049db10ecaaaab091fdf394ac4b55e292', class: {
|
|
4556
4557
|
'sd-field__control': true,
|
|
4557
4558
|
'sd-field__control--label-inside ': !!this.label && this.insideLabel,
|
|
4558
|
-
} }, hAsync("slot", { key: '
|
|
4559
|
+
} }, hAsync("slot", { key: '7ee38983d32985f4b4a035830bcdca0e14b2cf71' }))), this.errorMsg && hAsync("div", { key: 'c2d6ef860ced48657b906806f2618594b094ea79', class: "sd-field__error-message" }, this.errorMsg)));
|
|
4559
4560
|
}
|
|
4560
4561
|
renderLabel(label) {
|
|
4561
4562
|
if (!label)
|
|
@@ -7336,7 +7337,7 @@ class SdModalCard {
|
|
|
7336
7337
|
}; }
|
|
7337
7338
|
}
|
|
7338
7339
|
|
|
7339
|
-
const sdNumberInputCss = () => `sd-icon{display:inline-block;line-height:0}sd-icon .sd-icon--rotate-90{transform:rotate(90deg)}sd-icon .sd-icon--rotate-180{transform:rotate(180deg)}sd-icon .sd-icon--rotate-270{transform:rotate(270deg)}sd-number-input .sd-number-input
|
|
7340
|
+
const sdNumberInputCss = () => `sd-icon{display:inline-block;line-height:0}sd-icon .sd-icon--rotate-90{transform:rotate(90deg)}sd-icon .sd-icon--rotate-180{transform:rotate(180deg)}sd-icon .sd-icon--rotate-270{transform:rotate(270deg)}sd-number-input .sd-number-input{box-sizing:border-box;display:flex;width:var(--input-width, 100%);align-items:center;height:28px;padding:4px 8px;border-radius:4px;color:#333333;font-size:12px;line-height:20px;position:relative}sd-number-input .sd-number-input .sd-number-input__input{display:block;width:100%;height:20px;line-height:20px;border:none;outline:none;background:transparent;font-size:inherit;color:#333333;margin-left:4px;margin-right:4px;padding-block:0;padding-inline:0;text-align:right}sd-number-input .sd-number-input .sd-number-input__input[disabled]{cursor:not-allowed;color:#888888}sd-number-input .sd-number-input .sd-number-input__input::placeholder{font-size:12px;height:20px;line-height:20px;color:#aaaaaa}sd-number-input .sd-number-input .sd-number-input__clear-icon{cursor:pointer;margin-left:8px}sd-number-input .sd-number-input .sd-number-input__buttons{padding:4px;display:flex;justify-content:space-between;align-items:center;position:absolute;inset:0;opacity:0;pointer-events:none;transition:opacity 0.2s ease}sd-number-input .sd-number-input .sd-number-input__button{width:20px;height:20px;border:none;border-radius:2px;background-color:#eff6ff;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;margin:0;transition:background-color 0.2s ease}sd-number-input .sd-number-input .sd-number-input__button:hover:not(:disabled){background-color:#e6f1ff}sd-number-input .sd-number-input .sd-number-input__button:disabled{background-color:#eeeeee;cursor:not-allowed}sd-number-input .sd-number-input .sd-number-input__button--decrement{border-bottom-left-radius:0;border-bottom-right-radius:0}sd-number-input .sd-number-input .sd-number-input__button--increment{border-top-left-radius:0;border-top-right-radius:0}sd-number-input .sd-number-input .sd-number-input__label{margin-bottom:8px;font-weight:500;color:#333333}sd-number-input:focus-within .sd-number-input__buttons{opacity:1;pointer-events:auto}sd-number-input:focus-within .sd-number-input{border-color:#0075ff;box-shadow:0 0 4px 0 rgba(0, 113, 255, 0.4)}`;
|
|
7340
7341
|
|
|
7341
7342
|
class SdNumberInput {
|
|
7342
7343
|
constructor(hostRef) {
|
|
@@ -7353,20 +7354,24 @@ class SdNumberInput {
|
|
|
7353
7354
|
useDecimal = false;
|
|
7354
7355
|
value = null;
|
|
7355
7356
|
label;
|
|
7357
|
+
insideLabel = false;
|
|
7356
7358
|
placeholder = '입력해 주세요.';
|
|
7357
7359
|
disabled = false;
|
|
7358
7360
|
width;
|
|
7359
|
-
rules;
|
|
7361
|
+
rules = [];
|
|
7360
7362
|
autoFocus = false;
|
|
7361
7363
|
status;
|
|
7362
7364
|
inputClass = '';
|
|
7363
7365
|
readonly = false;
|
|
7364
7366
|
inputStyle = {};
|
|
7367
|
+
error = false;
|
|
7368
|
+
focused = false;
|
|
7369
|
+
hovered = false;
|
|
7365
7370
|
internalValue = null;
|
|
7366
7371
|
displayValue = '';
|
|
7367
|
-
hovered = false;
|
|
7368
|
-
error = false;
|
|
7369
7372
|
nativeEl = undefined;
|
|
7373
|
+
formField;
|
|
7374
|
+
name = nanoid();
|
|
7370
7375
|
update;
|
|
7371
7376
|
focus;
|
|
7372
7377
|
blur;
|
|
@@ -7437,16 +7442,18 @@ class SdNumberInput {
|
|
|
7437
7442
|
this.value = newValue;
|
|
7438
7443
|
this.update?.emit(newValue);
|
|
7439
7444
|
}
|
|
7440
|
-
|
|
7441
|
-
|
|
7442
|
-
this.
|
|
7443
|
-
|
|
7444
|
-
|
|
7445
|
-
|
|
7446
|
-
|
|
7447
|
-
|
|
7448
|
-
|
|
7449
|
-
|
|
7445
|
+
}
|
|
7446
|
+
async sdValidate() {
|
|
7447
|
+
this.formField?.sdValidate();
|
|
7448
|
+
}
|
|
7449
|
+
async sdReset() {
|
|
7450
|
+
this.formField?.sdReset();
|
|
7451
|
+
}
|
|
7452
|
+
async sdResetValidate() {
|
|
7453
|
+
this.formField?.sdResetValidation();
|
|
7454
|
+
}
|
|
7455
|
+
async sdFocus() {
|
|
7456
|
+
this.formField?.sdFocus();
|
|
7450
7457
|
}
|
|
7451
7458
|
componentWillLoad() {
|
|
7452
7459
|
if (this.value !== null && this.value !== undefined) {
|
|
@@ -7509,11 +7516,15 @@ class SdNumberInput {
|
|
|
7509
7516
|
handleFocus = (event) => {
|
|
7510
7517
|
this.focus?.emit(event);
|
|
7511
7518
|
};
|
|
7512
|
-
handleBlur = (event) => {
|
|
7519
|
+
handleBlur = async (event) => {
|
|
7513
7520
|
this.updateDisplay();
|
|
7514
7521
|
if (this.nativeEl) {
|
|
7515
7522
|
this.nativeEl.value = this.displayValue;
|
|
7516
7523
|
}
|
|
7524
|
+
if (this.rules && this.rules.length > 0) {
|
|
7525
|
+
await this.formField?.sdValidate();
|
|
7526
|
+
}
|
|
7527
|
+
this.focused = false;
|
|
7517
7528
|
this.blur?.emit(event);
|
|
7518
7529
|
};
|
|
7519
7530
|
handleKeyDown = (event) => {
|
|
@@ -7573,17 +7584,17 @@ class SdNumberInput {
|
|
|
7573
7584
|
const inputStyles = {
|
|
7574
7585
|
textAlign: this.useButton ? 'center' : 'right',
|
|
7575
7586
|
};
|
|
7576
|
-
return (hAsync("
|
|
7587
|
+
return (hAsync("sd-field", { key: 'ea231ae67c1e209d4c9adca87bd9760bcd28ec51', name: this.name, label: this.label, insideLabel: this.insideLabel, rules: this.rules, error: this.error, disabled: this.disabled, focused: this.focused, hovered: this.hovered, status: this.status, ref: el => (this.formField = el), style: inputWidth }, hAsync("label", { key: '76bbc2fb1e36d25887ac0559ff7f34617a35883e', class: {
|
|
7577
7588
|
'sd-number-input': true,
|
|
7578
7589
|
[this.getInputStatus()]: true,
|
|
7579
7590
|
'sd-number-input--with-buttons': this.useButton,
|
|
7580
|
-
}, onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false), style: this.inputStyle }, hAsync("input", { key: '
|
|
7591
|
+
}, onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false), style: this.inputStyle }, hAsync("input", { key: '7978c4e8383017b9a8213e827f92c2d9ccc7b275', name: this.name, ref: el => (this.nativeEl = el), class: `sd-number-input__input ${this.inputClass}`, type: "text", inputMode: "numeric", value: this.displayValue, placeholder: this.placeholder, disabled: this.disabled, readonly: this.readonly, autofocus: this.autoFocus, onInput: this.handleInput, onKeyDown: this.handleKeyDown, style: inputStyles, onFocus: this.handleFocus, onBlur: this.handleBlur }), this.useButton && (hAsync("div", { key: 'aff328615ab939724ee0f77f4b7ac8b046eb16d1', class: "sd-number-input__buttons" }, hAsync("button", { key: 'a27a592cc4e74b3272e3473988dbd877e9d0afd3', type: "button", class: {
|
|
7581
7592
|
'sd-number-input__button': true,
|
|
7582
7593
|
'sd-number-input__button--decrement': true,
|
|
7583
|
-
}, disabled: this.isDecrementDisabled(), onClick: this.handleDecrement, tabindex: -1 }, hAsync("sd-icon", { key: '
|
|
7594
|
+
}, disabled: this.isDecrementDisabled(), onClick: this.handleDecrement, tabindex: -1 }, hAsync("sd-icon", { key: '79853e0a9ab38cfaafbd8027dae1a0732702d5bc', name: "minus", size: 12, color: this.isDecrementDisabled() ? 'grey_45' : 'brilliantblue_70' })), hAsync("button", { key: '0993c22719cdbdf3982dea138653ba1f2f6aa523', type: "button", class: {
|
|
7584
7595
|
'sd-number-input__button': true,
|
|
7585
7596
|
'sd-number-input__button--increment': true,
|
|
7586
|
-
}, disabled: this.isIncrementDisabled(), onClick: this.handleIncrement, tabindex: -1 }, hAsync("sd-icon", { key: '
|
|
7597
|
+
}, disabled: this.isIncrementDisabled(), onClick: this.handleIncrement, tabindex: -1 }, hAsync("sd-icon", { key: '6da02951a443a1a46fd44f6bd7c1a7ed41af0b01', name: "add", size: 12, color: this.isIncrementDisabled() ? 'grey_45' : 'brilliantblue_70' })))))));
|
|
7587
7598
|
}
|
|
7588
7599
|
static get watchers() { return {
|
|
7589
7600
|
"value": ["valueChanged"],
|
|
@@ -7601,6 +7612,7 @@ class SdNumberInput {
|
|
|
7601
7612
|
"useDecimal": [4, "use-decimal"],
|
|
7602
7613
|
"value": [1032],
|
|
7603
7614
|
"label": [1],
|
|
7615
|
+
"insideLabel": [4, "inside-label"],
|
|
7604
7616
|
"placeholder": [1],
|
|
7605
7617
|
"disabled": [4],
|
|
7606
7618
|
"width": [8],
|
|
@@ -7610,10 +7622,15 @@ class SdNumberInput {
|
|
|
7610
7622
|
"inputClass": [1, "input-class"],
|
|
7611
7623
|
"readonly": [4],
|
|
7612
7624
|
"inputStyle": [16],
|
|
7625
|
+
"error": [1028],
|
|
7626
|
+
"focused": [1028],
|
|
7627
|
+
"hovered": [1028],
|
|
7613
7628
|
"internalValue": [32],
|
|
7614
7629
|
"displayValue": [32],
|
|
7615
|
-
"
|
|
7616
|
-
"
|
|
7630
|
+
"sdValidate": [64],
|
|
7631
|
+
"sdReset": [64],
|
|
7632
|
+
"sdResetValidate": [64],
|
|
7633
|
+
"sdFocus": [64],
|
|
7617
7634
|
"sdGetNativeElement": [64]
|
|
7618
7635
|
},
|
|
7619
7636
|
"$listeners$": undefined,
|
|
@@ -7697,12 +7714,12 @@ class SdPagination {
|
|
|
7697
7714
|
}
|
|
7698
7715
|
}
|
|
7699
7716
|
render() {
|
|
7700
|
-
return (hAsync("div", { key: '
|
|
7717
|
+
return (hAsync("div", { key: 'feed08139c382f91539bc316a967ed1738529688', class: this.paginationClasses }, hAsync("div", { key: '42c908d7a685f2acab29a94d040e4f4c513fff38', class: "prepend-btns" }, this.renderPrevButtons()), this.simple ? (hAsync("div", { class: "pagination-info" }, hAsync("span", { class: "current-page" }, this.currentPage), hAsync("span", null, "/"), hAsync("span", { class: "last-page" }, this.lastPage))) : (this.pageNumbers.map(n => (hAsync("button", { type: "button", "aria-current": this.currentPage === n ? 'page' : undefined, class: {
|
|
7701
7718
|
'pagination-btn': true,
|
|
7702
7719
|
'pagination-btn--selected': this.currentPage === n,
|
|
7703
7720
|
}, disabled: this.currentPage === n, style: {
|
|
7704
7721
|
'--pagination-btn-width': `${this.buttonWidth}px`,
|
|
7705
|
-
}, onClick: () => this.handlePageChange(n) }, n)))), hAsync("div", { key: '
|
|
7722
|
+
}, onClick: () => this.handlePageChange(n) }, n)))), hAsync("div", { key: '2be11ae773c0bce71ecaf53f99daff3f5b2d567d', class: "append-btns" }, this.renderNextButtons())));
|
|
7706
7723
|
}
|
|
7707
7724
|
static get style() { return sdPaginationCss(); }
|
|
7708
7725
|
static get cmpMeta() { return {
|
|
@@ -7756,11 +7773,11 @@ class SdPopover {
|
|
|
7756
7773
|
this.showPopover = false;
|
|
7757
7774
|
};
|
|
7758
7775
|
render() {
|
|
7759
|
-
return (hAsync(Fragment, { key: '
|
|
7776
|
+
return (hAsync(Fragment, { key: '883bea0d5ef88bb63b4a1a2d778aedf0bce6f000' }, this.label ? (hAsync("sd-button", { ref: el => (this.buttonEl = el), label: this.label, icon: this.icon, size: this.buttonSize, color: this.color, variant: this.buttonVariant, class: "sd-popover", onClick: () => (this.showPopover = !this.showPopover) })) : (hAsync("sd-icon", { ref: el => (this.buttonEl = el), name: this.icon, size: this.iconSize, color: this.color, class: "sd-popover", onClick: () => (this.showPopover = !this.showPopover) })), this.showPopover && (hAsync("sd-floating-portal", { key: '748b76d151dce05cffdd97d9803a96f14554ad3b', parentRef: this.buttonEl, onSdClose: this.handleClose, placement: this.placement }, hAsync("div", { key: '36bd2a265c89589b13e67107d57e8045a87d6b40', class: {
|
|
7760
7777
|
'sd-floating-menu': true,
|
|
7761
7778
|
[`sd-floating-menu--${this.placement}`]: true,
|
|
7762
7779
|
[this.menuClass]: !!this.menuClass,
|
|
7763
|
-
} }, hAsync("i", { key: '
|
|
7780
|
+
} }, hAsync("i", { key: 'cd9b298e666ce898c83576c869e60e1e5e0bb38f', class: `sd-floating-menu__arrow sd-floating-menu__arrow--${this.placement}` }, hAsync(TooltipArrow, { key: '79012e2c547a71e2084958925445ac26a8bbf7fe' })), hAsync("div", { key: '0664419fe24318ced7cbca2da1b9e0741c48f333', class: "sd-floating-menu__content" }, this.menuTitle && hAsync("div", { key: 'a3f9238db85a7ca245cb5f794e1a9249742c3b42', class: "sd-floating-menu__title" }, this.menuTitle), this.messages.length > 0 && (hAsync("div", { key: '56696f99a5400276c099a8ca69f904b4a932802c', class: "sd-floating-menu__messages" }, this.messages.map(message => (hAsync("div", null, message))))), this.buttons.length > 0 && (hAsync("div", { key: 'cbdf8231857ccb20156d25758dbe2d1809e28656', class: `sd-floating-menu__buttons sd-floating-menu__buttons--${this.buttons.length}` }, this.buttons.map(button => (hAsync("sd-button", { ...button })))))), this.useClose && (hAsync("button", { key: 'a2f249d05c6cd40d24005307d78aea95a841b0b8', title: "close", class: "sd-floating-menu__close-button", onClick: () => this.handleClose() }, hAsync("sd-icon", { key: '13ba057c4acf7ae65cfe8d722fe8bdb69ce506ac', name: "close", size: "12", color: "gery_55" }))))))));
|
|
7764
7781
|
}
|
|
7765
7782
|
static get watchers() { return {
|
|
7766
7783
|
"show": ["watchShowHandler"]
|
|
@@ -7911,7 +7928,7 @@ class SdPortal {
|
|
|
7911
7928
|
this.close.emit();
|
|
7912
7929
|
}
|
|
7913
7930
|
render() {
|
|
7914
|
-
return hAsync("slot", { key: '
|
|
7931
|
+
return hAsync("slot", { key: 'ba2bf5df16f9bef0acef1ac8a08b090a23d02bc7' });
|
|
7915
7932
|
}
|
|
7916
7933
|
static get cmpMeta() { return {
|
|
7917
7934
|
"$flags$": 772,
|
|
@@ -7968,10 +7985,10 @@ class SdProgress {
|
|
|
7968
7985
|
return this.statusColor[this.progressStatus];
|
|
7969
7986
|
}
|
|
7970
7987
|
render() {
|
|
7971
|
-
return (hAsync("div", { key: '
|
|
7988
|
+
return (hAsync("div", { key: '43da9dac67e760bfe53b8db11c27eef7ef0d8b3b', style: {
|
|
7972
7989
|
'--progress-color': this.progressColor,
|
|
7973
7990
|
'--progress-percentage': `${this.progressPercentage}%`,
|
|
7974
|
-
} }, this.type === 'bar' ? this.renderBarProgress() : this.renderSpinnerProgress(), this.label && hAsync("div", { key: '
|
|
7991
|
+
} }, this.type === 'bar' ? this.renderBarProgress() : this.renderSpinnerProgress(), this.label && hAsync("div", { key: 'af4b1c44f655546fede8ad548bddc6afb7810d2b', class: "sd-progress__label" }, this.label)));
|
|
7975
7992
|
}
|
|
7976
7993
|
renderBarProgress() {
|
|
7977
7994
|
return (hAsync("div", { class: `sd-progress__bar sd-progress__bar--${this.progressStatus}` }, hAsync("div", { class: ['sd-progress__bar__percent', this.progressPercentage < 100 ? 'proceed' : ''].join(' ') }), hAsync("div", { class: "sd-progress__bar__indicator sd-progress__bar__indicator--left" }, this.progressPercentage, "%"), hAsync("div", { class: "sd-progress__bar__indicator sd-progress__bar__indicator--right" }, this.progressPercentage, "%")));
|
|
@@ -8634,10 +8651,10 @@ class SdSelectDropdown {
|
|
|
8634
8651
|
this.isScrolled = scrollTop > 0;
|
|
8635
8652
|
};
|
|
8636
8653
|
render() {
|
|
8637
|
-
return (hAsync("div", { key: '
|
|
8654
|
+
return (hAsync("div", { key: 'ff55e2e133114accc2641a0025bdcf551eda3511', class: {
|
|
8638
8655
|
'sd-select-dropdown': true,
|
|
8639
8656
|
'sd-select-dropdown--ready': this.isDropdownReady,
|
|
8640
|
-
}, style: this.dropdownSize, onScroll: this.handleDropdownScroll, ref: el => (this.dropdownRef = el) }, this.searchable && (hAsync("sd-select-search-input", { key: '
|
|
8657
|
+
}, style: this.dropdownSize, onScroll: this.handleDropdownScroll, ref: el => (this.dropdownRef = el) }, this.searchable && (hAsync("sd-select-search-input", { key: 'bfcee14aa06a9a259dd8e67013ed1074c1f9c318', ref: el => (this.searchRef = el), isScrolled: this.isScrolled, searchText: this.searchText, onSdSearchInput: (event) => (this.searchText = event.detail || ''), onSdSearchFocus: () => (this.itemIndex = -1) })), this.filteredOptions.length > 0 ? (this.filteredOptions.map((option, index) => (hAsync("slot", { name: `option-${option.value}` }, hAsync("sd-select-option", { option: option, index: index, isSelected: this.isOptionSelected(option.value), isFocused: index === this.itemIndex, onOptionClick: ({ detail }) => this.optionClick.emit(detail), useCheckbox: this.useCheckbox }))))) : (hAsync("slot", { name: "option-placeholder" }, hAsync("div", { class: 'sd-select-option-placeholder' }, this.optionPlaceholder)))));
|
|
8641
8658
|
}
|
|
8642
8659
|
static get watchers() { return {
|
|
8643
8660
|
"filteredOptions": ["filteredOptionsChanged"],
|
|
@@ -8817,7 +8834,7 @@ class SdSelectMultiple extends BaseDropdownEvent {
|
|
|
8817
8834
|
this.handleOptionSelection(option);
|
|
8818
8835
|
};
|
|
8819
8836
|
render() {
|
|
8820
|
-
return (hAsync("sd-field", { key: '
|
|
8837
|
+
return (hAsync("sd-field", { key: 'a70e7fefb98428e616d2f124923dfa7ee7a7c2e2', label: this.label, name: this.name, rules: this.rules, error: this.error, disabled: this.disabled, useLabelRequired: this.useLabelRequired, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el) }, hAsync("div", { key: 'fda63e4e8dcc72aa0147b2981b49b7e28e377ee8', class: {
|
|
8821
8838
|
'sd-select-multiple': true,
|
|
8822
8839
|
'sd-select-multiple--open': this.isOpen,
|
|
8823
8840
|
'sd-select-multiple--disabled': this.disabled,
|
|
@@ -9400,7 +9417,7 @@ class SdSelectOption {
|
|
|
9400
9417
|
}
|
|
9401
9418
|
};
|
|
9402
9419
|
render() {
|
|
9403
|
-
return (hAsync("div", { key: '
|
|
9420
|
+
return (hAsync("div", { key: 'a4fcca24b0bdde4f4665585c6cede84bd3b64d59', class: {
|
|
9404
9421
|
'sd-select__option': true,
|
|
9405
9422
|
'sd-select__option--selected': this.isSelected,
|
|
9406
9423
|
'sd-select__option--disabled': !!this.option.disabled,
|
|
@@ -9486,7 +9503,7 @@ class SdSelectOptionGroup {
|
|
|
9486
9503
|
}
|
|
9487
9504
|
};
|
|
9488
9505
|
render() {
|
|
9489
|
-
return (hAsync("div", { key: '
|
|
9506
|
+
return (hAsync("div", { key: '8e88aacd2c3122a563fcf78bcbe9731b6a29d8c5', class: {
|
|
9490
9507
|
'sd-select__option-group': true,
|
|
9491
9508
|
'sd-select__option-group--selected': !!this.isSelected,
|
|
9492
9509
|
'sd-select__option-group--disabled': !!this.option.disabled,
|
|
@@ -9495,10 +9512,10 @@ class SdSelectOptionGroup {
|
|
|
9495
9512
|
'sd-select__option-group--group': this.option.type === 'group',
|
|
9496
9513
|
'sd-select__option-group--subgroup': this.option.type === 'subgroup',
|
|
9497
9514
|
'sd-select__option-group--item': this.option.type === 'item',
|
|
9498
|
-
}, onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false), style: this.optionStyle, "data-index": this.index, onClick: event => this.handleClick(this.option, this.isSelected, event) }, hAsync("div", { key: '
|
|
9515
|
+
}, onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false), style: this.optionStyle, "data-index": this.index, onClick: event => this.handleClick(this.option, this.isSelected, event) }, hAsync("div", { key: 'be4bc7f2867ea5c86505bc9284ac3de46f7077f9', class: "sd-select__option-group__label-wrapper" }, this.useCheckbox && (hAsync("sd-checkbox", { key: '00063ab3a6f1d4f44671ac82dd05524968bec668', value: this.isSelected, disabled: this.option.disabled, onClick: e => {
|
|
9499
9516
|
e.preventDefault();
|
|
9500
9517
|
this.handleClick(this.option, this.isSelected, e);
|
|
9501
|
-
} })), hAsync("span", { key: '
|
|
9518
|
+
} })), hAsync("span", { key: '802c908d44bf1c0db5d64bf4c8d4bab4ebe2b87c', class: "sd-select__option-group-label" }, this.option.label), this.useIndicator && this.option.type !== 'item' && (hAsync("span", { key: 'efd26a2d6e4e2662410de3755b70a2a2585ad0c4', class: "sd-select__option-group__count-indicator" }, `(${this.countInfo?.selectedCount}/${this.countInfo?.totalCount})`)))));
|
|
9502
9519
|
}
|
|
9503
9520
|
static get style() { return sdSelectOptionGroupCss(); }
|
|
9504
9521
|
static get cmpMeta() { return {
|
|
@@ -9547,17 +9564,17 @@ class SdSelectSearchInput {
|
|
|
9547
9564
|
input?.focus({ preventScroll: true });
|
|
9548
9565
|
}
|
|
9549
9566
|
render() {
|
|
9550
|
-
return (hAsync("div", { key: '
|
|
9567
|
+
return (hAsync("div", { key: 'b19a029ef82d876c984c1f827d7a0f29bb823f5d', class: {
|
|
9551
9568
|
'sd-select-search-input': true,
|
|
9552
9569
|
'sd-select-search-input--scrolled': !!this.isScrolled,
|
|
9553
|
-
}, onClick: event => event.stopPropagation() }, hAsync("sd-input", { key: '
|
|
9570
|
+
}, onClick: event => event.stopPropagation() }, hAsync("sd-input", { key: '8e27f40e1b507f0c5cb2d4bde48750cd0089a9da', ref: el => (this.searchRef = el), value: this.searchText, placeholder: "\uAC80\uC0C9", clearable: true, inputStyle: { 'padding-left': '8px' }, autofocus: true, onSdUpdate: event => {
|
|
9554
9571
|
this.searchInput.emit(String(event?.detail));
|
|
9555
9572
|
}, onSdFocus: () => {
|
|
9556
9573
|
this.searchFocus.emit();
|
|
9557
9574
|
}, onKeyDown: event => {
|
|
9558
9575
|
if (event.code === 'Enter')
|
|
9559
9576
|
event.stopPropagation();
|
|
9560
|
-
} }, hAsync("sd-icon", { key: '
|
|
9577
|
+
} }, hAsync("sd-icon", { key: '2b38a07cbc0bb0d7dd020ece45f18bdff4c262e5', name: "search", size: 16, color: "#737373", style: { marginRight: '4px' }, slot: "prefix" }))));
|
|
9561
9578
|
}
|
|
9562
9579
|
static get style() { return sdSelectSearchInputCss(); }
|
|
9563
9580
|
static get cmpMeta() { return {
|
|
@@ -10507,10 +10524,10 @@ class SdTextarea {
|
|
|
10507
10524
|
}
|
|
10508
10525
|
render() {
|
|
10509
10526
|
const maxLengthCounter = this.getMaxLengthCounter();
|
|
10510
|
-
return (hAsync("div", { key: '
|
|
10527
|
+
return (hAsync("div", { key: '888d11be57629e83e1215daddab63351a323672f', class: {
|
|
10511
10528
|
'sd-textarea': true,
|
|
10512
10529
|
[this.getTextareaStatus()]: true,
|
|
10513
|
-
}, onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false) }, hAsync("div", { key: '
|
|
10530
|
+
}, onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false) }, hAsync("div", { key: '1f91a1e435b2dba1817ce181f91bdf3829142682', class: "sd-textarea__content" }, hAsync("textarea", { key: 'd883f4cdfd56220cf4382893f94a469f7afd7ff2', name: this.name, ref: el => (this.nativeEl = el), class: `sd-textarea__native ${this.textareaClass}`, value: this.internalValue || '', placeholder: this.placeholder, disabled: this.disabled, autofocus: this.autoFocus, maxLength: this.maxLength, onInput: this.handleInput.bind(this), onFocus: event => this.handleFocus('focus', event), onBlur: event => this.handleFocus('blur', event) })), this.hasFooter() && (hAsync("div", { key: 'e9350d8e49eb87b2caddfc24079ece0d59c79739', class: "sd-textarea__footer" }, this.helpText !== undefined && hAsync("span", { key: 'cda9e2b8b0c15fbc7356597d4363d438688c8e4e', class: "sd-textarea__help-text" }, this.helpText), maxLengthCounter !== null && hAsync("span", { key: '491e990142e07837169e84a3fcc3e80c00bc7153', class: "sd-textarea__counter" }, maxLengthCounter)))));
|
|
10514
10531
|
}
|
|
10515
10532
|
static get watchers() { return {
|
|
10516
10533
|
"value": ["valueChanged"],
|
|
@@ -10647,7 +10664,7 @@ class SdToggle {
|
|
|
10647
10664
|
this.change.emit(newValue);
|
|
10648
10665
|
};
|
|
10649
10666
|
render() {
|
|
10650
|
-
return (hAsync("label", { key: '
|
|
10667
|
+
return (hAsync("label", { key: 'c0fcd12c231fdb995b5edae756157c58b352fd0f', "aria-label": this.label || 'toggle', class: this.toggleClasses }, hAsync("input", { key: 'e50042ae04830f4c276d8140725ab62cc2d0490d', type: "checkbox", checked: this.value, disabled: this.disabled, onInput: this.handleChange }), this.label && hAsync("span", { key: '99f9506a2dcea8cfd85aabf6b71243c116a2bf11', class: "sd-toggle__label" }, this.label), hAsync("div", { key: '424e1ae78d5684051bd7a2b3ba89f6760f773f1c', class: "sd-toggle__track" }, hAsync("div", { key: '29aab89e58022ce22f026fb694bb9b1e4531d8cf', class: "sd-toggle__thumb" }))));
|
|
10651
10668
|
}
|
|
10652
10669
|
static get style() { return sdToggleCss(); }
|
|
10653
10670
|
static get cmpMeta() { return {
|
|
@@ -10703,7 +10720,7 @@ class SdToggleButton {
|
|
|
10703
10720
|
this.change.emit(newValue);
|
|
10704
10721
|
};
|
|
10705
10722
|
render() {
|
|
10706
|
-
return (hAsync("label", { key: '
|
|
10723
|
+
return (hAsync("label", { key: '6f8d9e738490ef344ff26a4026b9de17af68041e', class: this.buttonClasses, "aria-label": this.label || 'toggle button' }, this.label, hAsync("input", { key: '6d9d45c451301c4635e610fd70280be1fe65b316', style: { display: 'none' }, type: "checkbox", onInput: this.handleChange })));
|
|
10707
10724
|
}
|
|
10708
10725
|
static get style() { return sdToggleButtonCss(); }
|
|
10709
10726
|
static get cmpMeta() { return {
|
package/package.json
CHANGED
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-CCPd7keB.js');
|
|
4
|
-
|
|
5
|
-
const sdNumberInputCss = () => `sd-icon{display:inline-block;line-height:0}sd-icon .sd-icon--rotate-90{transform:rotate(90deg)}sd-icon .sd-icon--rotate-180{transform:rotate(180deg)}sd-icon .sd-icon--rotate-270{transform:rotate(270deg)}sd-number-input .sd-number-input-container{display:inline-flex}sd-number-input .sd-number-input{box-sizing:border-box;display:flex;width:var(--input-width, 100%);align-items:center;height:28px;padding:4px 8px;border:1px solid #aaaaaa;border-radius:4px;color:#333333;font-size:12px;line-height:20px;background:white;position:relative}sd-number-input .sd-number-input--hovered{border-color:#0075ff;box-shadow:0 0 4px 0 rgba(0, 113, 255, 0.4)}sd-number-input .sd-number-input.sd-number-input--error{border-color:#fb4444}sd-number-input .sd-number-input.sd-number-input--pass{border-color:#2bce6c}sd-number-input .sd-number-input.sd-number-input--disabled{background-color:#eeeeee !important;border-color:#cccccc !important;cursor:not-allowed !important;box-shadow:none !important}sd-number-input .sd-number-input.sd-number-input--disabled .sd-number-input__input{color:#888888 !important;cursor:not-allowed !important}sd-number-input .sd-number-input .sd-number-input__input{display:block;width:100%;height:20px;line-height:20px;border:none;outline:none;background:transparent;font-size:inherit;color:#333333;margin-left:4px;margin-right:4px;padding-block:0;padding-inline:0;text-align:right}sd-number-input .sd-number-input .sd-number-input__input::placeholder{font-size:12px;height:20px;line-height:20px;color:#aaaaaa}sd-number-input .sd-number-input .sd-number-input__clear-icon{cursor:pointer;margin-left:8px}sd-number-input .sd-number-input .sd-number-input__buttons{padding:4px;display:flex;justify-content:space-between;align-items:center;position:absolute;inset:0;opacity:0;pointer-events:none;transition:opacity 0.2s ease}sd-number-input .sd-number-input .sd-number-input__button{width:20px;height:20px;border:none;border-radius:2px;background-color:#eff6ff;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;margin:0;transition:background-color 0.2s ease}sd-number-input .sd-number-input .sd-number-input__button:hover:not(:disabled){background-color:#e6f1ff}sd-number-input .sd-number-input .sd-number-input__button:disabled{background-color:#eeeeee;cursor:not-allowed}sd-number-input .sd-number-input .sd-number-input__button--decrement{border-bottom-left-radius:0;border-bottom-right-radius:0}sd-number-input .sd-number-input .sd-number-input__button--increment{border-top-left-radius:0;border-top-right-radius:0}sd-number-input .sd-number-input .sd-number-input__label{margin-bottom:8px;font-weight:500;color:#333333}sd-number-input:focus-within .sd-number-input__buttons{opacity:1;pointer-events:auto}sd-number-input:focus-within .sd-number-input{border-color:#0075ff;box-shadow:0 0 4px 0 rgba(0, 113, 255, 0.4)}`;
|
|
6
|
-
|
|
7
|
-
const SdNumberInput = class {
|
|
8
|
-
constructor(hostRef) {
|
|
9
|
-
index.registerInstance(this, hostRef);
|
|
10
|
-
this.update = index.createEvent(this, "sdUpdate");
|
|
11
|
-
this.focus = index.createEvent(this, "sdFocus");
|
|
12
|
-
this.blur = index.createEvent(this, "sdBlur");
|
|
13
|
-
}
|
|
14
|
-
get el() { return index.getElement(this); }
|
|
15
|
-
min = Number.NEGATIVE_INFINITY;
|
|
16
|
-
max = Number.POSITIVE_INFINITY;
|
|
17
|
-
step = 1;
|
|
18
|
-
useButton = false;
|
|
19
|
-
useDecimal = false;
|
|
20
|
-
value = null;
|
|
21
|
-
label;
|
|
22
|
-
placeholder = '입력해 주세요.';
|
|
23
|
-
disabled = false;
|
|
24
|
-
width;
|
|
25
|
-
rules;
|
|
26
|
-
autoFocus = false;
|
|
27
|
-
status;
|
|
28
|
-
inputClass = '';
|
|
29
|
-
readonly = false;
|
|
30
|
-
inputStyle = {};
|
|
31
|
-
internalValue = null;
|
|
32
|
-
displayValue = '';
|
|
33
|
-
hovered = false;
|
|
34
|
-
error = false;
|
|
35
|
-
nativeEl = undefined;
|
|
36
|
-
update;
|
|
37
|
-
focus;
|
|
38
|
-
blur;
|
|
39
|
-
formatWithCommas(value) {
|
|
40
|
-
if (value === null || value === undefined)
|
|
41
|
-
return '';
|
|
42
|
-
const isNegative = value < 0;
|
|
43
|
-
const absValue = Math.abs(value);
|
|
44
|
-
const [intPart, decPart] = absValue.toString().split('.');
|
|
45
|
-
const formatted = (+intPart).toLocaleString();
|
|
46
|
-
const result = isNegative ? '-' + formatted : formatted;
|
|
47
|
-
return decPart ? result + '.' + decPart : String(result);
|
|
48
|
-
}
|
|
49
|
-
parseInput(input) {
|
|
50
|
-
if (!input || input.trim() === '')
|
|
51
|
-
return null;
|
|
52
|
-
const cleaned = input.replace(/,/g, '').trim();
|
|
53
|
-
// -로 시작을 할 수 있을 수 있고, 소수점 0.n | .n
|
|
54
|
-
if (!/^-?(\d+\.?\d*|\d*\.\d+)$/.test(cleaned)) {
|
|
55
|
-
return null;
|
|
56
|
-
}
|
|
57
|
-
const parsed = parseFloat(cleaned);
|
|
58
|
-
if (isNaN(parsed))
|
|
59
|
-
return null;
|
|
60
|
-
// 소수점 사용 하지 않는데 . 이 있는 경우
|
|
61
|
-
if (!this.useDecimal && cleaned.includes('.')) {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
return parsed;
|
|
65
|
-
}
|
|
66
|
-
clampMinMax(value) {
|
|
67
|
-
return Math.min(Math.max(value, this.min), this.max);
|
|
68
|
-
}
|
|
69
|
-
updateDisplay() {
|
|
70
|
-
this.displayValue = this.formatWithCommas(this.internalValue);
|
|
71
|
-
}
|
|
72
|
-
isIncrementDisabled() {
|
|
73
|
-
if (this.disabled || this.readonly)
|
|
74
|
-
return true;
|
|
75
|
-
if (this.internalValue !== null) {
|
|
76
|
-
return this.internalValue >= this.max;
|
|
77
|
-
}
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
isDecrementDisabled() {
|
|
81
|
-
if (this.disabled || this.readonly)
|
|
82
|
-
return true;
|
|
83
|
-
if (this.internalValue !== null) {
|
|
84
|
-
return this.internalValue <= this.min;
|
|
85
|
-
}
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
valueChanged(newValue) {
|
|
89
|
-
if (newValue === null || newValue === '') {
|
|
90
|
-
this.internalValue = null;
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
const parsed = typeof newValue === 'string' ? this.parseInput(newValue) : newValue;
|
|
94
|
-
if (parsed !== null) {
|
|
95
|
-
this.internalValue = this.clampMinMax(parsed);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
this.updateDisplay();
|
|
99
|
-
}
|
|
100
|
-
internalValueChanged(newValue) {
|
|
101
|
-
this.updateDisplay();
|
|
102
|
-
if (newValue !== this.value) {
|
|
103
|
-
this.value = newValue;
|
|
104
|
-
this.update?.emit(newValue);
|
|
105
|
-
}
|
|
106
|
-
if (!this.rules || this.rules.length === 0)
|
|
107
|
-
return;
|
|
108
|
-
this.error = false;
|
|
109
|
-
for (const rule of this.rules) {
|
|
110
|
-
const result = rule(newValue);
|
|
111
|
-
if (result !== true) {
|
|
112
|
-
this.error = true;
|
|
113
|
-
break;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
componentWillLoad() {
|
|
118
|
-
if (this.value !== null && this.value !== undefined) {
|
|
119
|
-
const parsed = typeof this.value === 'string' ? this.parseInput(this.value) : this.value;
|
|
120
|
-
if (parsed !== null) {
|
|
121
|
-
this.internalValue = this.clampMinMax(parsed);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
this.updateDisplay();
|
|
125
|
-
}
|
|
126
|
-
// TODO: 현재 숫자를 크게 넣어서 숫자e+21등의 형식으로 변환되면 값이 바뀌지않음 수정 필요
|
|
127
|
-
handleInput = (event) => {
|
|
128
|
-
const target = event.target;
|
|
129
|
-
const inputValue = target.value;
|
|
130
|
-
if (inputValue === '') {
|
|
131
|
-
this.internalValue = null;
|
|
132
|
-
this.displayValue = '';
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
const commasRemoved = inputValue.replace(/,/g, '');
|
|
136
|
-
// 만약에 소수점 (.) 이 여러개 일 경우
|
|
137
|
-
const decimalCount = (commasRemoved.match(/\./g) || []).length;
|
|
138
|
-
if (decimalCount > 1) {
|
|
139
|
-
target.value = this.displayValue;
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
// 가능: "-", ".", "-." (단순 기호만 있는 경우)
|
|
143
|
-
if (commasRemoved === '-' || commasRemoved === '.' || commasRemoved === '-.') {
|
|
144
|
-
target.value = commasRemoved;
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
// 숫자 뒤에 . 이 있는 경우 (예: "1000.") -> 콤마 포맷 적용 + . 유지
|
|
148
|
-
if (commasRemoved.endsWith('.') && decimalCount === 1) {
|
|
149
|
-
const numberPart = commasRemoved.slice(0, -1);
|
|
150
|
-
const parsed = this.parseInput(numberPart);
|
|
151
|
-
if (parsed !== null) {
|
|
152
|
-
const formatted = this.formatWithCommas(parsed);
|
|
153
|
-
target.value = formatted + '.';
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
const parsed = this.parseInput(commasRemoved);
|
|
158
|
-
if (parsed !== null) {
|
|
159
|
-
if (parsed < this.min) {
|
|
160
|
-
target.value = this.displayValue;
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
if (parsed > this.max) {
|
|
164
|
-
target.value = this.displayValue;
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
this.internalValue = parsed;
|
|
168
|
-
this.displayValue = this.formatWithCommas(parsed);
|
|
169
|
-
target.value = this.displayValue;
|
|
170
|
-
}
|
|
171
|
-
else {
|
|
172
|
-
target.value = this.displayValue;
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
handleFocus = (event) => {
|
|
176
|
-
this.focus?.emit(event);
|
|
177
|
-
};
|
|
178
|
-
handleBlur = (event) => {
|
|
179
|
-
this.updateDisplay();
|
|
180
|
-
if (this.nativeEl) {
|
|
181
|
-
this.nativeEl.value = this.displayValue;
|
|
182
|
-
}
|
|
183
|
-
this.blur?.emit(event);
|
|
184
|
-
};
|
|
185
|
-
handleKeyDown = (event) => {
|
|
186
|
-
if (event.key === 'ArrowUp') {
|
|
187
|
-
event.preventDefault();
|
|
188
|
-
this.handleIncrement();
|
|
189
|
-
}
|
|
190
|
-
else if (event.key === 'ArrowDown') {
|
|
191
|
-
event.preventDefault();
|
|
192
|
-
this.handleDecrement();
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
handleIncrement = () => {
|
|
196
|
-
if (this.isIncrementDisabled())
|
|
197
|
-
return;
|
|
198
|
-
const currentVal = this.internalValue ?? this.min ?? 0;
|
|
199
|
-
let nextVal = currentVal + this.step;
|
|
200
|
-
if (nextVal > this.max) {
|
|
201
|
-
nextVal = this.max;
|
|
202
|
-
}
|
|
203
|
-
if (nextVal === currentVal)
|
|
204
|
-
return;
|
|
205
|
-
this.internalValue = nextVal;
|
|
206
|
-
};
|
|
207
|
-
handleDecrement = () => {
|
|
208
|
-
if (this.isDecrementDisabled())
|
|
209
|
-
return;
|
|
210
|
-
const currentVal = this.internalValue ?? this.min ?? 0;
|
|
211
|
-
let nextVal = currentVal - this.step;
|
|
212
|
-
if (nextVal < this.min) {
|
|
213
|
-
nextVal = this.min;
|
|
214
|
-
}
|
|
215
|
-
if (nextVal === currentVal)
|
|
216
|
-
return;
|
|
217
|
-
this.internalValue = nextVal;
|
|
218
|
-
};
|
|
219
|
-
async sdGetNativeElement() {
|
|
220
|
-
return this.nativeEl || null;
|
|
221
|
-
}
|
|
222
|
-
getInputStatus() {
|
|
223
|
-
if (this.disabled)
|
|
224
|
-
return 'sd-number-input--disabled';
|
|
225
|
-
if (this.hovered)
|
|
226
|
-
return 'sd-number-input--hovered';
|
|
227
|
-
if (this.status)
|
|
228
|
-
return `sd-number-input--${this.status}`;
|
|
229
|
-
if (this.error)
|
|
230
|
-
return 'sd-number-input--error';
|
|
231
|
-
return '';
|
|
232
|
-
}
|
|
233
|
-
render() {
|
|
234
|
-
const inputWidth = this.width
|
|
235
|
-
? {
|
|
236
|
-
'--input-width': typeof this.width === 'number' ? `${this.width}px` : this.width,
|
|
237
|
-
}
|
|
238
|
-
: {};
|
|
239
|
-
const inputStyles = {
|
|
240
|
-
textAlign: this.useButton ? 'center' : 'right',
|
|
241
|
-
};
|
|
242
|
-
return (index.h("div", { key: 'b46cd55c205c9d0f0b7e4af181cbef7cc558f464', class: "sd-number-input-container", style: inputWidth, onFocus: this.handleFocus, onBlur: this.handleBlur }, this.label && index.h("div", { key: 'f2e0ef64df2132b0efca4bd5d50441f191fcc307', class: "sd-number-input__label" }, this.label), index.h("label", { key: '98920eb7ee7e07ad4719069201beffdeb3c8510a', class: {
|
|
243
|
-
'sd-number-input': true,
|
|
244
|
-
[this.getInputStatus()]: true,
|
|
245
|
-
'sd-number-input--with-buttons': this.useButton,
|
|
246
|
-
}, onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false), style: this.inputStyle }, index.h("input", { key: 'b8ffd42e1a1d3936f6f8b5bf2351b46d31a193ad', ref: el => (this.nativeEl = el), class: `sd-number-input__input ${this.inputClass}`, type: "text", inputMode: "numeric", value: this.displayValue, placeholder: this.placeholder, disabled: this.disabled, readonly: this.readonly, autofocus: this.autoFocus, onInput: this.handleInput, onKeyDown: this.handleKeyDown, style: inputStyles }), this.useButton && (index.h("div", { key: 'b94de21e7b6b1020daac92cfefe9215444704a43', class: "sd-number-input__buttons" }, index.h("button", { key: '0a96725cc1c469db6c7520d21df06f757d20ffc6', type: "button", class: {
|
|
247
|
-
'sd-number-input__button': true,
|
|
248
|
-
'sd-number-input__button--decrement': true,
|
|
249
|
-
}, disabled: this.isDecrementDisabled(), onClick: this.handleDecrement, tabindex: -1 }, index.h("sd-icon", { key: '598f637e2ad3cb46f4c881552dc2812c86964c68', name: "minus", size: 12, color: this.isDecrementDisabled() ? 'grey_45' : 'brilliantblue_70' })), index.h("button", { key: '03532b7f895aaa6b616739c1a2272c0a517a2140', type: "button", class: {
|
|
250
|
-
'sd-number-input__button': true,
|
|
251
|
-
'sd-number-input__button--increment': true,
|
|
252
|
-
}, disabled: this.isIncrementDisabled(), onClick: this.handleIncrement, tabindex: -1 }, index.h("sd-icon", { key: 'bd9d565d790305f4153e52a4323dce18559df970', name: "add", size: 12, color: this.isIncrementDisabled() ? 'grey_45' : 'brilliantblue_70' })))))));
|
|
253
|
-
}
|
|
254
|
-
static get watchers() { return {
|
|
255
|
-
"value": ["valueChanged"],
|
|
256
|
-
"internalValue": ["internalValueChanged"]
|
|
257
|
-
}; }
|
|
258
|
-
};
|
|
259
|
-
SdNumberInput.style = sdNumberInputCss();
|
|
260
|
-
|
|
261
|
-
exports.sd_number_input = SdNumberInput;
|
|
262
|
-
//# sourceMappingURL=sd-number-input.entry.cjs.js.map
|