@sellmate/design-system 1.15.0 → 1.16.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/cjs/design-system.cjs.js +2 -2
- package/dist/cjs/{index-Dq1M20nt.js → index-DXm0PH2A.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/sd-action-modal.cjs.entry.js +1 -1
- package/dist/cjs/sd-badge.cjs.entry.js +1 -1
- package/dist/cjs/sd-barcode-input.cjs.entry.js +1 -1
- package/dist/cjs/sd-button_2.cjs.entry.js +1 -1
- package/dist/cjs/sd-calendar_2.cjs.entry.js +1 -1
- package/dist/cjs/sd-callout.cjs.entry.js +1 -1
- package/dist/cjs/sd-card.cjs.entry.js +1 -1
- package/dist/cjs/sd-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/sd-chip-input.cjs.entry.js +61 -30
- package/dist/cjs/sd-chip.cjs.entry.js +15 -7
- package/dist/cjs/sd-circle-progress.cjs.entry.js +1 -1
- package/dist/cjs/sd-confirm-modal_2.cjs.entry.js +1 -1
- package/dist/cjs/sd-date-box.cjs.entry.js +1 -1
- package/dist/cjs/sd-date-picker_7.cjs.entry.js +2 -2
- package/dist/cjs/sd-date-range-picker-calendar.cjs.entry.js +1 -1
- package/dist/cjs/sd-divider.cjs.entry.js +1 -1
- package/dist/cjs/sd-dropdown-button.cjs.entry.js +1 -1
- package/dist/cjs/sd-field_3.cjs.entry.js +17 -8
- package/dist/cjs/sd-form.cjs.entry.js +1 -1
- package/dist/cjs/sd-ghost-button_2.cjs.entry.js +1 -1
- package/dist/cjs/sd-guide.cjs.entry.js +1 -1
- package/dist/cjs/sd-key-value-table.cjs.entry.js +1 -1
- package/dist/cjs/sd-linear-progress.cjs.entry.js +1 -1
- package/dist/cjs/sd-loading-container.cjs.entry.js +1 -1
- package/dist/cjs/sd-modal-container.cjs.entry.js +1 -1
- package/dist/cjs/sd-pagination_4.cjs.entry.js +1 -1
- package/dist/cjs/sd-popover.cjs.entry.js +2 -2
- package/dist/cjs/sd-popup.cjs.entry.js +1 -1
- package/dist/cjs/sd-portal.cjs.entry.js +1 -1
- package/dist/cjs/sd-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/sd-radio.cjs.entry.js +31 -19
- package/dist/cjs/sd-select-list-item_2.cjs.entry.js +1 -1
- package/dist/cjs/sd-select_3.cjs.entry.js +1 -1
- package/dist/cjs/sd-switch.cjs.entry.js +1 -1
- package/dist/cjs/sd-table.cjs.entry.js +1 -1
- package/dist/cjs/sd-tabs.cjs.entry.js +1 -1
- package/dist/cjs/sd-td.cjs.entry.js +1 -1
- package/dist/cjs/sd-text-link.cjs.entry.js +1 -1
- package/dist/cjs/sd-toast-container.cjs.entry.js +1 -1
- package/dist/cjs/sd-toast.cjs.entry.js +1 -1
- package/dist/cjs/sd-toggle.cjs.entry.js +1 -1
- package/dist/cjs/{tooltipArrow-CyyaX9aS.js → tooltipArrow-D3P3JC08.js} +1 -1
- package/dist/collection/components/sd-chip/sd-chip.js +34 -6
- package/dist/collection/components/sd-chip-input/sd-chip-input.js +78 -29
- package/dist/collection/components/sd-field/sd-field.css +8 -8
- package/dist/collection/components/sd-field/sd-field.js +14 -5
- package/dist/collection/components/sd-radio/sd-radio.config.js +14 -4
- package/dist/collection/components/sd-radio/sd-radio.css +17 -0
- package/dist/collection/components/sd-radio/sd-radio.js +8 -9
- package/dist/collection/components/sd-radio-group/sd-radio-group.css +17 -0
- package/dist/components/index.js +1 -1
- package/dist/components/{p-DCcIwD65.js → p-0VCXAYrh.js} +1 -1
- package/dist/components/{p-Dp51AYN2.js → p-6oSCGUOo.js} +1 -1
- package/dist/components/p-9Z-q6kKD.js +1 -0
- package/dist/components/{p-D-MF-Gqr.js → p-B-61rIur.js} +1 -1
- package/dist/components/{p-CbLmNzyI.js → p-B4UxhQes.js} +1 -1
- package/dist/components/{p-C4GyQnYy.js → p-B4pLCd0_.js} +1 -1
- package/dist/components/{p-DiYM7tLY.js → p-B57sOZvR.js} +1 -1
- package/dist/components/{p-bFbGmGpk.js → p-B73U-Zw2.js} +1 -1
- package/dist/components/{p-DPJTWFX1.js → p-BMVHvEDw.js} +1 -1
- package/dist/components/{p-DU-bmyYI.js → p-BWoC-hMr.js} +1 -1
- package/dist/components/{p-B7XLde30.js → p-BY1ItC8N.js} +1 -1
- package/dist/components/{p-Cps2roN-.js → p-Bfrg9lvO.js} +1 -1
- package/dist/components/p-Bg9XySrz.js +1 -0
- package/dist/components/{p-Dn3GoMRV.js → p-BrzBnO1L.js} +1 -1
- package/dist/components/{p-DoPR7KRG.js → p-BsQf9d7Q.js} +1 -1
- package/dist/components/{p-DQaizq5F.js → p-BvAJ_toQ.js} +1 -1
- package/dist/components/{p-CWRzU_jD.js → p-CHjF0mwj.js} +1 -1
- package/dist/components/{p-C9GSsqUl.js → p-CIZpVJBx.js} +1 -1
- package/dist/components/{p-CZCejvvs.js → p-CLEAGFjW.js} +1 -1
- package/dist/components/p-C_6HUUGg.js +1 -0
- package/dist/components/{p-BQbRKyE8.js → p-Cftyepf_.js} +1 -1
- package/dist/components/{p-DOnvzHnl.js → p-CnfnK5aj.js} +1 -1
- package/dist/components/p-DUwrMHYa.js +1 -0
- package/dist/components/{p-kZQacVZK.js → p-DeXO3mpJ.js} +1 -1
- package/dist/components/{p-CbOjEMF1.js → p-DfZ8X4ly.js} +1 -1
- package/dist/components/{p--bh6IQPe.js → p-DknZgTo9.js} +1 -1
- package/dist/components/{p-0l2gvHgO.js → p-DtG23tkr.js} +1 -1
- package/dist/components/{p-C9wBnyAK.js → p-FGvi8J2D.js} +1 -1
- package/dist/components/{p-BRPmhDP2.js → p-G_N9xEDL.js} +1 -1
- package/dist/components/{p-D7c1Foln.js → p-IgBxAXyL.js} +1 -1
- package/dist/components/p-MJG6EZeP.js +1 -0
- package/dist/components/{p-BZpxlRPV.js → p-RE577yb-.js} +1 -1
- package/dist/components/{p-jGNVdj6x.js → p-YKESuy-p.js} +1 -1
- package/dist/components/{p-ChzjfCHr.js → p-YlaidN9T.js} +1 -1
- package/dist/components/{p-bHTV5pau.js → p-_P21dOPl.js} +1 -1
- package/dist/components/{p-CPhGwtJN.js → p-iGvyLmbb.js} +1 -1
- package/dist/components/p-vS0t7bWk.js +1 -0
- package/dist/components/sd-action-modal.js +1 -1
- package/dist/components/sd-badge.js +1 -1
- package/dist/components/sd-barcode-input.js +1 -1
- package/dist/components/sd-button.js +1 -1
- package/dist/components/sd-calendar.js +1 -1
- package/dist/components/sd-callout.js +1 -1
- package/dist/components/sd-card.js +1 -1
- package/dist/components/sd-checkbox.js +1 -1
- package/dist/components/sd-chip-input.js +1 -1
- package/dist/components/sd-chip.js +1 -1
- package/dist/components/sd-circle-progress.js +1 -1
- package/dist/components/sd-confirm-modal.js +1 -1
- package/dist/components/sd-date-box.js +1 -1
- package/dist/components/sd-date-picker-trigger.js +1 -1
- package/dist/components/sd-date-picker.js +1 -1
- package/dist/components/sd-date-range-picker-calendar.js +1 -1
- package/dist/components/sd-date-range-picker.js +1 -1
- package/dist/components/sd-divider.js +1 -1
- package/dist/components/sd-dropdown-button.js +1 -1
- package/dist/components/sd-field.js +1 -1
- package/dist/components/sd-file-picker.js +1 -1
- package/dist/components/sd-floating-portal.js +1 -1
- package/dist/components/sd-form.js +1 -1
- package/dist/components/sd-ghost-button.js +1 -1
- package/dist/components/sd-guide.js +1 -1
- package/dist/components/sd-icon.js +1 -1
- package/dist/components/sd-input.js +1 -1
- package/dist/components/sd-key-value-table.js +1 -1
- package/dist/components/sd-linear-progress.js +1 -1
- package/dist/components/sd-loading-container.js +1 -1
- package/dist/components/sd-loading-modal.js +1 -1
- package/dist/components/sd-modal-container.js +1 -1
- package/dist/components/sd-number-input.js +1 -1
- package/dist/components/sd-pagination.js +1 -1
- package/dist/components/sd-popover.js +1 -1
- package/dist/components/sd-popup.js +1 -1
- package/dist/components/sd-portal.js +1 -1
- package/dist/components/sd-radio-button.js +1 -1
- package/dist/components/sd-radio-group.js +1 -1
- package/dist/components/sd-radio.js +1 -1
- package/dist/components/sd-select-list-item-search.js +1 -1
- package/dist/components/sd-select-list-item.js +1 -1
- package/dist/components/sd-select-listbox.js +1 -1
- package/dist/components/sd-select-trigger.js +1 -1
- package/dist/components/sd-select.js +1 -1
- package/dist/components/sd-switch.js +1 -1
- package/dist/components/sd-table.js +1 -1
- package/dist/components/sd-tabs.js +1 -1
- package/dist/components/sd-tag.js +1 -1
- package/dist/components/sd-tbody.js +1 -1
- package/dist/components/sd-td.js +1 -1
- package/dist/components/sd-text-link.js +1 -1
- package/dist/components/sd-textarea.js +1 -1
- package/dist/components/sd-thead.js +1 -1
- package/dist/components/sd-toast-container.js +1 -1
- package/dist/components/sd-toast.js +1 -1
- package/dist/components/sd-toggle.js +1 -1
- package/dist/components/sd-tooltip.js +1 -1
- package/dist/components/sd-tr.js +1 -1
- package/dist/design-system/design-system.css +1 -1
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/design-system/{p-45c9950f.entry.js → p-03bcd782.entry.js} +1 -1
- package/dist/design-system/{p-f39eb2b6.entry.js → p-0c5192b8.entry.js} +1 -1
- package/dist/design-system/{p-a2c3041a.entry.js → p-13b0db59.entry.js} +1 -1
- package/dist/design-system/{p-ab3656cb.entry.js → p-14340e46.entry.js} +1 -1
- package/dist/design-system/{p-0ba848cc.entry.js → p-1652ae55.entry.js} +1 -1
- package/dist/design-system/{p-d58ec388.entry.js → p-21fa7f85.entry.js} +1 -1
- package/dist/design-system/{p-453efe4b.entry.js → p-22883fe1.entry.js} +1 -1
- package/dist/design-system/{p-21201d3b.entry.js → p-23006577.entry.js} +1 -1
- package/dist/design-system/{p-7b37f397.entry.js → p-2753c6c9.entry.js} +1 -1
- package/dist/design-system/p-3045ffe1.entry.js +1 -0
- package/dist/design-system/{p-15f27fc6.entry.js → p-35d390f1.entry.js} +1 -1
- package/dist/design-system/{p-584295c2.entry.js → p-3e62a3ea.entry.js} +1 -1
- package/dist/design-system/{p-b86b8a69.entry.js → p-5c6dd20b.entry.js} +1 -1
- package/dist/design-system/{p-0d23059e.entry.js → p-6d765b25.entry.js} +1 -1
- package/dist/design-system/{p-c8f1e14e.entry.js → p-71739336.entry.js} +1 -1
- package/dist/design-system/{p-aa583377.entry.js → p-7eb31041.entry.js} +1 -1
- package/dist/design-system/{p-33f7d238.entry.js → p-7ed5aed5.entry.js} +1 -1
- package/dist/design-system/{p-63dd2424.entry.js → p-8140a225.entry.js} +1 -1
- package/dist/design-system/p-9095aab6.entry.js +1 -0
- package/dist/design-system/{p-9aafb387.entry.js → p-99ffe505.entry.js} +1 -1
- package/dist/design-system/p-CAxodB5I.js +2 -0
- package/dist/design-system/{p-DBOI5K7c.js → p-L_He_WSA.js} +1 -1
- package/dist/design-system/{p-bc1a812b.entry.js → p-a0775a0c.entry.js} +1 -1
- package/dist/design-system/{p-3087b3ee.entry.js → p-a1f756ab.entry.js} +1 -1
- package/dist/design-system/{p-eb83aa2f.entry.js → p-a5131a43.entry.js} +1 -1
- package/dist/design-system/{p-fbcf3beb.entry.js → p-a532d998.entry.js} +1 -1
- package/dist/design-system/{p-3f2b2799.entry.js → p-adfddf3b.entry.js} +1 -1
- package/dist/design-system/{p-f0c85e94.entry.js → p-b22cb811.entry.js} +1 -1
- package/dist/design-system/{p-0e5f3458.entry.js → p-b457611c.entry.js} +1 -1
- package/dist/design-system/{p-4794ec4d.entry.js → p-b576bc21.entry.js} +1 -1
- package/dist/design-system/{p-eb4c9901.entry.js → p-b8ea656d.entry.js} +1 -1
- package/dist/design-system/{p-de9f768b.entry.js → p-c1f71355.entry.js} +1 -1
- package/dist/design-system/{p-ef191467.entry.js → p-c318b762.entry.js} +1 -1
- package/dist/design-system/{p-d6672552.entry.js → p-c4e1641b.entry.js} +1 -1
- package/dist/design-system/{p-348af170.entry.js → p-c6307ba4.entry.js} +1 -1
- package/dist/design-system/{p-89031ce0.entry.js → p-c78b8822.entry.js} +1 -1
- package/dist/design-system/{p-d704ff76.entry.js → p-d2833150.entry.js} +1 -1
- package/dist/design-system/{p-bfd4216b.entry.js → p-d5c3bac9.entry.js} +1 -1
- package/dist/design-system/{p-17c360bf.entry.js → p-d726d8e7.entry.js} +1 -1
- package/dist/design-system/p-da4e2674.entry.js +1 -0
- package/dist/design-system/p-da90b448.entry.js +1 -0
- package/dist/design-system/{p-3e196f92.entry.js → p-eef6d4a3.entry.js} +1 -1
- package/dist/design-system/{p-0c8410c0.entry.js → p-fd7abbfa.entry.js} +1 -1
- package/dist/esm/design-system.js +3 -3
- package/dist/esm/{index-JGOJoT-i.js → index-CAxodB5I.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/sd-action-modal.entry.js +1 -1
- package/dist/esm/sd-badge.entry.js +1 -1
- package/dist/esm/sd-barcode-input.entry.js +1 -1
- package/dist/esm/sd-button_2.entry.js +1 -1
- package/dist/esm/sd-calendar_2.entry.js +1 -1
- package/dist/esm/sd-callout.entry.js +1 -1
- package/dist/esm/sd-card.entry.js +1 -1
- package/dist/esm/sd-checkbox.entry.js +1 -1
- package/dist/esm/sd-chip-input.entry.js +61 -30
- package/dist/esm/sd-chip.entry.js +15 -7
- package/dist/esm/sd-circle-progress.entry.js +1 -1
- package/dist/esm/sd-confirm-modal_2.entry.js +1 -1
- package/dist/esm/sd-date-box.entry.js +1 -1
- package/dist/esm/sd-date-picker_7.entry.js +2 -2
- package/dist/esm/sd-date-range-picker-calendar.entry.js +1 -1
- package/dist/esm/sd-divider.entry.js +1 -1
- package/dist/esm/sd-dropdown-button.entry.js +1 -1
- package/dist/esm/sd-field_3.entry.js +17 -8
- package/dist/esm/sd-form.entry.js +1 -1
- package/dist/esm/sd-ghost-button_2.entry.js +1 -1
- package/dist/esm/sd-guide.entry.js +1 -1
- package/dist/esm/sd-key-value-table.entry.js +1 -1
- package/dist/esm/sd-linear-progress.entry.js +1 -1
- package/dist/esm/sd-loading-container.entry.js +1 -1
- package/dist/esm/sd-modal-container.entry.js +1 -1
- package/dist/esm/sd-pagination_4.entry.js +1 -1
- package/dist/esm/sd-popover.entry.js +2 -2
- package/dist/esm/sd-popup.entry.js +1 -1
- package/dist/esm/sd-portal.entry.js +1 -1
- package/dist/esm/sd-radio-button.entry.js +1 -1
- package/dist/esm/sd-radio.entry.js +31 -19
- package/dist/esm/sd-select-list-item_2.entry.js +1 -1
- package/dist/esm/sd-select_3.entry.js +1 -1
- package/dist/esm/sd-switch.entry.js +1 -1
- package/dist/esm/sd-table.entry.js +1 -1
- package/dist/esm/sd-tabs.entry.js +1 -1
- package/dist/esm/sd-td.entry.js +1 -1
- package/dist/esm/sd-text-link.entry.js +1 -1
- package/dist/esm/sd-toast-container.entry.js +1 -1
- package/dist/esm/sd-toast.entry.js +1 -1
- package/dist/esm/sd-toggle.entry.js +1 -1
- package/dist/esm/{tooltipArrow-jis_5jgG.js → tooltipArrow-DLr6VvUK.js} +1 -1
- package/dist/types/components/sd-chip/sd-chip.d.ts +6 -0
- package/dist/types/components/sd-chip-input/sd-chip-input.d.ts +2 -1
- package/dist/types/components/sd-radio/sd-radio.config.d.ts +14 -4
- package/dist/types/components.d.ts +17 -0
- package/hydrate/index.js +123 -61
- package/hydrate/index.mjs +123 -61
- package/package.json +1 -1
- package/dist/components/p-BAog7La9.js +0 -1
- package/dist/components/p-ClFi24KR.js +0 -1
- package/dist/components/p-DmqY8RSd.js +0 -1
- package/dist/components/p-DsUXQTxl.js +0 -1
- package/dist/components/p-DwkU96A1.js +0 -1
- package/dist/components/p-Jp2HXSTL.js +0 -1
- package/dist/design-system/p-02a61803.entry.js +0 -1
- package/dist/design-system/p-0efea9e0.entry.js +0 -1
- package/dist/design-system/p-79ebd90b.entry.js +0 -1
- package/dist/design-system/p-JGOJoT-i.js +0 -2
- package/dist/design-system/p-e67214be.entry.js +0 -1
|
@@ -6,6 +6,7 @@ export class SdChipInput {
|
|
|
6
6
|
host;
|
|
7
7
|
values = [];
|
|
8
8
|
errors = [];
|
|
9
|
+
disabledChips = [];
|
|
9
10
|
size = 'sm';
|
|
10
11
|
disabled = false;
|
|
11
12
|
placeholder = '입력해 주세요.';
|
|
@@ -34,7 +35,7 @@ export class SdChipInput {
|
|
|
34
35
|
return this.internalValues;
|
|
35
36
|
}
|
|
36
37
|
valuesChanged(newValues) {
|
|
37
|
-
this.internalValues = [...
|
|
38
|
+
this.internalValues = Array.isArray(newValues) ? [...newValues] : [];
|
|
38
39
|
}
|
|
39
40
|
errorsChanged(newErrors) {
|
|
40
41
|
if (Array.isArray(newErrors)) {
|
|
@@ -42,16 +43,25 @@ export class SdChipInput {
|
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
componentWillLoad() {
|
|
45
|
-
this.internalValues = [...
|
|
46
|
+
this.internalValues = Array.isArray(this.values) ? [...this.values] : [];
|
|
46
47
|
if (Array.isArray(this.errors)) {
|
|
47
48
|
this.internalErrors = [...this.errors];
|
|
48
49
|
}
|
|
50
|
+
this.inputValue = this.inputValue ?? '';
|
|
49
51
|
}
|
|
50
52
|
getChipError(index) {
|
|
51
53
|
if (typeof this.errors === 'function') {
|
|
52
|
-
return this.errors(this.internalValues[index] ?? '');
|
|
54
|
+
return this.errors(this.internalValues?.[index] ?? '');
|
|
53
55
|
}
|
|
54
|
-
return this.internalErrors[index] ?? false;
|
|
56
|
+
return this.internalErrors?.[index] ?? false;
|
|
57
|
+
}
|
|
58
|
+
getChipDisabled(index) {
|
|
59
|
+
if (this.disabled)
|
|
60
|
+
return true;
|
|
61
|
+
if (typeof this.disabledChips === 'function') {
|
|
62
|
+
return this.disabledChips(this.internalValues?.[index] ?? '');
|
|
63
|
+
}
|
|
64
|
+
return this.disabledChips?.[index] ?? false;
|
|
55
65
|
}
|
|
56
66
|
update;
|
|
57
67
|
focusEvent;
|
|
@@ -68,17 +78,6 @@ export class SdChipInput {
|
|
|
68
78
|
async sdFocus() {
|
|
69
79
|
return this.formField?.sdFocus();
|
|
70
80
|
}
|
|
71
|
-
handleChipUpdate = (index, newValue) => {
|
|
72
|
-
if (newValue.trim() === '') {
|
|
73
|
-
this.handleChipRemove(index);
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
const next = [...this.internalValues];
|
|
77
|
-
next[index] = newValue;
|
|
78
|
-
this.internalValues = next;
|
|
79
|
-
this.values = next;
|
|
80
|
-
this.update.emit(next);
|
|
81
|
-
};
|
|
82
81
|
handleChipRemove = (index) => {
|
|
83
82
|
const next = this.internalValues.filter((_, i) => i !== index);
|
|
84
83
|
this.internalValues = next;
|
|
@@ -88,6 +87,9 @@ export class SdChipInput {
|
|
|
88
87
|
this.internalErrors = nextErrors;
|
|
89
88
|
this.errors = nextErrors;
|
|
90
89
|
}
|
|
90
|
+
if (Array.isArray(this.disabledChips)) {
|
|
91
|
+
this.disabledChips = this.disabledChips.filter((_, i) => i !== index);
|
|
92
|
+
}
|
|
91
93
|
this.update.emit(next);
|
|
92
94
|
this.inputEl?.focus();
|
|
93
95
|
};
|
|
@@ -98,18 +100,33 @@ export class SdChipInput {
|
|
|
98
100
|
const next = [...this.internalValues, input.value.trim()];
|
|
99
101
|
this.internalValues = next;
|
|
100
102
|
this.values = next;
|
|
103
|
+
if (Array.isArray(this.errors)) {
|
|
104
|
+
const nextErrors = [...this.internalErrors, false];
|
|
105
|
+
this.internalErrors = nextErrors;
|
|
106
|
+
this.errors = nextErrors;
|
|
107
|
+
}
|
|
108
|
+
if (Array.isArray(this.disabledChips)) {
|
|
109
|
+
this.disabledChips = [...this.disabledChips, false];
|
|
110
|
+
}
|
|
101
111
|
input.value = '';
|
|
102
112
|
this.inputValue = '';
|
|
103
113
|
this.update.emit(next);
|
|
104
114
|
}
|
|
105
115
|
else if (event.key === 'Backspace' && input.value === '' && this.internalValues.length > 0) {
|
|
116
|
+
if (this.getChipDisabled(this.internalValues.length - 1))
|
|
117
|
+
return;
|
|
106
118
|
event.preventDefault();
|
|
107
119
|
const next = this.internalValues.slice(0, -1);
|
|
108
|
-
const nextErrors = this.internalErrors.slice(0, -1);
|
|
109
120
|
this.internalValues = next;
|
|
110
|
-
this.internalErrors = nextErrors;
|
|
111
121
|
this.values = next;
|
|
112
|
-
this.errors
|
|
122
|
+
if (Array.isArray(this.errors)) {
|
|
123
|
+
const nextErrors = this.internalErrors.slice(0, -1);
|
|
124
|
+
this.internalErrors = nextErrors;
|
|
125
|
+
this.errors = nextErrors;
|
|
126
|
+
}
|
|
127
|
+
if (Array.isArray(this.disabledChips)) {
|
|
128
|
+
this.disabledChips = this.disabledChips.slice(0, -1);
|
|
129
|
+
}
|
|
113
130
|
this.update.emit(next);
|
|
114
131
|
}
|
|
115
132
|
};
|
|
@@ -130,13 +147,27 @@ export class SdChipInput {
|
|
|
130
147
|
}
|
|
131
148
|
};
|
|
132
149
|
handleResetInput = () => {
|
|
133
|
-
this.internalValues
|
|
134
|
-
|
|
135
|
-
|
|
150
|
+
const keptIndices = this.internalValues.reduce((acc, _, i) => {
|
|
151
|
+
if (this.getChipDisabled(i))
|
|
152
|
+
acc.push(i);
|
|
153
|
+
return acc;
|
|
154
|
+
}, []);
|
|
155
|
+
const next = keptIndices.map(i => this.internalValues[i]);
|
|
156
|
+
this.internalValues = next;
|
|
157
|
+
this.values = next;
|
|
136
158
|
if (Array.isArray(this.errors)) {
|
|
137
|
-
|
|
159
|
+
const nextErrors = keptIndices.map(i => this.internalErrors[i] ?? false);
|
|
160
|
+
this.internalErrors = nextErrors;
|
|
161
|
+
this.errors = nextErrors;
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
this.internalErrors = [];
|
|
138
165
|
}
|
|
139
|
-
this.
|
|
166
|
+
if (Array.isArray(this.disabledChips)) {
|
|
167
|
+
const disabledChips = this.disabledChips;
|
|
168
|
+
this.disabledChips = keptIndices.map(i => disabledChips[i]);
|
|
169
|
+
}
|
|
170
|
+
this.update.emit(next);
|
|
140
171
|
this.inputEl?.focus();
|
|
141
172
|
};
|
|
142
173
|
render() {
|
|
@@ -167,15 +198,15 @@ export class SdChipInput {
|
|
|
167
198
|
'--sd-chip-input-field-line-height': CHIP_TYPOGRAPHY.focus.lineHeight,
|
|
168
199
|
'--sd-chip-input-field-font-family': CHIP_TYPOGRAPHY.focus.fontFamily,
|
|
169
200
|
};
|
|
170
|
-
return (h("sd-field", { key: '
|
|
171
|
-
this.focused = true;
|
|
172
|
-
}, onSdBlur: () => {
|
|
173
|
-
this.focused = false;
|
|
174
|
-
} }))), h("div", { key: '33746a3ce014b5d28329c193d93d8bf1fc4957a6', class: {
|
|
201
|
+
return (h("sd-field", { key: 'ea69cfd9fd589f3657f3dff1f73196f684d35d80', name: this.name, label: this.label, labelWidth: this.labelWidth, hint: this.hint, errorMessage: this.errorMessage, rules: this.rules, error: this.error, disabled: this.disabled, focused: this.focused, hovered: this.hovered, status: this.status, size: this.size, width: this.width, icon: this.icon, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el), style: cssVars, onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false) }, h("div", { key: 'b4948c02ea157000002661ca9374b300af5e71a8', class: "sd-chip-input", onClick: this.handleContainerClick }, (this.internalValues ?? []).map((value, i) => (h("sd-chip", { key: i, value: value, error: this.getChipError(i), disabled: this.getChipDisabled(i), editable: false, onSdRemove: () => this.handleChipRemove(i) }))), h("div", { key: 'ad36a2c8dd5b8d8ad00d7130da75e92a1fb3b350', class: {
|
|
175
202
|
'sd-chip-input__field': true,
|
|
176
203
|
'sd-chip-input__field--filled': this.inputValue !== '',
|
|
177
204
|
'sd-chip-input__field--empty': this.inputValue === '' && this.internalValues.length > 0 && !this.focused,
|
|
178
|
-
}, "data-value": this.inputValue !== ''
|
|
205
|
+
}, "data-value": this.inputValue !== ''
|
|
206
|
+
? this.inputValue
|
|
207
|
+
: this.internalValues.length === 0
|
|
208
|
+
? this.placeholder
|
|
209
|
+
: '' }, h("input", { key: '6ea7cdaa1011543b6c7784561d3752e4ed4a9d7d', ref: el => (this.inputEl = el), class: "sd-chip-input__input", placeholder: this.internalValues.length === 0 ? this.placeholder : '', disabled: this.disabled, size: 1, onInput: this.handleInput, onKeyDown: this.handleKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur })), this.useReset && this.internalValues.length > 0 && (h("div", { key: '65c366e84ba427704a9c89f6f5c6fdeeb5889554', class: "sd-chip-input__reset" }, this.inputValue === '' && h("span", { key: 'e78f17df8e2fd9a91cc5f0450d22542720adef1b', class: "sd-chip-input__divider" }), h("sd-text-link", { key: '298bd3ce40e0c0c4b91337548d6c6887d5239ccc', icon: "reset", iconColor: CHIP_INPUT_RESET.iconColor, label: "\uC785\uB825 \uCD08\uAE30\uD654", underline: true, disabled: this.disabled, style: { '--sd-text-link-color': CHIP_INPUT_RESET.labelColor }, onSdClick: this.handleResetInput }))))));
|
|
179
210
|
}
|
|
180
211
|
static get is() { return "sd-chip-input"; }
|
|
181
212
|
static get originalStyleUrls() {
|
|
@@ -226,6 +257,24 @@ export class SdChipInput {
|
|
|
226
257
|
"setter": false,
|
|
227
258
|
"defaultValue": "[]"
|
|
228
259
|
},
|
|
260
|
+
"disabledChips": {
|
|
261
|
+
"type": "unknown",
|
|
262
|
+
"mutable": true,
|
|
263
|
+
"complexType": {
|
|
264
|
+
"original": "boolean[] | ((value: string) => boolean)",
|
|
265
|
+
"resolved": "((value: string) => boolean) | boolean[]",
|
|
266
|
+
"references": {}
|
|
267
|
+
},
|
|
268
|
+
"required": false,
|
|
269
|
+
"optional": false,
|
|
270
|
+
"docs": {
|
|
271
|
+
"tags": [],
|
|
272
|
+
"text": ""
|
|
273
|
+
},
|
|
274
|
+
"getter": false,
|
|
275
|
+
"setter": false,
|
|
276
|
+
"defaultValue": "[]"
|
|
277
|
+
},
|
|
229
278
|
"size": {
|
|
230
279
|
"type": "string",
|
|
231
280
|
"mutable": false,
|
|
@@ -113,14 +113,14 @@ sd-field .sd-field.sd-field--focus:not(.sd-field--readonly) .sd-field__wrapper .
|
|
|
113
113
|
box-shadow: 0px 0px 4px 0px rgba(0, 113, 255, 0.4);
|
|
114
114
|
}
|
|
115
115
|
sd-field .sd-field .sd-field__error-message {
|
|
116
|
-
color: var(--sd-
|
|
117
|
-
font-size: var(--sd-
|
|
118
|
-
line-height: var(--sd-
|
|
119
|
-
margin-top: var(--sd-
|
|
116
|
+
color: var(--sd-field-error-message-color);
|
|
117
|
+
font-size: var(--sd-field-error-message-font-size);
|
|
118
|
+
line-height: var(--sd-field-error-message-line-height);
|
|
119
|
+
margin-top: var(--sd-field-message-gap);
|
|
120
120
|
}
|
|
121
121
|
sd-field .sd-field .sd-field__hint {
|
|
122
|
-
color: var(--sd-
|
|
123
|
-
font-size: var(--sd-
|
|
124
|
-
line-height: var(--sd-
|
|
125
|
-
margin-top: var(--sd-
|
|
122
|
+
color: var(--sd-field-hint-color);
|
|
123
|
+
font-size: var(--sd-field-hint-font-size);
|
|
124
|
+
line-height: var(--sd-field-hint-line-height);
|
|
125
|
+
margin-top: var(--sd-field-message-gap);
|
|
126
126
|
}
|
|
@@ -139,6 +139,15 @@ export class SdField {
|
|
|
139
139
|
'--sd-field-control-radius': `var(--sd-system-radius-field-${size})`,
|
|
140
140
|
'--sd-field-label-margin-right': `var(--sd-system-space-field-${size}-gap)`,
|
|
141
141
|
};
|
|
142
|
+
const messageCssVars = {
|
|
143
|
+
'--sd-field-error-message-color': fieldTokens.field.errorMessage.color,
|
|
144
|
+
'--sd-field-error-message-font-size': `${fieldTokens.field.errorMessage.typography.fontSize}px`,
|
|
145
|
+
'--sd-field-error-message-line-height': `${fieldTokens.field.errorMessage.typography.lineHeight}px`,
|
|
146
|
+
'--sd-field-hint-color': fieldTokens.field.hint.color,
|
|
147
|
+
'--sd-field-hint-font-size': `${fieldTokens.field.hint.typography.fontSize}px`,
|
|
148
|
+
'--sd-field-hint-line-height': `${fieldTokens.field.hint.typography.lineHeight}px`,
|
|
149
|
+
'--sd-field-message-gap': `${fieldTokens.field.contents.gap}px`,
|
|
150
|
+
};
|
|
142
151
|
const labelCssVars = this.label !== ''
|
|
143
152
|
? {
|
|
144
153
|
'--sd-field-label-height': `${labelTokens.height}px`,
|
|
@@ -173,21 +182,21 @@ export class SdField {
|
|
|
173
182
|
: {}),
|
|
174
183
|
}
|
|
175
184
|
: {};
|
|
176
|
-
return (h("div", { key: '
|
|
185
|
+
return (h("div", { key: 'a04858364c6b9afceedba2f5d7ee0e289a6b6782', class: {
|
|
177
186
|
'sd-field': true,
|
|
178
187
|
'sd-field--has-label': this.label !== '',
|
|
179
188
|
'sd-field--has-addon': addon !== '',
|
|
180
189
|
[this.fieldStatus]: this.fieldStatus !== '',
|
|
181
|
-
}, style: { ...sizeCssVars, ...labelCssVars, ...addonCssVars } }, h("div", { key: '
|
|
190
|
+
}, style: { ...sizeCssVars, ...labelCssVars, ...addonCssVars, ...messageCssVars } }, h("div", { key: '898f5af4d213745257b2666cbea56db591792054', class: "sd-field__wrapper" }, this.renderLabel(this.label), h("div", { key: '488ab5c290258d0139f677319f21a55bb6c63876', class: "sd-field__main", style: this.width !== '' && this.width !== 0
|
|
182
191
|
? {
|
|
183
192
|
width: typeof this.width === 'number' ? `${this.width}px` : this.width,
|
|
184
193
|
flex: 'none',
|
|
185
194
|
}
|
|
186
|
-
: {} }, h("div", { key: '
|
|
195
|
+
: {} }, h("div", { key: 'db8c388dd2c4743a287f7567cde4015cafed1d95', class: {
|
|
187
196
|
'sd-field__control': true,
|
|
188
197
|
'sd-field__control--has-addon': addon !== '',
|
|
189
|
-
} }, addon && (h("div", { key: '
|
|
190
|
-
Number(FIELD_LABEL_SIZE_MAP[(this.size in FIELD_LABEL_SIZE_MAP ? this.size : 'sm')].icon), color: this.icon.color, rotate: this.icon.rotate })), addon)), h("slot", { key: '
|
|
198
|
+
} }, addon && (h("div", { key: '1049369f52322fb1a4f1b4baf50b1e4ef2e9e59e', class: "sd-field__addon" }, this.icon && (h("sd-icon", { key: 'f0a28d9bdf97730088454c64b71b7cbc1d4dd875', name: this.icon.name, size: this.icon.size ??
|
|
199
|
+
Number(FIELD_LABEL_SIZE_MAP[(this.size in FIELD_LABEL_SIZE_MAP ? this.size : 'sm')].icon), color: this.icon.color, rotate: this.icon.rotate })), addon)), h("slot", { key: 'deee9ef5d166ab4d17451ad9d013b3b9d3d7aebe' })), this.errorMsg !== '' || this.errorMessage !== '' ? (h("div", { class: "sd-field__error-message" }, this.errorMsg !== '' ? this.errorMsg : this.errorMessage)) : (this.hint !== '' && h("div", { class: "sd-field__hint" }, this.hint))))));
|
|
191
200
|
}
|
|
192
201
|
renderLabel(label) {
|
|
193
202
|
if (label == null || label === '')
|
|
@@ -7,9 +7,16 @@ export const RADIO_LAYOUT = {
|
|
|
7
7
|
dotSize: radioTokens.radio.dot.size,
|
|
8
8
|
};
|
|
9
9
|
export const RADIO_TYPOGRAPHY = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
default: {
|
|
11
|
+
fontSize: radioTokens.radio.typography.default.fontSize,
|
|
12
|
+
lineHeight: radioTokens.radio.typography.default.lineHeight,
|
|
13
|
+
fontWeight: radioTokens.radio.typography.default.fontWeight,
|
|
14
|
+
},
|
|
15
|
+
selected: {
|
|
16
|
+
fontSize: radioTokens.radio.typography.selected.fontSize,
|
|
17
|
+
lineHeight: radioTokens.radio.typography.selected.lineHeight,
|
|
18
|
+
fontWeight: radioTokens.radio.typography.selected.fontWeight,
|
|
19
|
+
},
|
|
13
20
|
};
|
|
14
21
|
export const RADIO_COLORS = {
|
|
15
22
|
unchecked: {
|
|
@@ -27,5 +34,8 @@ export const RADIO_COLORS = {
|
|
|
27
34
|
border: radioTokens.radio.border.disabled,
|
|
28
35
|
dot: radioTokens.radio.dot.disabled,
|
|
29
36
|
},
|
|
30
|
-
label:
|
|
37
|
+
label: {
|
|
38
|
+
default: radioTokens.radio.label.default,
|
|
39
|
+
disabled: radioTokens.radio.label.disabled,
|
|
40
|
+
},
|
|
31
41
|
};
|
|
@@ -39,11 +39,25 @@ sd-radio .sd-radio__label {
|
|
|
39
39
|
font-weight: var(--sd-radio-font-weight);
|
|
40
40
|
color: var(--sd-radio-label-color);
|
|
41
41
|
line-height: var(--sd-radio-line-height);
|
|
42
|
+
display: inline-flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
}
|
|
45
|
+
sd-radio .sd-radio__label::before {
|
|
46
|
+
content: attr(data-label);
|
|
47
|
+
height: 0;
|
|
48
|
+
font-weight: var(--sd-radio-selected-font-weight);
|
|
49
|
+
visibility: hidden;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
user-select: none;
|
|
52
|
+
pointer-events: none;
|
|
42
53
|
}
|
|
43
54
|
sd-radio .sd-radio:hover:not(.sd-radio--disabled) .sd-radio__circle {
|
|
44
55
|
background: var(--sd-radio-unchecked-bg-hover);
|
|
45
56
|
border-color: var(--sd-radio-unchecked-border-hover);
|
|
46
57
|
}
|
|
58
|
+
sd-radio .sd-radio--checked .sd-radio__label {
|
|
59
|
+
font-weight: var(--sd-radio-selected-font-weight);
|
|
60
|
+
}
|
|
47
61
|
sd-radio .sd-radio--checked .sd-radio__circle {
|
|
48
62
|
border-color: var(--sd-radio-checked-border);
|
|
49
63
|
}
|
|
@@ -61,6 +75,9 @@ sd-radio .sd-radio--checked .sd-radio__circle::after {
|
|
|
61
75
|
sd-radio .sd-radio--disabled {
|
|
62
76
|
cursor: not-allowed;
|
|
63
77
|
}
|
|
78
|
+
sd-radio .sd-radio--disabled .sd-radio__label {
|
|
79
|
+
color: var(--sd-radio-label-disabled-color);
|
|
80
|
+
}
|
|
64
81
|
sd-radio .sd-radio--disabled .sd-radio__circle {
|
|
65
82
|
background: var(--sd-radio-disabled-bg);
|
|
66
83
|
border-color: var(--sd-radio-disabled-border);
|
|
@@ -13,10 +13,7 @@ export class SdRadio {
|
|
|
13
13
|
return String(this.val) === String(this.value);
|
|
14
14
|
}
|
|
15
15
|
get radioClasses() {
|
|
16
|
-
const classes = [
|
|
17
|
-
'sd-radio',
|
|
18
|
-
this.isSelected ? 'sd-radio--checked' : 'sd-radio--unchecked',
|
|
19
|
-
];
|
|
16
|
+
const classes = ['sd-radio', this.isSelected ? 'sd-radio--checked' : 'sd-radio--unchecked'];
|
|
20
17
|
if (this.disabled) {
|
|
21
18
|
classes.push('sd-radio--disabled');
|
|
22
19
|
}
|
|
@@ -34,9 +31,10 @@ export class SdRadio {
|
|
|
34
31
|
'--sd-radio-border-width': `${RADIO_LAYOUT.borderWidth}px`,
|
|
35
32
|
'--sd-radio-gap': `${RADIO_LAYOUT.gap}px`,
|
|
36
33
|
'--sd-radio-dot-size': `${RADIO_LAYOUT.dotSize}px`,
|
|
37
|
-
'--sd-radio-font-size': `${RADIO_TYPOGRAPHY.fontSize}px`,
|
|
38
|
-
'--sd-radio-line-height': `${RADIO_TYPOGRAPHY.lineHeight}px`,
|
|
39
|
-
'--sd-radio-font-weight': RADIO_TYPOGRAPHY.fontWeight,
|
|
34
|
+
'--sd-radio-font-size': `${RADIO_TYPOGRAPHY.default.fontSize}px`,
|
|
35
|
+
'--sd-radio-line-height': `${RADIO_TYPOGRAPHY.default.lineHeight}px`,
|
|
36
|
+
'--sd-radio-font-weight': RADIO_TYPOGRAPHY.default.fontWeight,
|
|
37
|
+
'--sd-radio-selected-font-weight': RADIO_TYPOGRAPHY.selected.fontWeight,
|
|
40
38
|
'--sd-radio-unchecked-bg': RADIO_COLORS.unchecked.bg,
|
|
41
39
|
'--sd-radio-unchecked-bg-hover': RADIO_COLORS.unchecked.bgHover,
|
|
42
40
|
'--sd-radio-unchecked-border': RADIO_COLORS.unchecked.border,
|
|
@@ -46,9 +44,10 @@ export class SdRadio {
|
|
|
46
44
|
'--sd-radio-disabled-bg': RADIO_COLORS.disabled.bg,
|
|
47
45
|
'--sd-radio-disabled-border': RADIO_COLORS.disabled.border,
|
|
48
46
|
'--sd-radio-disabled-dot': RADIO_COLORS.disabled.dot,
|
|
49
|
-
'--sd-radio-label-color': RADIO_COLORS.label,
|
|
47
|
+
'--sd-radio-label-color': RADIO_COLORS.label.default,
|
|
48
|
+
'--sd-radio-label-disabled-color': RADIO_COLORS.label.disabled,
|
|
50
49
|
};
|
|
51
|
-
return (h("label", { key: '
|
|
50
|
+
return (h("label", { key: 'f403a1fd88109a6907cc37b03b35fe5a7bbafdfb', class: this.radioClasses, style: cssVars, "aria-checked": this.isSelected ? 'true' : 'false', "aria-disabled": this.disabled ? 'true' : 'false' }, h("input", { key: 'ba8c105d6d52bc4452e1b9614f42dfa2d99221e1', type: "radio", name: String(this.val), value: String(this.val), checked: this.isSelected, disabled: this.disabled, "aria-label": this.label || String(this.val), onInput: this.handleRadioChange }), h("span", { key: 'd92352c59bf7f144a68decd3652dc7208b813a0e', class: "sd-radio__circle" }), this.label && (h("span", { key: 'bc0b1384dee0b22efec56249edc88184a96c6efe', class: "sd-radio__label", "data-label": this.label }, this.label))));
|
|
52
51
|
}
|
|
53
52
|
static get is() { return "sd-radio"; }
|
|
54
53
|
static get originalStyleUrls() {
|
|
@@ -39,11 +39,25 @@ sd-radio .sd-radio__label {
|
|
|
39
39
|
font-weight: var(--sd-radio-font-weight);
|
|
40
40
|
color: var(--sd-radio-label-color);
|
|
41
41
|
line-height: var(--sd-radio-line-height);
|
|
42
|
+
display: inline-flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
}
|
|
45
|
+
sd-radio .sd-radio__label::before {
|
|
46
|
+
content: attr(data-label);
|
|
47
|
+
height: 0;
|
|
48
|
+
font-weight: var(--sd-radio-selected-font-weight);
|
|
49
|
+
visibility: hidden;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
user-select: none;
|
|
52
|
+
pointer-events: none;
|
|
42
53
|
}
|
|
43
54
|
sd-radio .sd-radio:hover:not(.sd-radio--disabled) .sd-radio__circle {
|
|
44
55
|
background: var(--sd-radio-unchecked-bg-hover);
|
|
45
56
|
border-color: var(--sd-radio-unchecked-border-hover);
|
|
46
57
|
}
|
|
58
|
+
sd-radio .sd-radio--checked .sd-radio__label {
|
|
59
|
+
font-weight: var(--sd-radio-selected-font-weight);
|
|
60
|
+
}
|
|
47
61
|
sd-radio .sd-radio--checked .sd-radio__circle {
|
|
48
62
|
border-color: var(--sd-radio-checked-border);
|
|
49
63
|
}
|
|
@@ -61,6 +75,9 @@ sd-radio .sd-radio--checked .sd-radio__circle::after {
|
|
|
61
75
|
sd-radio .sd-radio--disabled {
|
|
62
76
|
cursor: not-allowed;
|
|
63
77
|
}
|
|
78
|
+
sd-radio .sd-radio--disabled .sd-radio__label {
|
|
79
|
+
color: var(--sd-radio-label-disabled-color);
|
|
80
|
+
}
|
|
64
81
|
sd-radio .sd-radio--disabled .sd-radio__circle {
|
|
65
82
|
background: var(--sd-radio-disabled-bg);
|
|
66
83
|
border-color: var(--sd-radio-disabled-border);
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-
|
|
1
|
+
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-Bg9XySrz.js";import{c as t}from"./p-DRVnqiWc.js";let n=null;function e(t,n){void 0!==n&&(void 0!==n.position&&t.setAttribute("position",n.position),null!=n.maxVisible&&t.setAttribute("max-visible",n.maxVisible+""),null!=n.defaultDuration&&t.setAttribute("default-duration",n.defaultDuration+""),null!=n.zIndex&&t.setAttribute("z-index",n.zIndex+""))}function o(t){return n&&document.body.contains(n)?(e(n,t),n):(n=document.createElement("sd-toast-container"),e(n,t),document.body.appendChild(n),n)}function i(t){return"function"==typeof t.create?Promise.resolve():new Promise((n=>{const e=()=>{"function"==typeof t.create?n():requestAnimationFrame(e)};requestAnimationFrame(e)}))}const c={async create(t,n,e){const{globalOptions:s,...r}=e??{},c=o(s);return await i(c),c.create({message:t,type:n,...r})},async dismiss(t){if(null!=n)return await i(n),n.dismiss(t)},async dismissAll(){if(null!=n)return await i(n),n.dismissAll()},configure(t){o(t)}},u="sd-modal-container";let d=null;const l={ok:"confirm",cancel:"cancel",close:"close"};class m{modalId;okFn;cancelFn;closeFn;clickFn;dismissedFn;containerRef;pendingActions=[];dismissRequested=!1;constructor(t,n){this.modalId=t,this.containerRef=n}onOk(t){return this.okFn=t,this}onCancel(t){return this.cancelFn=t,this}onClose(t){return this.closeFn=t,this}onClick(t){return this.clickFn=t,this}onDismissed(t){return this.dismissedFn=t,this}update(t){return this.runOrQueue((()=>{this.containerRef?.update(this.modalId,t)})),this}ok(){return this.dismiss("ok")}cancel(){return this.dismiss("cancel")}close(){return this.dismiss("close")}dismiss(t="close"){if(this.dismissRequested)return this;this.dismissRequested=!0;const n=l[t];return this.runOrQueue((()=>{this.containerRef?.dismissById(this.modalId,n)})),this}_triggerOk(){this.okFn?.()}_triggerCancel(){this.cancelFn?.()}_triggerClose(){this.closeFn?.()}_triggerClick(){this.clickFn?.()}_triggerDismissed(){this.dismissedFn?.()}_setId(t){this.modalId=t;const n=[...this.pendingActions];this.pendingActions=[],n.forEach((t=>t()))}_setContainer(t){this.containerRef=t}runOrQueue(t){""===this.modalId||null==this.containerRef?this.pendingActions.push(t):t()}}function f(){if("undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof customElements)throw Error("[sdModal] Browser APIs are unavailable. Use `sdModal` only on the client.")}function h(){if(f(),function(){if(!customElements.get(u))throw Error("[sdModal] `sd-modal-container` is not registered. Call `defineCustomElements(window)` before using `sdModal`.")}(),d&&d.isConnected)return d;const t=document.createElement(u);return t.setAttribute("auto-remove",""),document.body.appendChild(t),d=t,t}async function w(t){if(await customElements.whenDefined(u),"function"==typeof t.open)return Promise.resolve();throw Error("[sdModal] `sd-modal-container` is registered but not ready to open dialogs.")}function p(){return new m("")}function y(t,n){const{component:e,persistent:s}=n,o=h(),i={persistent:s};t._setContainer(o),w(o).then((async()=>{const n=await o.createCustom(e,i,t);t._setId(n)}))}const E={confirm(t){const n=h(),e=new m("",n);return w(n).then((async()=>{const s=await n.open(t,e);e._setId(s)})),e},loading(t={}){const n=h(),e=new m("",n);return w(n).then((async()=>{const s=await n.openLoading(t,e);e._setId(s)})),e},create(t){const n=p();return y(n,t),n},configure(n){f(),t(n)}},C="sd-loading-container";let k=null;async function A(t){const n=(function(){if("undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof customElements)throw Error("[sdLoading] Browser APIs are unavailable. Use `sdLoading` only on the client.")}(),function(){if(!customElements.get(C))throw Error("[sdLoading] `sd-loading-container` is not registered. Call `defineCustomElements(window)` before using `sdLoading`.")}(),k&&document.body.contains(k)||(k=document.createElement(C),document.body.appendChild(k)),k);await customElements.whenDefined(C),t(n)}const P={show(t={}){A((n=>{n.show?.(t)}))},hide(){k&&A((t=>{t.hide?.()}))}};export{y as _attachSdModalWithRef,p as _createSdModalRef,P as sdLoading,E as sdModal,c as sdToast}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as o}from"./p-
|
|
1
|
+
import{h as o}from"./p-Bg9XySrz.js";const t=t=>o("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},o("path",{d:"M8.83205 10.7519C8.43623 11.3457 7.56377 11.3457 7.16795 10.7519L1.04907e-06 -1.39876e-06L16 0L8.83205 10.7519Z",fill:"currentColor"}));export{t as T}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,H as r,h as s,d as c,t}from"./p-
|
|
1
|
+
import{p as e,H as r,h as s,d as c,t}from"./p-Bg9XySrz.js";import{p as a}from"./p-D1vaasIp.js";import{s as o}from"./p-j2khhcHY.js";var i={track:"#EEEEEE",arc:"#2D8DFF"};const l=a.progress.color.label,n=o.color.fg.tertiary,p={primary:{arc:i.arc,track:i.track},inverse:{arc:"#FFFFFF",track:"transparent"},error:{arc:"#E30000",track:i.track},complete:{arc:"#01BB4B",track:i.track}},d=2*Math.PI*34,g=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost()}indeterminate=!1;value=0;type="primary";label;get clampedValue(){return Number.isFinite(this.value)?Math.max(0,Math.min(100,this.value)):0}render(){const e=p[this.type]??p.primary,r={"--sd-circle-progress-track":e.track,"--sd-circle-progress-arc":e.arc,"--sd-circle-progress-label-color":l,"--sd-circle-progress-percent-color":0===this.clampedValue?n:e.arc},t={};this.indeterminate||(t.strokeDasharray=`${this.clampedValue/100*d} ${d}`,t.strokeDashoffset="0");const a=!this.indeterminate;return s(c,{key:"46d74c0edb5a5e8cd0472c83efc45a0efaf353b4",style:r},s("svg",{key:"34117c89eb180370a215807e614ad08f4f72b517",class:"sd-circle-progress",viewBox:"0 0 80 80",xmlns:"http://www.w3.org/2000/svg"},s("circle",{key:"08ac6f011b6a4b6744ddcf437b1e0a5b96abfc6e",class:"sd-circle-progress__track",cx:40,cy:40,r:34,fill:"none","stroke-width":12}),s("circle",{key:"5ae0a53ce10bd5a8b2f316ebd00d3ee28c4336d6",class:"sd-circle-progress__arc",cx:40,cy:40,r:34,fill:"none","stroke-width":12,"stroke-linecap":"round",style:t})),a&&s("span",{key:"fd52ee1947d41b2117c9ea6e4cc9a448799342e3",class:"sd-circle-progress__percent"},Math.round(this.clampedValue),"%"),this.label&&s("span",{key:"a58776c4ef67eb900eba97ff4fed138c8f5e8452",class:"sd-circle-progress__label"},this.label))}static get style(){return'@charset "UTF-8";sd-circle-progress{display:inline-flex;flex-direction:column;align-items:center;gap:8px}sd-circle-progress .sd-circle-progress{width:80px;height:80px}sd-circle-progress .sd-circle-progress__track{stroke:var(--sd-circle-progress-track)}sd-circle-progress .sd-circle-progress__arc{stroke:var(--sd-circle-progress-arc);transform:rotate(-90deg);transform-origin:center center;transition:stroke-dasharray 0.4s linear, stroke-dashoffset 0.4s linear}sd-circle-progress .sd-circle-progress__percent{text-align:center;color:var(--sd-circle-progress-percent-color);font-family:"Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;font-size:16px;font-weight:700;line-height:26px}sd-circle-progress .sd-circle-progress__label{text-align:center;color:var(--sd-circle-progress-label-color);font-family:"Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;font-size:12px;font-weight:400;line-height:20px}sd-circle-progress{}sd-circle-progress[indeterminate] .sd-circle-progress{animation:sd-circle-progress-spin 2s linear infinite;transform-origin:center center}sd-circle-progress[indeterminate] .sd-circle-progress__arc{transform:none;transition:none;animation:sd-circle-progress-spin-path 1.5s ease-in-out infinite}@keyframes sd-circle-progress-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes sd-circle-progress-spin-path{0%{stroke-dasharray:1, 340;stroke-dashoffset:0}50%{stroke-dasharray:151, 340;stroke-dashoffset:-60}100%{stroke-dasharray:151, 340;stroke-dashoffset:-211}}'}},[512,"sd-circle-progress",{indeterminate:[516],value:[2],type:[513],label:[1]}]);function f(){"undefined"!=typeof customElements&&["sd-circle-progress"].forEach((e=>{"sd-circle-progress"===e&&(customElements.get(t(e))||customElements.define(t(e),g))}))}export{g as S,f as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as d,H as i,c as r,h as e,t as o}from"./p-Bg9XySrz.js";import{d as a}from"./p-MJG6EZeP.js";const s=d(class extends i{constructor(d){super(),!1!==d&&this.__registerHost(),this.change=r(this,"sdUpdate",7)}value;options=[];direction="vertical";disabled=!1;groupName;change;valueChanged(d){this.value=d}handleRadioChange=d=>{if(this.disabled)return;const i=this.options.find((i=>String(i.value)===String(d))),r=i?i.value:d;this.value=r,this.change?.emit(r)};getGroupClasses(){return["sd-radio-group",`sd-radio-group--${this.direction??"vertical"}`].join(" ")}render(){return e("div",{key:"d60a7fed2bbe1cd2d577827b10c99627aabbda66",class:this.getGroupClasses(),role:"radiogroup"},this.options.map((d=>e("sd-radio",{key:`radio-${d.value}`,val:String(d.value),value:String(this.value),label:d.label,disabled:this.disabled||!!d.disabled,onSdUpdate:({detail:d})=>this.handleRadioChange(d)}))))}static get watchers(){return{value:[{valueChanged:0}]}}static get style(){return'sd-radio{display:inline-flex;width:fit-content;height:var(--sd-radio-line-height);line-height:0}sd-radio .sd-radio{cursor:pointer;display:inline-flex;align-items:center;gap:var(--sd-radio-gap);height:var(--sd-radio-line-height);max-height:var(--sd-radio-line-height)}sd-radio .sd-radio>input{position:absolute;width:0;height:0;opacity:0;pointer-events:none}sd-radio .sd-radio>input:focus-visible+.sd-radio__circle{box-shadow:0 0 0 2px white, 0 0 0 4px var(--sd-radio-checked-border);outline:none}sd-radio .sd-radio__circle{position:relative;width:var(--sd-radio-size);height:var(--sd-radio-size);border-radius:50%;border:var(--sd-radio-border-width) solid var(--sd-radio-unchecked-border);box-sizing:border-box;background:var(--sd-radio-unchecked-bg);display:inline-flex;flex-shrink:0}sd-radio .sd-radio__label{font-size:var(--sd-radio-font-size);font-weight:var(--sd-radio-font-weight);color:var(--sd-radio-label-color);line-height:var(--sd-radio-line-height);display:inline-flex;flex-direction:column}sd-radio .sd-radio__label::before{content:attr(data-label);height:0;font-weight:var(--sd-radio-selected-font-weight);visibility:hidden;overflow:hidden;user-select:none;pointer-events:none}sd-radio .sd-radio:hover:not(.sd-radio--disabled) .sd-radio__circle{background:var(--sd-radio-unchecked-bg-hover);border-color:var(--sd-radio-unchecked-border-hover)}sd-radio .sd-radio--checked .sd-radio__label{font-weight:var(--sd-radio-selected-font-weight)}sd-radio .sd-radio--checked .sd-radio__circle{border-color:var(--sd-radio-checked-border)}sd-radio .sd-radio--checked .sd-radio__circle::after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:var(--sd-radio-dot-size);height:var(--sd-radio-dot-size);border-radius:50%;background:var(--sd-radio-checked-dot)}sd-radio .sd-radio--disabled{cursor:not-allowed}sd-radio .sd-radio--disabled .sd-radio__label{color:var(--sd-radio-label-disabled-color)}sd-radio .sd-radio--disabled .sd-radio__circle{background:var(--sd-radio-disabled-bg);border-color:var(--sd-radio-disabled-border)}sd-radio .sd-radio--disabled.sd-radio--checked .sd-radio__circle::after{background:var(--sd-radio-disabled-dot)}sd-radio-group{display:inline-block}sd-radio-group .sd-radio-group{display:flex}sd-radio-group .sd-radio-group--vertical{flex-direction:column;gap:8px}sd-radio-group .sd-radio-group--horizontal{flex-direction:row;align-items:center;gap:20px}'}},[512,"sd-radio-group",{value:[1032],options:[1040],direction:[1],disabled:[4],groupName:[1,"group-name"]},void 0,{value:[{valueChanged:0}]}]);function t(){"undefined"!=typeof customElements&&["sd-radio-group","sd-radio"].forEach((d=>{switch(d){case"sd-radio-group":customElements.get(o(d))||customElements.define(o(d),s);break;case"sd-radio":customElements.get(o(d))||a()}}))}export{s as S,t as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,H as s,c as t,h as i,t as a}from"./p-
|
|
1
|
+
import{p as e,H as s,c as t,h as i,t as a}from"./p-Bg9XySrz.js";import{n as d}from"./p-CCwNgVmC.js";import{d as o,D as r,a as l}from"./p-Bfrg9lvO.js";import{d as n}from"./p-iGvyLmbb.js";import{d as h}from"./p-BMVHvEDw.js";import{d as c}from"./p-vS0t7bWk.js";import{d as p}from"./p-DknZgTo9.js";import{d as m}from"./p-B73U-Zw2.js";import{d as b}from"./p-Cftyepf_.js";import{d as u}from"./p-IgBxAXyL.js";import{d as f}from"./p-CLEAGFjW.js";import{d as g}from"./p-BvAJ_toQ.js";const k=e(class e extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.update=t(this,"sdUpdate",7),this.viewChange=t(this,"sdViewChange",7)}static CLOSE_ANIMATION_DURATION=150;get el(){return this}value=null;size="sm";placeholder="YYYY-MM-DD";selectable;disabled=!1;width="";label="";labelWidth="";addonLabel="";addonAlign="start";hint="";errorMessage="";rules=[];error=!1;icon=void 0;labelTooltip="";labelTooltipProps=null;isOpen=!1;isAnimatingOut=!1;focused=!1;hovered=!1;update;viewChange;triggerRef;formField;closeAnimationTimer;name=d();watchIsOpen(e){this.focused=e}async sdValidate(){return this.formField?.sdValidate()}async sdReset(){return this.formField?.sdReset()}async sdResetValidate(){return this.formField?.sdResetValidation()}closeDropdown(){this.isOpen&&(this.isOpen=!1,this.isAnimatingOut=!0,this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.closeAnimationTimer=setTimeout((()=>{this.isAnimatingOut=!1}),e.CLOSE_ANIMATION_DURATION))}handleTriggerClick=()=>{this.disabled||(this.isOpen?this.closeDropdown():(this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer),this.isAnimatingOut=!1,this.isOpen=!0))};handleSelect=e=>{e.stopPropagation(),this.closeDropdown(),this.value=e.detail;const s=this.value;requestAnimationFrame((()=>{this.update.emit(s)}))};handleViewChange=e=>{this.viewChange.emit(e.detail)};disconnectedCallback(){this.closeAnimationTimer&&clearTimeout(this.closeAnimationTimer)}render(){const e=l[this.size]??l.sm;return i("sd-field",{key:"baa957e5534b6587da2ef067ecad4a0934693800",name:this.name,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,addonAlign:this.addonAlign,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-system-size-field-sm-height":`${e.height}px`,"--sd-system-radius-field-sm":`${e.radius}px`,"--sd-system-color-field-border-default":r.border.default,"--sd-system-color-field-border-focus":r.border.focus,"--sd-system-color-field-bg-default":r.bg.default}},i("div",{key:"652f9f5c6bd5c6ee58f3c89eee45325a98234ac0",class:"sd-date-picker",ref:e=>{this.triggerRef=e}},i("sd-date-picker-trigger",{key:"7b0f81badbcf7ca283afd274b4572e4a6eaa590b",displayText:this.value??"",placeholder:this.placeholder,disabled:this.disabled,size:this.size,onSdTriggerClick:this.handleTriggerClick})),(this.isOpen||this.isAnimatingOut)&&i("sd-portal",{key:"65fbe892e4cdd9d643b5000d69220b5e28972902",open:this.isOpen,parentRef:this.triggerRef,onSdClose:()=>this.closeDropdown()},i("sd-calendar",{key:"e9187264f336295907f1d5574810df4a07a0f114",elevated:!0,value:this.value,selectable:this.selectable,onSdUpdate:this.handleSelect,onSdViewChange:this.handleViewChange})))}static get watchers(){return{isOpen:[{watchIsOpen:0}]}}static get style(){return"sd-date-picker{display:inline-flex}sd-date-picker sd-portal{display:none}sd-date-picker .sd-date-picker{position:relative;width:100%;height:100%}"}},[512,"sd-date-picker",{value:[1025],size:[513],placeholder:[513],selectable:[16],disabled:[516],width:[8],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],addonAlign:[1,"addon-align"],hint:[1],errorMessage:[1,"error-message"],rules:[16],error:[1028],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],name:[1],isOpen:[32],isAnimatingOut:[32],focused:[32],hovered:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64]},void 0,{isOpen:[{watchIsOpen:0}]}]);function y(){"undefined"!=typeof customElements&&["sd-date-picker","sd-button","sd-calendar","sd-date-picker-trigger","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-portal","sd-tag","sd-tooltip"].forEach((e=>{switch(e){case"sd-date-picker":customElements.get(a(e))||customElements.define(a(e),k);break;case"sd-button":customElements.get(a(e))||n();break;case"sd-calendar":customElements.get(a(e))||h();break;case"sd-date-picker-trigger":customElements.get(a(e))||o();break;case"sd-field":customElements.get(a(e))||c();break;case"sd-floating-portal":customElements.get(a(e))||p();break;case"sd-ghost-button":customElements.get(a(e))||m();break;case"sd-icon":customElements.get(a(e))||b();break;case"sd-portal":customElements.get(a(e))||u();break;case"sd-tag":customElements.get(a(e))||f();break;case"sd-tooltip":customElements.get(a(e))||g()}}))}export{k as S,y as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,H as t,c as i,h as n,t as o}from"./p-
|
|
1
|
+
import{p as e,H as t,c as i,h as n,t as o}from"./p-Bg9XySrz.js";import{d as s}from"./p-Cftyepf_.js";var l={textLink:{sm:{gap:"4",icon:"16",typography:{default:{fontFamily:"Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",fontSize:"12",fontWeight:"500",textDecoration:"none",lineHeight:"20"},underline:{fontFamily:"Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",fontSize:"12",fontWeight:"500",textDecoration:"underline",lineHeight:"20"}}},md:{gap:"8",icon:"16",typography:{default:{fontFamily:"Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",fontSize:"14",fontWeight:"500",textDecoration:"none",lineHeight:"24"},underline:{fontFamily:"Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",fontSize:"14",fontWeight:"500",textDecoration:"underline",lineHeight:"24"}}},content:{disabled:"#888888"},icon:{default:"#006AC1",disabled:"#BBBBBB"},lg:{typography:{default:{fontFamily:"Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",fontSize:"16",fontWeight:"500",textDecoration:"none",lineHeight:"26"},underline:{fontFamily:"Pretendard Variable, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Segoe UI, Apple SD Gothic Neo, Noto Sans KR, Malgun Gothic, Apple Color Emoji, Segoe UI Emoji, sans-serif",fontSize:"16",fontWeight:"500",textDecoration:"underline",lineHeight:"26"}},gap:"8",icon:"20"}}};const a={sm:{gap:Number(l.textLink.sm.gap),iconSize:Number(l.textLink.sm.icon),typography:{default:l.textLink.sm.typography.default,underline:l.textLink.sm.typography.underline}},md:{gap:Number(l.textLink.md.gap),iconSize:Number(l.textLink.md.icon),typography:{default:l.textLink.md.typography.default,underline:l.textLink.md.typography.underline}},lg:{gap:Number(l.textLink.lg.gap),iconSize:Number(l.textLink.lg.icon),typography:{default:l.textLink.lg.typography.default,underline:l.textLink.lg.typography.underline}}},r={content:l.textLink.content,icon:l.textLink.icon},d=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.click=i(this,"sdClick",7)}label="";icon="";iconColor="";labelClass="";rightArrow="none";underline=!1;disabled=!1;size="sm";click;handleClick=()=>{this.disabled||this.click.emit()};render(){const e=a[this.size],t=this.underline?e.typography.underline:e.typography.default,i=["sd-text-link__label",this.labelClass].filter(Boolean).join(" "),o=this.disabled?r.icon.disabled:"#888888",s={"--sd-text-link-gap":`${e.gap}px`,"--sd-text-link-font-size":`${t.fontSize}px`,"--sd-text-link-line-height":`${t.lineHeight}px`,"--sd-text-link-text-decoration":t.textDecoration,...this.disabled?{"--sd-text-link-color":r.content.disabled}:{}};return n("span",{key:"89b8117d19d149faf70d026ef560acdfa0096daa",role:"button",tabindex:this.disabled?-1:0,class:{"sd-text-link":!0,"sd-text-link--disabled":this.disabled},style:s,onClick:this.handleClick,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleClick())}},this.icon&&n("sd-icon",{key:"684c7b31abc6cb806944c03a016c4520c4721a7c",name:this.icon,size:e.iconSize,color:this.disabled?r.icon.disabled:this.iconColor||r.icon.default,class:"sd-text-link__icon"}),n("span",{key:"272f5b4c889b099ede7b5146ea4828648d89ad69",class:i},this.label),this.rightArrow&&"none"!==this.rightArrow&&n("span",{key:"142d37f856df2e5858df5d976e4d8ac4ee2f2607",class:"sd-text-link__arrow",style:{width:"16px",height:"16px",display:"inline-flex",alignItems:"center",justifyContent:"center"}},n("sd-icon",{key:"5da12b6077fb33912260b353cb6fe7d533eab937",name:"chevron"===this.rightArrow?"chevronRight":"caretRight",size:12,color:o})))}static get style(){return"sd-text-link{display:inline-flex}sd-text-link .sd-text-link{display:inline-flex;align-items:center;gap:var(--sd-text-link-gap);cursor:pointer;user-select:none}sd-text-link .sd-text-link__label{font-size:var(--sd-text-link-font-size, 12px);line-height:var(--sd-text-link-line-height, 20px);text-decoration:var(--sd-text-link-text-decoration);color:var(--sd-text-link-color, inherit)}sd-text-link .sd-text-link:not(.sd-text-link--disabled):hover .sd-text-link__label{text-decoration:underline}sd-text-link .sd-text-link--disabled{cursor:not-allowed}"}},[512,"sd-text-link",{label:[1],icon:[1],iconColor:[1,"icon-color"],labelClass:[1,"label-class"],rightArrow:[1,"right-arrow"],underline:[516],disabled:[516],size:[513]}]);function c(){"undefined"!=typeof customElements&&["sd-text-link","sd-icon"].forEach((e=>{switch(e){case"sd-text-link":customElements.get(o(e))||customElements.define(o(e),d);break;case"sd-icon":customElements.get(o(e))||s()}}))}export{d as S,c as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,H as i,c as s,h as t,t as l}from"./p-
|
|
1
|
+
import{p as e,H as i,c as s,h as t,t as l}from"./p-Bg9XySrz.js";import{n as r}from"./p-CCwNgVmC.js";import{d as o}from"./p-iGvyLmbb.js";import{d as a}from"./p-DUwrMHYa.js";import{d}from"./p-vS0t7bWk.js";import{d as n}from"./p-DknZgTo9.js";import{d as c}from"./p-B73U-Zw2.js";import{d as h}from"./p-Cftyepf_.js";import{d as p}from"./p-CLEAGFjW.js";import{d as f}from"./p-BvAJ_toQ.js";var u={sm:{height:"28",paddingX:"12",gap:"8",radius:"4",typography:{fontWeight:"400",fontSize:"12",lineHeight:"20"},icon:"16"},text:{default:"#222222",placeholder:"#AAAAAA",disabled:"#888888"},icon:{disabled:"#BBBBBB"}};const k={height:u.sm.height,paddingX:u.sm.paddingX,gap:u.sm.gap,radius:u.sm.radius,fontSize:u.sm.typography.fontSize,lineHeight:u.sm.typography.lineHeight,fontWeight:u.sm.typography.fontWeight,iconSize:u.sm.icon},m={text:u.text,icon:{default:"#888888",disabled:u.icon.disabled}},b=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.update=s(this,"sdUpdate",7),this.reject=s(this,"sdReject",7)}get el(){return this}value=null;placeholder="Click to upload";disabled=!1;inline=!1;multiple=!1;accept;maxFileSize;maxTotalSize;maxFiles;name=r();label="";labelWidth="";addonLabel="";addonAlign="start";hint="";errorMessage="";width="";rules;error=!1;status;icon=void 0;labelTooltip="";labelTooltipProps=null;focused=!1;hovered=!1;internalValue=null;showTooltip=!1;fileInputRef;fileNamesRef;formField;update;reject;valueChanged(e){this.internalValue=e}componentDidLoad(){this.checkOverflow()}componentDidUpdate(){this.checkOverflow()}async sdValidate(){return this.formField?.sdValidate()??Promise.resolve(!0)}async sdReset(){const e=this.multiple?[]:null;this.value=e,this.internalValue=e,this.fileInputRef&&(this.fileInputRef.value=""),await(this.formField?.sdResetValidation())}async sdResetValidate(){await(this.formField?.sdResetValidation())}toBytes(e){if(null!=e)return"string"==typeof e?Number(e):e}validateFiles(e,i=0){const s=this.toBytes(this.maxFileSize),t=this.toBytes(this.maxTotalSize),l=null!=this.maxFiles?Number(this.maxFiles):void 0;if(null!=l&&i+e.length>l)return{accepted:[],rejected:e,reason:"max-files"};if(null!=s){const i=e.filter((e=>e.size>s));if(i.length>0)return{accepted:[],rejected:i,reason:"max-file-size"}}return null!=t&&e.reduce(((e,i)=>e+i.size),0)>t?{accepted:[],rejected:e,reason:"max-total-size"}:{accepted:e,rejected:[]}}handleFileChange=e=>{const i=e.target.files;if(!i||0===i.length)return;const s=Array.from(i);if(this.multiple){const e=Array.isArray(this.internalValue)?this.internalValue:[],{accepted:i,rejected:t,reason:l}=this.validateFiles(s,e.length);if(this.fileInputRef&&(this.fileInputRef.value=""),null!=l)return void this.reject?.emit({files:t,reason:l});const r=[...e,...i];this.internalValue=r,this.value=r,this.update?.emit(this.value)}else{const{accepted:e,rejected:i,reason:t}=this.validateFiles(s);if(null!=t)return this.reject?.emit({files:i,reason:t}),void(this.fileInputRef&&(this.fileInputRef.value=""));this.internalValue=e[0],this.value=this.internalValue,this.update?.emit(this.value)}};handleClear=e=>{if(this.disabled)return;e.stopPropagation();const i=this.multiple?[]:null;this.value=i,this.internalValue=i,this.update?.emit(i),this.fileInputRef&&(this.fileInputRef.value="")};handleClick=()=>{this.disabled||this.fileInputRef?.click()};hasFiles(){return!this.multiple&&!!this.internalValue&&(!Array.isArray(this.internalValue)||this.internalValue.length>0)}hasChips(){return Array.isArray(this.internalValue)&&this.internalValue.length>0}getDisplayText(){return this.hasFiles()&&this.internalValue?.name||(this.placeholder??"Click to upload")}handleChipRemove=e=>{if(!Array.isArray(this.internalValue))return;const i=[...this.internalValue];i.splice(e,1),this.internalValue=i,this.value=i,this.update?.emit(this.value)};renderChipList(){return this.hasChips()?t("div",{class:"sd-file-picker__chip-list"},this.internalValue.map(((e,i)=>t("sd-chip",{value:e.name,onSdRemove:()=>this.handleChipRemove(i)})))):null}checkOverflow(){this.fileNamesRef&&(this.showTooltip=this.fileNamesRef.scrollWidth>this.fileNamesRef.clientWidth)}getIconColor(){return this.disabled?m.icon.disabled:m.icon.default}render(){const e=this.hasFiles(),i=this.getDisplayText(),s={"--sd-file-picker-font-size":`${k.fontSize}px`,"--sd-file-picker-line-height":`${k.lineHeight}px`,"--sd-file-picker-font-weight":k.fontWeight,"--sd-file-picker-padding-x":`${k.paddingX}px`,"--sd-file-picker-gap":`${k.gap}px`,"--sd-file-picker-text-color":m.text.default,"--sd-file-picker-placeholder-color":m.text.placeholder,"--sd-file-picker-disabled-color":m.text.disabled,"--sd-system-size-field-sm-height":`${k.height}px`,"--sd-system-radius-field-sm":`${k.radius}px`},l=t("div",{role:"button",tabindex:this.disabled?-1:0,class:"sd-file-picker__content",onClick:this.handleClick,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleClick())}},t("input",{ref:e=>this.fileInputRef=e,type:"file",class:"sd-file-picker__input",disabled:this.disabled,multiple:this.multiple,accept:this.accept,onInput:this.handleFileChange,"aria-label":this.placeholder??"Click to upload"}),t("sd-icon",{name:"attachFile",size:Number(k.iconSize),color:this.getIconColor(),class:"sd-file-picker__icon"}),t("div",{ref:e=>this.fileNamesRef=e,class:{"sd-file-picker__text":!0,"sd-file-picker__text--placeholder":!e,"sd-file-picker__text--active":e}},i),!this.disabled&&e&&t("sd-ghost-button",{icon:"close",size:"xxs",ariaLabel:"clear",disabled:this.disabled,class:"sd-file-picker__clear-icon",onClick:this.handleClear}),this.showTooltip&&e&&this.hovered&&t("div",{class:"sd-file-picker__tooltip"},i));return this.inline?t("div",{class:{"sd-file-picker--inline":!0,"sd-file-picker--inline-disabled":this.disabled},style:s,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1},l,this.renderChipList()):t("div",{class:"sd-file-picker__wrapper",style:s},t("sd-field",{name:this.name,label:this.label,labelWidth:this.labelWidth,addonLabel:this.addonLabel,addonAlign:this.addonAlign,hint:this.hint,errorMessage:this.errorMessage,width:this.width,rules:this.rules,error:this.error,disabled:this.disabled,focused:this.focused,hovered:this.hovered,status:this.status,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:e=>this.formField=e,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1},l),this.renderChipList())}static get watchers(){return{value:[{valueChanged:0}]}}static get style(){return"sd-file-picker{display:flex;flex-direction:column;width:100%}.sd-file-picker__wrapper{display:flex;flex-direction:column;width:100%}.sd-file-picker__chip-list{display:flex;flex-direction:column;gap:8px;margin-top:8px}.sd-file-picker__content{width:100%;height:100%;display:flex;align-items:center;padding:0 var(--sd-file-picker-padding-x);gap:var(--sd-file-picker-gap);cursor:pointer;-webkit-user-select:none;user-select:none;position:relative;vertical-align:middle}.sd-file-picker__text{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:var(--sd-file-picker-font-weight);font-size:var(--sd-file-picker-font-size);line-height:var(--sd-file-picker-line-height);color:var(--sd-file-picker-placeholder-color)}.sd-file-picker__text--active{color:var(--sd-file-picker-text-color)}.sd-file-picker__text--placeholder{color:var(--sd-file-picker-placeholder-color)}.sd-file-picker__icon{flex-shrink:0}.sd-file-picker__clear-icon{flex-shrink:0;cursor:pointer;transition:opacity 0.2s ease}.sd-file-picker__clear-icon:hover{opacity:0.7}.sd-file-picker__input{display:none}.sd-file-picker__tooltip{position:absolute;top:calc(100% - 4px);left:50%;transform:translate(-50%);z-index:998;white-space:nowrap;padding:8px 12px;background:rgba(0, 0, 0, 0.8);color:white;font-size:12px;line-height:18px;border-radius:4px;pointer-events:none}.sd-field--disabled .sd-file-picker__content{cursor:not-allowed}.sd-field--disabled .sd-file-picker__text{color:var(--sd-file-picker-disabled-color)}.sd-file-picker--inline .sd-file-picker__content{border:none;background-color:transparent;padding:0;height:auto}.sd-file-picker--inline .sd-file-picker__text{color:var(--sd-file-picker-placeholder-color)}.sd-file-picker--inline:hover:not(.sd-file-picker--inline-disabled) .sd-file-picker__text{color:var(--sd-file-picker-text-color)}.sd-file-picker--inline .sd-file-picker__text--active{color:var(--sd-file-picker-text-color)}.sd-file-picker--inline.sd-file-picker--inline-disabled .sd-file-picker__content{cursor:not-allowed}.sd-file-picker--inline.sd-file-picker--inline-disabled .sd-file-picker__text{color:var(--sd-file-picker-disabled-color)}"}},[512,"sd-file-picker",{value:[1040],placeholder:[513],disabled:[516],inline:[516],multiple:[516],accept:[1],maxFileSize:[8,"max-file-size"],maxTotalSize:[8,"max-total-size"],maxFiles:[8,"max-files"],name:[1],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],addonAlign:[1,"addon-align"],hint:[1],errorMessage:[1,"error-message"],width:[8],rules:[16],error:[1028],status:[1],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],focused:[1028],hovered:[1028],internalValue:[32],showTooltip:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64]},void 0,{value:[{valueChanged:0}]}]);function g(){"undefined"!=typeof customElements&&["sd-file-picker","sd-button","sd-chip","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-tag","sd-tooltip"].forEach((e=>{switch(e){case"sd-file-picker":customElements.get(l(e))||customElements.define(l(e),b);break;case"sd-button":customElements.get(l(e))||o();break;case"sd-chip":customElements.get(l(e))||a();break;case"sd-field":customElements.get(l(e))||d();break;case"sd-floating-portal":customElements.get(l(e))||n();break;case"sd-ghost-button":customElements.get(l(e))||c();break;case"sd-icon":customElements.get(l(e))||h();break;case"sd-tag":customElements.get(l(e))||p();break;case"sd-tooltip":customElements.get(l(e))||f()}}))}export{b as S,g as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,H as s,c as t,h as i,t as c}from"./p-
|
|
1
|
+
import{p as e,H as s,c as t,h as i,t as c}from"./p-Bg9XySrz.js";import{S as a}from"./p-C5wgHjtx.js";import{d as l}from"./p-Cftyepf_.js";const r=e(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.searchFilter=t(this,"sdSearchFilter",7),this.searchFocus=t(this,"sdSearchFocus",7)}isScrolled=!1;searchText="";searchFilter;searchFocus;inputEl;debounceTimer;focusRafId;componentDidLoad(){requestAnimationFrame((()=>{this.focusRafId=requestAnimationFrame((()=>{this.inputEl?.focus()}))}))}async sdFocus(){this.inputEl?.focus()}handleInput=e=>{this.searchText=e.target.value,this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout((()=>{this.searchFilter.emit(this.searchText)}),a)};handleClear=e=>{e.stopPropagation(),this.searchText="",this.debounceTimer&&clearTimeout(this.debounceTimer),this.searchFilter.emit(""),this.inputEl?.focus()};disconnectedCallback(){void 0!==this.focusRafId&&cancelAnimationFrame(this.focusRafId),void 0!==this.debounceTimer&&clearTimeout(this.debounceTimer)}render(){return i("div",{key:"6cf78c7d616dc21a7a6e806c184322d12cacb50d",class:{"sd-select-list-item-search":!0,"sd-select-list-item-search--scrolled":this.isScrolled}},i("div",{key:"dd9fa44fed1f3ec7a222dacaa710cdf32ddbe6fc",class:"sd-select-list-item-search__inner"},i("sd-icon",{key:"2d65a81b7b6160ac4e93016adea0da43d5d01ec8",name:"search",size:16,color:"grey_70",class:"sd-select-list-item-search__icon"}),i("input",{key:"0d5c4bb09778518aa17a210a2d1a9eb620a1dd7b",ref:e=>{this.inputEl=e},type:"text",class:"sd-select-list-item-search__input",placeholder:"검색어 입력",value:this.searchText,onInput:this.handleInput,onFocus:()=>this.searchFocus.emit()}),i("button",{key:"e9708437f310788bf8b9a4d358dea9b83cc88ed8",type:"button",class:{"sd-select-list-item-search__clear":!0,"sd-select-list-item-search__clear--hidden":""===this.searchText},onClick:this.handleClear,tabindex:""!==this.searchText?0:-1,"aria-hidden":""!==this.searchText?"false":"true"},i("sd-icon",{key:"ed8b1c93809f823205f357b059a8b556e0278b1c",name:"close",size:12,color:"#888888"}))))}static get style(){return"sd-select-list-item-search{display:block}sd-select-list-item-search .sd-select-list-item-search{padding:4px 8px;position:sticky;top:0;z-index:1;background:white}sd-select-list-item-search .sd-select-list-item-search--scrolled{box-shadow:0 2px 4px rgba(0, 0, 0, 0.08)}sd-select-list-item-search .sd-select-list-item-search__inner{display:flex;align-items:center;gap:6px;padding:4px 8px;border:1px solid #cccccc;border-radius:4px;background:white}sd-select-list-item-search .sd-select-list-item-search__inner:focus-within{border-color:#0075ff}sd-select-list-item-search .sd-select-list-item-search__icon{flex-shrink:0}sd-select-list-item-search .sd-select-list-item-search__input{flex:1;border:none;outline:none;font-size:12px;line-height:20px;color:#222222;background:transparent;min-width:0}sd-select-list-item-search .sd-select-list-item-search__input::placeholder{color:#aaaaaa}sd-select-list-item-search .sd-select-list-item-search__clear{flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:2px;border:none;background:transparent;cursor:pointer;border-radius:2px}sd-select-list-item-search .sd-select-list-item-search__clear:hover{background:#f0f0f0}sd-select-list-item-search .sd-select-list-item-search__clear--hidden{visibility:hidden;pointer-events:none}"}},[512,"sd-select-list-item-search",{isScrolled:[4,"is-scrolled"],searchText:[32],sdFocus:[64]}]);function d(){"undefined"!=typeof customElements&&["sd-select-list-item-search","sd-icon"].forEach((e=>{switch(e){case"sd-select-list-item-search":customElements.get(c(e))||customElements.define(c(e),r);break;case"sd-icon":customElements.get(c(e))||l()}}))}export{r as S,d}
|