@sellmate/design-system 1.9.0 → 1.10.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 +1 -1
- package/dist/cjs/loader.cjs.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.config-WeoddlTQ.js → sd-button.config-eTAJM2iW.js} +17 -3
- package/dist/cjs/sd-button_2.cjs.entry.js +6 -5
- package/dist/cjs/sd-calendar_2.cjs.entry.js +5 -5
- package/dist/cjs/sd-callout.cjs.entry.js +1 -1
- package/dist/cjs/sd-card.cjs.entry.js +1 -1
- package/dist/cjs/sd-chip-input.cjs.entry.js +274 -0
- package/dist/cjs/sd-chip.cjs.entry.js +14 -84
- package/dist/cjs/sd-chip.config-DiLoRpct.js +71 -0
- package/dist/cjs/sd-circle-progress.cjs.entry.js +1 -1
- package/dist/cjs/sd-confirm-modal_2.cjs.entry.js +3 -3
- package/dist/cjs/sd-date-picker_7.cjs.entry.js +9 -9
- 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 +9 -5
- package/dist/cjs/sd-field_3.cjs.entry.js +9 -8
- package/dist/cjs/sd-ghost-button_2.cjs.entry.js +407 -0
- package/dist/cjs/sd-linear-progress.cjs.entry.js +1 -1
- package/dist/cjs/sd-loading-container.cjs.entry.js +2 -2
- package/dist/cjs/sd-pagination_4.cjs.entry.js +8 -8
- package/dist/cjs/sd-popup.cjs.entry.js +1 -1
- package/dist/cjs/sd-portal.cjs.entry.js +1 -1
- package/dist/cjs/sd-select-list-item_2.cjs.entry.js +6 -6
- package/dist/cjs/sd-select_3.cjs.entry.js +8 -8
- package/dist/cjs/sd-switch.cjs.entry.js +1 -1
- package/dist/cjs/sd-table.cjs.entry.js +6 -6
- package/dist/cjs/sd-tabs.cjs.entry.js +5 -2
- package/dist/cjs/sd-td.cjs.entry.js +1 -1
- package/dist/cjs/sd-toast-container.cjs.entry.js +1 -1
- package/dist/cjs/sd-toast.cjs.entry.js +2 -2
- package/dist/cjs/sd-toggle.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/sd-badge/sd-badge.js +1 -1
- package/dist/collection/components/sd-barcode-input/sd-barcode-input.js +1 -1
- package/dist/collection/components/sd-button/sd-button.config.js +9 -1
- package/dist/collection/components/sd-button/sd-button.css +6 -5
- package/dist/collection/components/sd-button/sd-button.js +5 -4
- package/dist/collection/components/sd-calendar/sd-calendar.js +3 -3
- package/dist/collection/components/sd-callout/sd-callout.js +1 -1
- package/dist/collection/components/sd-card/sd-card.js +1 -1
- package/dist/collection/components/sd-chip/sd-chip.config.js +0 -1
- package/dist/collection/components/sd-chip/sd-chip.css +5 -0
- package/dist/collection/components/sd-chip/sd-chip.js +7 -5
- package/dist/collection/components/sd-chip-input/sd-chip-input.config.js +48 -0
- package/dist/collection/components/sd-chip-input/sd-chip-input.css +92 -0
- package/dist/collection/components/sd-chip-input/sd-chip-input.js +709 -0
- package/dist/collection/components/sd-circle-progress/sd-circle-progress.js +1 -1
- package/dist/collection/components/sd-confirm-modal/sd-confirm-modal.js +2 -2
- package/dist/collection/components/sd-date-picker/sd-date-picker-trigger/sd-date-picker-trigger.js +2 -2
- package/dist/collection/components/sd-date-picker/sd-date-picker.js +2 -2
- package/dist/collection/components/sd-date-range-picker/sd-date-range-picker-calendar/sd-date-range-picker-calendar.js +1 -1
- package/dist/collection/components/sd-divider/sd-divider.js +1 -1
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.config.js +3 -2
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.css +4 -0
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.js +5 -3
- package/dist/collection/components/sd-field/sd-field.js +6 -5
- package/dist/collection/components/sd-floating-portal/sd-floating-portal.js +1 -1
- package/dist/collection/components/sd-ghost-button/sd-ghost-button.css +21 -0
- package/dist/collection/components/sd-ghost-button/sd-ghost-button.js +27 -2
- package/dist/collection/components/sd-input/sd-input.js +2 -2
- package/dist/collection/components/sd-linear-progress/sd-linear-progress.js +1 -1
- package/dist/collection/components/sd-loading-container/sd-loading-container.js +2 -2
- package/dist/collection/components/sd-loading-modal/sd-loading-modal.js +1 -1
- package/dist/collection/components/sd-number-input/sd-number-input.js +4 -4
- package/dist/collection/components/sd-pagination/sd-pagination.js +3 -3
- package/dist/collection/components/sd-popup/sd-popup.js +1 -1
- package/dist/collection/components/sd-portal/sd-portal.js +1 -1
- package/dist/collection/components/sd-select/sd-select-list-item/sd-select-list-item.js +2 -2
- package/dist/collection/components/sd-select/sd-select-list-item-search/sd-select-list-item-search.js +4 -4
- package/dist/collection/components/sd-select/sd-select-listbox/sd-select-listbox.js +2 -2
- package/dist/collection/components/sd-select/sd-select-trigger/sd-select-trigger.js +2 -2
- package/dist/collection/components/sd-select/sd-select.js +4 -4
- package/dist/collection/components/sd-switch/sd-switch.js +1 -1
- package/dist/collection/components/sd-table/sd-table.js +6 -6
- package/dist/collection/components/sd-table/sd-tbody/sd-tbody.js +2 -2
- package/dist/collection/components/sd-table/sd-td/sd-td.js +1 -1
- package/dist/collection/components/sd-table/sd-thead/sd-thead.js +3 -3
- package/dist/collection/components/sd-tabs/sd-tabs.css +27 -0
- package/dist/collection/components/sd-tabs/sd-tabs.js +24 -1
- package/dist/collection/components/sd-tag/sd-tag.js +2 -2
- package/dist/collection/components/sd-textarea/sd-textarea.js +1 -1
- package/dist/collection/components/sd-toast/sd-toast.js +2 -2
- package/dist/collection/components/sd-toast-container/sd-toast-container.js +1 -1
- package/dist/collection/components/sd-toggle/sd-toggle.js +1 -1
- package/dist/collection/components/sd-tooltip/sd-tooltip.js +2 -2
- package/dist/components/{p-CnCH_nnG.js → p-0KaFFbD8.js} +1 -1
- package/dist/components/{p-B3vmDhWb.js → p-4XivETkt.js} +1 -1
- package/dist/components/p-AmkZCF9y.js +1 -0
- package/dist/components/p-BA8i1i5_.js +1 -0
- package/dist/components/{p-7TYtYYrb.js → p-BcsFHQH8.js} +1 -1
- package/dist/components/{p-C_RL1gZR.js → p-BnaD56dI.js} +1 -1
- package/dist/components/p-Bq9q5LoZ.js +1 -0
- package/dist/components/p-BwUUaGFU.js +1 -0
- package/dist/components/{p-C2LhOf89.js → p-CJdrq8cV.js} +1 -1
- package/dist/components/{p-Due8URWT.js → p-CJr5BdNN.js} +1 -1
- package/dist/components/p-CWlwx4xx.js +1 -0
- package/dist/components/p-CWz_dfBG.js +1 -0
- package/dist/components/{p-PDLDFsH7.js → p-CjVOfLam.js} +1 -1
- package/dist/components/{p-BaOCZ7B6.js → p-Ck9bJZTm.js} +1 -1
- package/dist/components/{p-BS1cT5dG.js → p-CkQzw2e0.js} +1 -1
- package/dist/components/p-CqvS2J1B.js +1 -0
- package/dist/components/p-CyGi6aGo.js +1 -0
- package/dist/components/p-Cz9ralVS.js +1 -0
- package/dist/components/{p-C8MKSPNX.js → p-D4TisqIF.js} +1 -1
- package/dist/components/{p-B5XCkCeg.js → p-D5O7fZYw.js} +1 -1
- package/dist/components/{p-BDUIw6As.js → p-DApxX0af.js} +1 -1
- package/dist/components/p-DR0N8_Vt.js +1 -0
- package/dist/components/p-DUhqd8c7.js +1 -0
- package/dist/components/{p-DLNwV8Wa.js → p-DmbwfZF7.js} +1 -1
- package/dist/components/p-Dp6NByuZ.js +1 -0
- package/dist/components/{p-CwUPCrDk.js → p-Dt9-l05k.js} +1 -1
- package/dist/components/{p-J57vnHhu.js → p-DwU-e9i1.js} +1 -1
- package/dist/components/{p-BnJJAhY6.js → p-Dwl1u73P.js} +1 -1
- package/dist/components/{p-yTY5CmAx.js → p-NaAHdFVI.js} +1 -1
- package/dist/components/{p-B8Z5qc_1.js → p-jtJFHONo.js} +1 -1
- 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-chip-input.d.ts +11 -0
- package/dist/components/sd-chip-input.js +1 -0
- 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-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-ghost-button.js +1 -1
- package/dist/components/sd-guide.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-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-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/design-system/design-system.esm.js +1 -1
- package/dist/design-system/{p-6716691b.entry.js → p-0ac4d17b.entry.js} +1 -1
- package/dist/design-system/{p-19d47ac2.entry.js → p-12c1ddfc.entry.js} +1 -1
- package/dist/design-system/{p-8926c5ec.entry.js → p-15518cf5.entry.js} +1 -1
- package/dist/design-system/{p-de743615.entry.js → p-20ebfd9e.entry.js} +1 -1
- package/dist/design-system/{p-11e99ac5.entry.js → p-24cb3aef.entry.js} +1 -1
- package/dist/design-system/p-2f53e2f9.entry.js +1 -0
- package/dist/design-system/{p-3eb72b33.entry.js → p-36b8f224.entry.js} +1 -1
- package/dist/design-system/{p-86db28ce.entry.js → p-3bd59260.entry.js} +1 -1
- package/dist/design-system/p-4fd59127.entry.js +1 -0
- package/dist/design-system/{p-95cce55d.entry.js → p-5b2dd552.entry.js} +1 -1
- package/dist/design-system/p-5deefcbc.entry.js +1 -0
- package/dist/design-system/{p-e1ef1eb8.entry.js → p-6ebd85ae.entry.js} +1 -1
- package/dist/design-system/p-798c0f9b.entry.js +1 -0
- package/dist/design-system/p-7ca9a6c9.entry.js +1 -0
- package/dist/design-system/{p-5b7ea330.entry.js → p-9f899376.entry.js} +1 -1
- package/dist/design-system/p-9ff473b2.entry.js +1 -0
- package/dist/design-system/p-DDj5KTBF.js +1 -0
- package/dist/design-system/p-DjcjlPt7.js +1 -0
- package/dist/design-system/p-a1f248ed.entry.js +1 -0
- package/dist/design-system/{p-1dd139cb.entry.js → p-a9892cbe.entry.js} +1 -1
- package/dist/design-system/{p-39a2bf05.entry.js → p-acaaf137.entry.js} +1 -1
- package/dist/design-system/{p-06344171.entry.js → p-b1d1f1d3.entry.js} +1 -1
- package/dist/design-system/{p-4ca63a2d.entry.js → p-b495f26c.entry.js} +1 -1
- package/dist/design-system/{p-362ac234.entry.js → p-b63c672a.entry.js} +1 -1
- package/dist/design-system/{p-b3b46576.entry.js → p-bbae006c.entry.js} +1 -1
- package/dist/design-system/p-bbb51afa.entry.js +1 -0
- package/dist/design-system/p-d40ffa84.entry.js +1 -0
- package/dist/design-system/{p-acfe5585.entry.js → p-e4944ae6.entry.js} +1 -1
- package/dist/design-system/{p-a0607a9f.entry.js → p-e5f1156c.entry.js} +1 -1
- package/dist/design-system/p-f462bc54.entry.js +1 -0
- package/dist/design-system/{p-21f654e3.entry.js → p-f8b6b169.entry.js} +1 -1
- package/dist/design-system/{p-a0daadc8.entry.js → p-fcd3961f.entry.js} +1 -1
- package/dist/esm/design-system.js +1 -1
- package/dist/esm/loader.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.config-CdRvJ-Uc.js → sd-button.config-DjcjlPt7.js} +16 -3
- package/dist/esm/sd-button_2.entry.js +6 -5
- package/dist/esm/sd-calendar_2.entry.js +5 -5
- package/dist/esm/sd-callout.entry.js +1 -1
- package/dist/esm/sd-card.entry.js +1 -1
- package/dist/esm/sd-chip-input.entry.js +272 -0
- package/dist/esm/sd-chip.config-DDj5KTBF.js +67 -0
- package/dist/esm/sd-chip.entry.js +9 -79
- package/dist/esm/sd-circle-progress.entry.js +1 -1
- package/dist/esm/sd-confirm-modal_2.entry.js +3 -3
- package/dist/esm/sd-date-picker_7.entry.js +9 -9
- 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 +9 -5
- package/dist/esm/sd-field_3.entry.js +9 -8
- package/dist/esm/sd-ghost-button_2.entry.js +404 -0
- package/dist/esm/sd-linear-progress.entry.js +1 -1
- package/dist/esm/sd-loading-container.entry.js +2 -2
- package/dist/esm/sd-pagination_4.entry.js +8 -8
- package/dist/esm/sd-popup.entry.js +1 -1
- package/dist/esm/sd-portal.entry.js +1 -1
- package/dist/esm/sd-select-list-item_2.entry.js +6 -6
- package/dist/esm/sd-select_3.entry.js +8 -8
- package/dist/esm/sd-switch.entry.js +1 -1
- package/dist/esm/sd-table.entry.js +6 -6
- package/dist/esm/sd-tabs.entry.js +5 -2
- package/dist/esm/sd-td.entry.js +1 -1
- package/dist/esm/sd-toast-container.entry.js +1 -1
- package/dist/esm/sd-toast.entry.js +2 -2
- package/dist/esm/sd-toggle.entry.js +1 -1
- package/dist/types/components/sd-button/sd-button.config.d.ts +10 -2
- package/dist/types/components/sd-chip/sd-chip.config.d.ts +0 -1
- package/dist/types/components/sd-chip-input/sd-chip-input.config.d.ts +34 -0
- package/dist/types/components/sd-chip-input/sd-chip-input.d.ts +53 -0
- package/dist/types/components/sd-dropdown-button/sd-dropdown-button.config.d.ts +9 -1
- package/dist/types/components/sd-ghost-button/sd-ghost-button.d.ts +1 -0
- package/dist/types/components/sd-tabs/sd-tabs.d.ts +1 -0
- package/dist/types/components.d.ts +210 -0
- package/hydrate/index.js +449 -121
- package/hydrate/index.mjs +449 -121
- package/package.json +1 -1
- package/dist/cjs/sd-ghost-button.cjs.entry.js +0 -179
- package/dist/cjs/sd-tag.cjs.entry.js +0 -227
- package/dist/components/p-B8QZRiYH.js +0 -1
- package/dist/components/p-BYgOJUk0.js +0 -1
- package/dist/components/p-BmmIQQlT.js +0 -1
- package/dist/components/p-CMUpMkva.js +0 -1
- package/dist/components/p-CeoBnd3w.js +0 -1
- package/dist/components/p-CpdFMy8s.js +0 -1
- package/dist/components/p-CqcGVHzJ.js +0 -1
- package/dist/components/p-CtxH9xQc.js +0 -1
- package/dist/components/p-DEfG8t7h.js +0 -1
- package/dist/components/p-DGCbSjhn.js +0 -1
- package/dist/components/p-DLeITJ-j.js +0 -1
- package/dist/components/p-DqXt80Qn.js +0 -1
- package/dist/design-system/p-0a225a4a.entry.js +0 -1
- package/dist/design-system/p-17d8457d.entry.js +0 -1
- package/dist/design-system/p-2bd09b2f.entry.js +0 -1
- package/dist/design-system/p-515e837b.entry.js +0 -1
- package/dist/design-system/p-5ee1e5e6.entry.js +0 -1
- package/dist/design-system/p-79e73305.entry.js +0 -1
- package/dist/design-system/p-97b16b63.entry.js +0 -1
- package/dist/design-system/p-CdRvJ-Uc.js +0 -1
- package/dist/design-system/p-a39016ac.entry.js +0 -1
- package/dist/design-system/p-d9c1ec16.entry.js +0 -1
- package/dist/design-system/p-de565b9f.entry.js +0 -1
- package/dist/esm/sd-ghost-button.entry.js +0 -177
- package/dist/esm/sd-tag.entry.js +0 -225
package/package.json
CHANGED
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-C63F8C0_.js');
|
|
4
|
-
|
|
5
|
-
const ghostButton = {
|
|
6
|
-
xxs: {
|
|
7
|
-
size: "16",
|
|
8
|
-
icon: "12"
|
|
9
|
-
},
|
|
10
|
-
xs: {
|
|
11
|
-
size: "24",
|
|
12
|
-
icon: "16"
|
|
13
|
-
},
|
|
14
|
-
sm: {
|
|
15
|
-
size: "28",
|
|
16
|
-
icon: "20"
|
|
17
|
-
},
|
|
18
|
-
md: {
|
|
19
|
-
size: "36",
|
|
20
|
-
icon: "24"
|
|
21
|
-
},
|
|
22
|
-
lg: {
|
|
23
|
-
size: "62",
|
|
24
|
-
icon: "32"
|
|
25
|
-
},
|
|
26
|
-
radius: {
|
|
27
|
-
sm: "4",
|
|
28
|
-
md: "6"
|
|
29
|
-
},
|
|
30
|
-
hover: {
|
|
31
|
-
opacity: "5%"
|
|
32
|
-
},
|
|
33
|
-
icon: {
|
|
34
|
-
disabled: "#BBBBBB"
|
|
35
|
-
},
|
|
36
|
-
"default": {
|
|
37
|
-
content: "#888888",
|
|
38
|
-
hover: {
|
|
39
|
-
bg: "#222222"
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
danger: {
|
|
43
|
-
content: "#E30000",
|
|
44
|
-
hover: {
|
|
45
|
-
bg: "#E30000"
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
action: {
|
|
49
|
-
content: "#025497",
|
|
50
|
-
hover: {
|
|
51
|
-
bg: "#0075FF"
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
inverse: {
|
|
55
|
-
content: "#FFFFFF",
|
|
56
|
-
disabled: "#E1E1E1",
|
|
57
|
-
hover: {
|
|
58
|
-
bg: "#FFFFFF"
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
var ghostButtonTokens = {
|
|
63
|
-
ghostButton: ghostButton
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const GHOST_BUTTON_FOCUS_RING_COLOR = '#0075FF';
|
|
67
|
-
const GHOST_BUTTON_SIZES = {
|
|
68
|
-
xxs: {
|
|
69
|
-
size: Number(ghostButtonTokens.ghostButton.xxs.size),
|
|
70
|
-
icon: Number(ghostButtonTokens.ghostButton.xxs.icon),
|
|
71
|
-
},
|
|
72
|
-
xs: {
|
|
73
|
-
size: Number(ghostButtonTokens.ghostButton.xs.size),
|
|
74
|
-
icon: Number(ghostButtonTokens.ghostButton.xs.icon),
|
|
75
|
-
},
|
|
76
|
-
sm: {
|
|
77
|
-
size: Number(ghostButtonTokens.ghostButton.sm.size),
|
|
78
|
-
icon: Number(ghostButtonTokens.ghostButton.sm.icon),
|
|
79
|
-
},
|
|
80
|
-
md: {
|
|
81
|
-
size: Number(ghostButtonTokens.ghostButton.md.size),
|
|
82
|
-
icon: Number(ghostButtonTokens.ghostButton.md.icon),
|
|
83
|
-
},
|
|
84
|
-
lg: {
|
|
85
|
-
size: Number(ghostButtonTokens.ghostButton.lg.size),
|
|
86
|
-
icon: Number(ghostButtonTokens.ghostButton.lg.icon),
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
const GHOST_BUTTON_RADIUS = {
|
|
90
|
-
xxs: Number(ghostButtonTokens.ghostButton.radius.sm),
|
|
91
|
-
xs: Number(ghostButtonTokens.ghostButton.radius.sm),
|
|
92
|
-
sm: Number(ghostButtonTokens.ghostButton.radius.sm),
|
|
93
|
-
md: Number(ghostButtonTokens.ghostButton.radius.md),
|
|
94
|
-
lg: Number(ghostButtonTokens.ghostButton.radius.md),
|
|
95
|
-
};
|
|
96
|
-
const GHOST_BUTTON_HOVER_OPACITY = ghostButtonTokens.ghostButton.hover.opacity;
|
|
97
|
-
const GHOST_BUTTON_CONTENT_COLORS = {
|
|
98
|
-
default: ghostButtonTokens.ghostButton.default.content,
|
|
99
|
-
danger: ghostButtonTokens.ghostButton.danger.content,
|
|
100
|
-
action: ghostButtonTokens.ghostButton.action.content,
|
|
101
|
-
inverse: ghostButtonTokens.ghostButton.inverse.content,
|
|
102
|
-
};
|
|
103
|
-
const GHOST_BUTTON_HOVER_BG_COLORS = {
|
|
104
|
-
default: ghostButtonTokens.ghostButton.default.hover.bg,
|
|
105
|
-
danger: ghostButtonTokens.ghostButton.danger.hover.bg,
|
|
106
|
-
action: ghostButtonTokens.ghostButton.action.hover.bg,
|
|
107
|
-
inverse: ghostButtonTokens.ghostButton.inverse.hover.bg,
|
|
108
|
-
};
|
|
109
|
-
const GHOST_BUTTON_DISABLED_ICON = ghostButtonTokens.ghostButton.icon.disabled;
|
|
110
|
-
const GHOST_BUTTON_DISABLED_COLORS = {
|
|
111
|
-
default: GHOST_BUTTON_DISABLED_ICON,
|
|
112
|
-
danger: GHOST_BUTTON_DISABLED_ICON,
|
|
113
|
-
action: GHOST_BUTTON_DISABLED_ICON,
|
|
114
|
-
inverse: ghostButtonTokens.ghostButton.inverse.disabled,
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
const sdGhostButtonCss = () => `sd-ghost-button{display:inline-flex;width:fit-content;height:fit-content}.sd-ghost-button{position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--sd-ghost-button-size);height:var(--sd-ghost-button-size);padding:0;border:none;border-radius:var(--sd-ghost-button-radius);background:transparent;cursor:pointer;box-sizing:border-box;transition:box-shadow 0.2s ease;-webkit-user-select:none;user-select:none}.sd-ghost-button::before{content:"";position:absolute;inset:0;border-radius:inherit;background:var(--sd-ghost-button-hover-bg);opacity:0;transition:opacity 0.2s ease;pointer-events:none}.sd-ghost-button:hover:not(.sd-ghost-button--disabled)::before{opacity:var(--sd-ghost-button-hover-opacity)}.sd-ghost-button:focus-visible{outline:0;box-shadow:0 0 0 2px var(--sd-ghost-button-accent)}.sd-ghost-button--disabled{cursor:not-allowed}`;
|
|
118
|
-
|
|
119
|
-
const SdGhostButton = class {
|
|
120
|
-
constructor(hostRef) {
|
|
121
|
-
index.registerInstance(this, hostRef);
|
|
122
|
-
this.click = index.createEvent(this, "sdClick", 7);
|
|
123
|
-
}
|
|
124
|
-
icon;
|
|
125
|
-
size = 'sm';
|
|
126
|
-
intent = 'default';
|
|
127
|
-
ariaLabel = '';
|
|
128
|
-
disabled = false;
|
|
129
|
-
click;
|
|
130
|
-
hasWarnedMissingAriaLabel = false;
|
|
131
|
-
componentWillLoad() {
|
|
132
|
-
this.size ??= 'sm';
|
|
133
|
-
this.intent ??= 'default';
|
|
134
|
-
this.ariaLabel ??= '';
|
|
135
|
-
}
|
|
136
|
-
handleClick = (event) => {
|
|
137
|
-
if (this.disabled) {
|
|
138
|
-
event.preventDefault();
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
this.click.emit(event);
|
|
142
|
-
};
|
|
143
|
-
componentWillRender() {
|
|
144
|
-
this.warnIfMissingAriaLabel();
|
|
145
|
-
}
|
|
146
|
-
warnIfMissingAriaLabel() {
|
|
147
|
-
const missing = (this.ariaLabel ?? '').trim() === '';
|
|
148
|
-
if (!missing) {
|
|
149
|
-
this.hasWarnedMissingAriaLabel = false;
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
if (this.hasWarnedMissingAriaLabel)
|
|
153
|
-
return;
|
|
154
|
-
console.warn(`[sd-ghost-button] icon-only buttons require \`ariaLabel\`. Received icon="${this.icon}".`);
|
|
155
|
-
this.hasWarnedMissingAriaLabel = true;
|
|
156
|
-
}
|
|
157
|
-
render() {
|
|
158
|
-
const size = this.size ?? 'sm';
|
|
159
|
-
const intent = this.intent ?? 'default';
|
|
160
|
-
const sizeConfig = GHOST_BUTTON_SIZES[size] ?? GHOST_BUTTON_SIZES.sm;
|
|
161
|
-
const contentColor = this.disabled
|
|
162
|
-
? GHOST_BUTTON_DISABLED_COLORS[intent]
|
|
163
|
-
: GHOST_BUTTON_CONTENT_COLORS[intent];
|
|
164
|
-
const accessibleName = (this.ariaLabel ?? '').trim() || undefined;
|
|
165
|
-
return (index.h("button", { key: '7bf9f8b8d487be0b66a969668308fd451faeb442', class: {
|
|
166
|
-
'sd-ghost-button': true,
|
|
167
|
-
'sd-ghost-button--disabled': this.disabled,
|
|
168
|
-
}, type: "button", disabled: this.disabled, "aria-label": accessibleName, style: {
|
|
169
|
-
'--sd-ghost-button-size': `${sizeConfig.size}px`,
|
|
170
|
-
'--sd-ghost-button-radius': `${GHOST_BUTTON_RADIUS[size]}px`,
|
|
171
|
-
'--sd-ghost-button-hover-bg': GHOST_BUTTON_HOVER_BG_COLORS[intent],
|
|
172
|
-
'--sd-ghost-button-hover-opacity': GHOST_BUTTON_HOVER_OPACITY,
|
|
173
|
-
'--sd-ghost-button-accent': GHOST_BUTTON_FOCUS_RING_COLOR,
|
|
174
|
-
}, onClick: this.handleClick }, index.h("sd-icon", { key: '4b6b05d186f8c38d2f05415fa24960349dd6c453', name: this.icon, size: sizeConfig.icon, color: contentColor })));
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
SdGhostButton.style = sdGhostButtonCss();
|
|
178
|
-
|
|
179
|
-
exports.sd_ghost_button = SdGhostButton;
|
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-C63F8C0_.js');
|
|
4
|
-
|
|
5
|
-
const tag = {
|
|
6
|
-
xs: {
|
|
7
|
-
height: "20",
|
|
8
|
-
paddingX: "8",
|
|
9
|
-
gap: "4",
|
|
10
|
-
typography: {
|
|
11
|
-
fontSize: "11",
|
|
12
|
-
fontWeight: "500",
|
|
13
|
-
lineHeight: "18"},
|
|
14
|
-
radius: "6"
|
|
15
|
-
},
|
|
16
|
-
sm: {
|
|
17
|
-
height: "24",
|
|
18
|
-
paddingX: "8",
|
|
19
|
-
gap: "4",
|
|
20
|
-
typography: {
|
|
21
|
-
fontSize: "12",
|
|
22
|
-
fontWeight: "700",
|
|
23
|
-
lineHeight: "20"
|
|
24
|
-
},
|
|
25
|
-
radius: "6"
|
|
26
|
-
},
|
|
27
|
-
md: {
|
|
28
|
-
height: "28",
|
|
29
|
-
paddingX: "12",
|
|
30
|
-
gap: "6",
|
|
31
|
-
typography: {
|
|
32
|
-
fontSize: "14",
|
|
33
|
-
fontWeight: "700",
|
|
34
|
-
lineHeight: "24"},
|
|
35
|
-
radius: "8"
|
|
36
|
-
},
|
|
37
|
-
red: {
|
|
38
|
-
content: "#FB4444",
|
|
39
|
-
bg: "#FCEFEF"
|
|
40
|
-
},
|
|
41
|
-
orange: {
|
|
42
|
-
content: "#FF6B00",
|
|
43
|
-
bg: "#FEF1EA"
|
|
44
|
-
},
|
|
45
|
-
yellow: {
|
|
46
|
-
content: "#916C0D",
|
|
47
|
-
bg: "#FFF7DD"
|
|
48
|
-
},
|
|
49
|
-
green: {
|
|
50
|
-
content: "#00973C",
|
|
51
|
-
bg: "#E8F9EF"
|
|
52
|
-
},
|
|
53
|
-
blue: {
|
|
54
|
-
content: "#0075FF",
|
|
55
|
-
bg: "#E6F1FF"
|
|
56
|
-
},
|
|
57
|
-
darkblue: {
|
|
58
|
-
content: "#006AC1",
|
|
59
|
-
bg: "#EAF5FE"
|
|
60
|
-
},
|
|
61
|
-
indigo: {
|
|
62
|
-
content: "#004290",
|
|
63
|
-
bg: "#EFF6FF"
|
|
64
|
-
},
|
|
65
|
-
grey: {
|
|
66
|
-
content: "#737373",
|
|
67
|
-
bg: "#EEEEEE"
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
var tagTokens = {
|
|
71
|
-
tag: tag
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const TAG_SHAPES = ['square', 'pill'];
|
|
75
|
-
const TAG_SIZES = ['xs', 'sm', 'md'];
|
|
76
|
-
const TAG_COLORS = [
|
|
77
|
-
'grey',
|
|
78
|
-
'red',
|
|
79
|
-
'orange',
|
|
80
|
-
'yellow',
|
|
81
|
-
'green',
|
|
82
|
-
'blue',
|
|
83
|
-
'darkblue',
|
|
84
|
-
'indigo',
|
|
85
|
-
];
|
|
86
|
-
const TAG_COLOR_CONFIG = {
|
|
87
|
-
grey: {
|
|
88
|
-
background: tagTokens.tag.grey.bg,
|
|
89
|
-
content: tagTokens.tag.grey.content,
|
|
90
|
-
icon: tagTokens.tag.grey.content,
|
|
91
|
-
},
|
|
92
|
-
red: {
|
|
93
|
-
background: tagTokens.tag.red.bg,
|
|
94
|
-
content: tagTokens.tag.red.content,
|
|
95
|
-
icon: tagTokens.tag.red.content,
|
|
96
|
-
},
|
|
97
|
-
orange: {
|
|
98
|
-
background: tagTokens.tag.orange.bg,
|
|
99
|
-
content: tagTokens.tag.orange.content,
|
|
100
|
-
icon: tagTokens.tag.orange.content,
|
|
101
|
-
},
|
|
102
|
-
yellow: {
|
|
103
|
-
background: tagTokens.tag.yellow.bg,
|
|
104
|
-
content: tagTokens.tag.yellow.content,
|
|
105
|
-
icon: tagTokens.tag.yellow.content,
|
|
106
|
-
},
|
|
107
|
-
green: {
|
|
108
|
-
background: tagTokens.tag.green.bg,
|
|
109
|
-
content: tagTokens.tag.green.content,
|
|
110
|
-
icon: tagTokens.tag.green.content,
|
|
111
|
-
},
|
|
112
|
-
blue: {
|
|
113
|
-
background: tagTokens.tag.blue.bg,
|
|
114
|
-
content: tagTokens.tag.blue.content,
|
|
115
|
-
icon: tagTokens.tag.blue.content,
|
|
116
|
-
},
|
|
117
|
-
darkblue: {
|
|
118
|
-
background: tagTokens.tag.darkblue.bg,
|
|
119
|
-
content: tagTokens.tag.darkblue.content,
|
|
120
|
-
icon: tagTokens.tag.darkblue.content,
|
|
121
|
-
},
|
|
122
|
-
indigo: {
|
|
123
|
-
background: tagTokens.tag.indigo.bg,
|
|
124
|
-
content: tagTokens.tag.indigo.content,
|
|
125
|
-
icon: tagTokens.tag.indigo.content,
|
|
126
|
-
},
|
|
127
|
-
};
|
|
128
|
-
const SQUARE_SIZE_CONFIG = {
|
|
129
|
-
xs: {
|
|
130
|
-
height: `${tagTokens.tag.xs.height}px`,
|
|
131
|
-
paddingX: `${tagTokens.tag.xs.paddingX}px`,
|
|
132
|
-
gap: `${tagTokens.tag.xs.gap}px`,
|
|
133
|
-
fontSize: `${tagTokens.tag.xs.typography.fontSize}px`,
|
|
134
|
-
fontWeight: tagTokens.tag.xs.typography.fontWeight,
|
|
135
|
-
lineHeight: `${tagTokens.tag.xs.typography.lineHeight}px`,
|
|
136
|
-
iconSize: 12,
|
|
137
|
-
radius: `${tagTokens.tag.xs.radius}px`,
|
|
138
|
-
},
|
|
139
|
-
sm: {
|
|
140
|
-
height: `${tagTokens.tag.sm.height}px`,
|
|
141
|
-
paddingX: `${tagTokens.tag.sm.paddingX}px`,
|
|
142
|
-
gap: `${tagTokens.tag.sm.gap}px`,
|
|
143
|
-
fontSize: `${tagTokens.tag.sm.typography.fontSize}px`,
|
|
144
|
-
fontWeight: tagTokens.tag.sm.typography.fontWeight,
|
|
145
|
-
lineHeight: `${tagTokens.tag.sm.typography.lineHeight}px`,
|
|
146
|
-
iconSize: 16,
|
|
147
|
-
radius: `${tagTokens.tag.sm.radius}px`,
|
|
148
|
-
},
|
|
149
|
-
md: {
|
|
150
|
-
height: `${tagTokens.tag.md.height}px`,
|
|
151
|
-
paddingX: `${tagTokens.tag.md.paddingX}px`,
|
|
152
|
-
gap: `${tagTokens.tag.md.gap}px`,
|
|
153
|
-
fontSize: `${tagTokens.tag.md.typography.fontSize}px`,
|
|
154
|
-
fontWeight: tagTokens.tag.md.typography.fontWeight,
|
|
155
|
-
lineHeight: `${tagTokens.tag.md.typography.lineHeight}px`,
|
|
156
|
-
iconSize: 16,
|
|
157
|
-
radius: `${tagTokens.tag.md.radius}px`,
|
|
158
|
-
},
|
|
159
|
-
};
|
|
160
|
-
const PILL_SIZE_CONFIG = {
|
|
161
|
-
xs: { ...SQUARE_SIZE_CONFIG.xs, radius: '999px' },
|
|
162
|
-
sm: { ...SQUARE_SIZE_CONFIG.sm, radius: '999px' },
|
|
163
|
-
md: { ...SQUARE_SIZE_CONFIG.md, radius: '999px' },
|
|
164
|
-
};
|
|
165
|
-
const TAG_CONFIG = Object.fromEntries(TAG_SHAPES.flatMap(shape => TAG_SIZES.flatMap(size => TAG_COLORS.map(color => {
|
|
166
|
-
const sizeConfig = shape === 'square' ? SQUARE_SIZE_CONFIG[size] : PILL_SIZE_CONFIG[size];
|
|
167
|
-
return [
|
|
168
|
-
`${shape}_${size}_${color}`,
|
|
169
|
-
{
|
|
170
|
-
shape,
|
|
171
|
-
size,
|
|
172
|
-
color,
|
|
173
|
-
...sizeConfig,
|
|
174
|
-
...TAG_COLOR_CONFIG[color],
|
|
175
|
-
},
|
|
176
|
-
];
|
|
177
|
-
}))));
|
|
178
|
-
const isTagName = (value) => Object.prototype.hasOwnProperty.call(TAG_CONFIG, value);
|
|
179
|
-
|
|
180
|
-
const sdTagCss = () => `sd-tag{display:inline-flex;width:fit-content;height:fit-content}.sd-tag{display:inline-flex;align-items:center;justify-content:center;gap:var(--sd-tag-gap, 5px);min-height:var(--sd-tag-height, 24px);padding:0 var(--sd-tag-padding-x, 8px);border-radius:var(--sd-tag-radius, 4px);background:var(--sd-tag-background, #f3f3f3);color:var(--sd-tag-content, #7a7a7a);box-sizing:border-box;white-space:nowrap;-webkit-user-select:none;user-select:none}.sd-tag__icon{display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center}.sd-tag__label{display:inline-flex;align-items:center;justify-content:center;min-width:0;font-size:var(--sd-tag-font-size, 12px);font-weight:var(--sd-tag-font-weight, 700);line-height:var(--sd-tag-line-height, 20px)}`;
|
|
181
|
-
|
|
182
|
-
const SdTag = class {
|
|
183
|
-
constructor(hostRef) {
|
|
184
|
-
index.registerInstance(this, hostRef);
|
|
185
|
-
}
|
|
186
|
-
name = 'square_sm_grey';
|
|
187
|
-
label = '';
|
|
188
|
-
icon;
|
|
189
|
-
// 아이콘이 좌측 배치되는 게 자연스러운 default. prop 이름 변경(isRight 등)은 public API breaking 이라 별도 이슈로 분리.
|
|
190
|
-
// eslint-disable-next-line stencil/ban-default-true
|
|
191
|
-
isLeft = true;
|
|
192
|
-
componentWillLoad() {
|
|
193
|
-
this.name = this.name ?? 'square_sm_grey';
|
|
194
|
-
}
|
|
195
|
-
get resolvedName() {
|
|
196
|
-
if (!isTagName(this.name)) {
|
|
197
|
-
throw new Error(`Invalid sd-tag name: "${this.name}"`);
|
|
198
|
-
}
|
|
199
|
-
return this.name;
|
|
200
|
-
}
|
|
201
|
-
get resolvedConfig() {
|
|
202
|
-
return TAG_CONFIG[this.resolvedName];
|
|
203
|
-
}
|
|
204
|
-
renderIcon(color, size) {
|
|
205
|
-
if (this.icon == null)
|
|
206
|
-
return null;
|
|
207
|
-
return index.h("sd-icon", { class: "sd-tag__icon", name: this.icon, size: size, color: color });
|
|
208
|
-
}
|
|
209
|
-
render() {
|
|
210
|
-
const config = this.resolvedConfig;
|
|
211
|
-
const iconNode = this.renderIcon(config.icon, config.iconSize);
|
|
212
|
-
return (index.h("span", { key: '945a8a13f4891b5174e48e262b2a108674da7198', class: "sd-tag", style: {
|
|
213
|
-
'--sd-tag-background': config.background,
|
|
214
|
-
'--sd-tag-content': config.content,
|
|
215
|
-
'--sd-tag-height': config.height,
|
|
216
|
-
'--sd-tag-padding-x': config.paddingX,
|
|
217
|
-
'--sd-tag-gap': config.gap,
|
|
218
|
-
'--sd-tag-font-size': config.fontSize,
|
|
219
|
-
'--sd-tag-font-weight': config.fontWeight,
|
|
220
|
-
'--sd-tag-line-height': config.lineHeight,
|
|
221
|
-
'--sd-tag-radius': config.radius,
|
|
222
|
-
}, "aria-label": this.label || 'tag' }, this.icon && this.isLeft && iconNode, index.h("span", { key: '441932c2eb85eea471838db541fb95302527df23', class: "sd-tag__label" }, this.label), this.icon && !this.isLeft && iconNode));
|
|
223
|
-
}
|
|
224
|
-
};
|
|
225
|
-
SdTag.style = sdTagCss();
|
|
226
|
-
|
|
227
|
-
exports.sd_tag = SdTag;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as t,H as s,c as e,h as a,t as o}from"./p-siTDlOb6.js";import{d as n}from"./p-DqXt80Qn.js";import{d as i}from"./p-CtxH9xQc.js";import{d}from"./p-BNkExhYB.js";var c={bg:"#07284A",content:"#FFFFFF"},l={bg:"#FB4444",content:"#FFFFFF"},r={bg:"#FFC700",content:"#222222"},b={bg:"#00973C",content:"#FFFFFF"},u={bg:"#005CC9",content:"#FFFFFF"},p={bg:"#E6F1FF",icon:"#0075FF",text:"#222222",textLink:"#555555"};const f={default:"secondary_sm",danger:"danger_outline_sm",caution:"neutral_outline_sm",complete:"neutral_outline_sm",accent:"neutral_outline_sm",info:"secondary_sm"},h={default:{bg:c.bg,content:c.content},danger:{bg:l.bg,content:l.content},caution:{bg:r.bg,content:r.content},complete:{bg:b.bg,content:b.content},accent:{bg:u.bg,content:u.content},info:{bg:p.bg,content:p.text,icon:p.icon,linkColor:p.textLink}},g={iconSize:"16"},m=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.close=e(this,"sdClose",7),this.buttonClick=e(this,"sdButtonClick",7)}icon;message;link;linkLabel;buttonLabel;useClose=!1;type="default";close;buttonClick;render(){const t=h[this.type]??h.default,s=Number(g.iconSize),e=t.icon??t.content,o=t.linkColor??t.content,n=["default","caution","info"].includes(this.type),i=f[this.type]??f.default;return a("div",{key:"0073ea37731ad1d8a54cb45f0eee8103159cbd65",style:{"--sd-toast-bg":t.bg,"--sd-toast-text":t.content,"--sd-toast-icon":e,"--sd-toast-link":o}},a("div",{key:"e14f7d2d5e15630989c4cb19ed375a704a8a783a",class:"sd-toast",role:"status","aria-live":"polite","aria-atomic":"true"},this.icon&&a("div",{key:"72b20a3e5920cd173ea2fa05393d991d477e948b",class:"sd-toast__icon"},a("sd-icon",{key:"ac2c30b63ae84da53066ba0ddc2fb211ef6b8bbf",name:this.icon,size:s,color:e})),a("div",{key:"605dca0bcf05059e325f0c05800c11adc55d5da5",class:"sd-toast__content"},a("span",{key:"ba8d91256c01bd897b177a69372f813131bd4b03",class:"sd-toast__message"},this.message)),this.link&&a("a",{key:"a9283bacb928dc5d92ddc2e554967928035a5fab",href:this.link,class:"sd-toast__link",target:"_blank",rel:"noopener noreferrer"},this.linkLabel||this.link),this.buttonLabel&&a("sd-button",{key:"87b7d6bae7f0321e9557967f856e1b5e17697d17",class:"sd-toast__button",name:i,label:this.buttonLabel,onSdClick:t=>this.buttonClick.emit(t.detail)}),this.useClose&&a("sd-ghost-button",{key:"e89b2cdd29115e366bb5665a483433393eb1b420",class:"sd-toast__close",icon:"close",intent:n?"default":"inverse",ariaLabel:"close",size:"xs",onClick:()=>this.close.emit()})))}static get style(){return"sd-toast{display:block;width:fit-content;height:fit-content}sd-toast .sd-toast{display:flex;width:fit-content;align-items:center;gap:var(--sd-toast-gap, 16px);padding:var(--sd-toast-padding-y, 12px) var(--sd-toast-padding-x, 24px);border-radius:var(--sd-toast-radius, 8px);background-color:var(--sd-toast-bg);color:var(--sd-toast-text);box-shadow:2px 2px 8px 2px rgba(0, 0, 0, 0.2)}sd-toast .sd-toast__icon{display:flex;align-items:center;flex-shrink:0}sd-toast .sd-toast__content{display:flex;flex:1}sd-toast .sd-toast__message{font-size:14px;line-height:24px;font-weight:500;white-space:nowrap}sd-toast .sd-toast__link{font-size:14px;line-height:24px;font-weight:700;color:var(--sd-toast-link, var(--sd-toast-text));text-decoration:underline;cursor:pointer;transition:opacity 0.2s ease;margin-left:4px;white-space:nowrap}sd-toast .sd-toast__link:hover{opacity:0.8}sd-toast .sd-toast__button{flex-shrink:0}sd-toast .sd-toast__close{flex-shrink:0}"}},[512,"sd-toast",{icon:[1],message:[1],link:[1],linkLabel:[1,"link-label"],buttonLabel:[1,"button-label"],useClose:[4,"use-close"],type:[1]}]);function _(){"undefined"!=typeof customElements&&["sd-toast","sd-button","sd-ghost-button","sd-icon"].forEach((t=>{switch(t){case"sd-toast":customElements.get(o(t))||customElements.define(o(t),m);break;case"sd-button":customElements.get(o(t))||n();break;case"sd-ghost-button":customElements.get(o(t))||i();break;case"sd-icon":customElements.get(o(t))||d()}}))}export{m as S,_ as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as t,H as s,c as i,h as e,t as n}from"./p-siTDlOb6.js";import{n as o}from"./p-CCwNgVmC.js";import{i as a}from"./p-e0ABNkP6.js";import{d}from"./p-DqXt80Qn.js";import{d as l}from"./p-DGCbSjhn.js";import{d as r}from"./p-BS1cT5dG.js";import{d as u}from"./p-CtxH9xQc.js";import{d as h}from"./p-BNkExhYB.js";import{d as p}from"./p-PDLDFsH7.js";const c=a.textinput.sm,b=a.textinput.md,f={sm:{height:c.height,paddingX:c.paddingX,gap:c.gap,radius:c.radius,fontSize:c.typography.fontSize,lineHeight:c.typography.lineHeight,fontWeight:c.typography.fontWeight},md:{height:b.height,paddingX:b.paddingX,gap:b.gap,radius:b.radius,fontSize:b.typography.fontSize,lineHeight:b.typography.lineHeight,fontWeight:b.typography.fontWeight}},m={text:a.textinput.text,icon:a.textinput.icon},g=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.input=i(this,"sdUpdate",7),this.focus=i(this,"sdFocus",7),this.blur=i(this,"sdBlur",7)}get host(){return this}value=null;type="text";size="sm";addonLabel="";addonAlign="start";placeholder="입력해 주세요.";disabled=!1;clearable=!1;width="";rules=[];autoFocus=!1;autocomplete="";maxlength;minlength;inputmode;enterkeyhint;spellcheck=!1;status;hint="";errorMessage="";inputClass="";readonly=!1;error=!1;focused=!1;hovered=!1;label="";labelWidth="";icon=void 0;labelTooltip="";labelTooltipProps=null;inputStyle={};internalValue=null;passwordVisible=!1;nativeEl=void 0;formField;name=o();input;focus;blur;valueChanged(t){this.internalValue=t}internalValueChanged(t){t!==this.value&&(this.value=t,this.input?.emit(this.value))}async sdGetNativeElement(){return this.nativeEl||null}async sdValidate(){this.formField?.sdValidate()}async sdReset(){this.formField?.sdReset()}async sdResetValidate(){this.formField?.sdResetValidation()}async sdFocus(){this.formField?.sdFocus()}componentWillLoad(){null!=this.value&&""!==this.value&&(this.internalValue=this.value)}componentDidLoad(){this.autoFocus&&this.nativeEl?.focus()}handleInput=t=>{this.internalValue=t.target.value};handleFocus=async(t,s)=>{this.focused="focus"===t,"blur"===t?(this.rules&&this.rules.length>0&&await(this.formField?.sdValidate()),this.blur?.emit(s)):this.focus?.emit(s)};render(){const t=f[this.size]??f.sm;return e("sd-field",{key:"184bd0b614071b1c26d0ef3588db8eea1ac519cb",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,readonly:this.readonly,focused:this.focused,hovered:this.hovered,status:this.status,size:this.size,icon:this.icon,labelTooltip:this.labelTooltip,labelTooltipProps:this.labelTooltipProps,ref:t=>this.formField=t,onMouseEnter:()=>this.hovered=!0,onMouseLeave:()=>this.hovered=!1,style:{"--sd-input-font-size":`${t.fontSize}px`,"--sd-input-line-height":`${t.lineHeight}px`,"--sd-input-font-weight":t.fontWeight,"--sd-input-padding-x":`${t.paddingX}px`,"--sd-input-gap":`${t.gap}px`,"--sd-input-text-color":m.text.default,"--sd-input-placeholder-color":m.text.placeholder,"--sd-input-disabled-color":m.text.disabled,"--sd-input-icon-color":m.icon.default,"--sd-system-size-field-sm-height":`${t.height}px`,"--sd-system-radius-field-sm":`${t.radius}px`}},e("label",{key:"599d757b62bd61be0ba5c2dde2e1030b4d6f2973",class:"sd-input__content"},e("slot",{key:"8b71b1449225e51cbab4204e34c077d83101e09e",name:"prefix"}),e("input",{key:"ed48cf8544adc9e3475229b03129ace0af0e6d4e",name:this.name,ref:t=>this.nativeEl=t,class:`sd-input__native ${this.inputClass}`,type:"password"===this.type&&this.passwordVisible?"text":this.type??"text",value:this.internalValue||"",placeholder:this.placeholder??"입력해 주세요.",disabled:this.disabled,readonly:this.readonly,autofocus:this.autoFocus,autocomplete:this.autocomplete||void 0,maxlength:this.maxlength,minlength:this.minlength,inputmode:this.inputmode,enterkeyhint:this.enterkeyhint,spellcheck:this.spellcheck,onInput:this.handleInput,onFocus:t=>this.handleFocus("focus",t),onBlur:t=>this.handleFocus("blur",t),style:this.inputStyle}),e("slot",{key:"f084df7c3174756111c6eeb824202e26273d369a",name:"suffix"}),this.clearable&&this.internalValue&&!this.disabled&&!this.readonly&&e("sd-ghost-button",{key:"62f87c780b971ef43ec9bd15ae47d1f773ec18ca",icon:"close",ariaLabel:"clear",size:"xxs",disabled:this.disabled,class:"sd-input__clear-icon",onClick:async()=>{this.disabled||this.readonly||(this.internalValue="",await(this.formField?.sdValidate()))}}),"password"===this.type&&e("sd-ghost-button",{key:"83f511acdc0db74f6d7745e4a47c731f9bcf9bb5",icon:this.passwordVisible?"visibilityOn":"visibilityOff",ariaLabel:"visibility",size:"xxs",disabled:this.disabled||this.readonly,class:"sd-input__password-icon",onClick:()=>{this.disabled||this.readonly||(this.passwordVisible=!this.passwordVisible)}})))}static get watchers(){return{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}}static get style(){return"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)}input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus,input:-webkit-autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fff inset;box-shadow:0 0 0px 1000px #fff inset;transition:background-color 5000s ease-in-out 0s}input:autofill,input:autofill:hover,input:autofill:focus,input:autofill:active{-webkit-text-fill-color:#000;-webkit-box-shadow:0 0 0px 1000px #fff inset;box-shadow:0 0 0px 1000px #fff inset;transition:background-color 5000s ease-in-out 0s}sd-input{display:inline-flex}sd-input .sd-input__content{width:100%;height:100%;display:flex;flex-flow:row nowrap;align-items:center;color:var(--sd-input-text-color);font-size:var(--sd-input-font-size);line-height:var(--sd-input-line-height);font-weight:var(--sd-input-font-weight);padding:0 var(--sd-input-padding-x);gap:var(--sd-input-gap)}sd-input .sd-input__content .sd-input__native{width:100%;height:100%;border:none;outline:none;background:transparent;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}sd-input .sd-input__content .sd-input__native[disabled]{cursor:not-allowed;color:var(--sd-input-disabled-color)}sd-input .sd-input__content .sd-input__native[readonly]{color:var(--sd-system-color-field-text-read-only)}sd-input .sd-input__content .sd-input__native::placeholder{color:var(--sd-input-placeholder-color)}sd-input .sd-input__content .sd-input__clear-icon,sd-input .sd-input__content .sd-input__password-icon{flex-shrink:0}sd-input .sd-input__content .sd-input__native[disabled]~.sd-input__clear-icon,sd-input .sd-input__content .sd-input__native[disabled]~.sd-input__password-icon,sd-input .sd-input__content .sd-input__native[readonly]~.sd-input__clear-icon,sd-input .sd-input__content .sd-input__native[readonly]~.sd-input__password-icon{cursor:not-allowed;pointer-events:none}"}},[772,"sd-input",{value:[1032],type:[1],size:[1],addonLabel:[1,"addon-label"],addonAlign:[1,"addon-align"],placeholder:[1],disabled:[4],clearable:[4],width:[8],rules:[16],autoFocus:[4,"auto-focus"],autocomplete:[1],maxlength:[2],minlength:[2],inputmode:[1],enterkeyhint:[1],spellcheck:[4],status:[1],hint:[1],errorMessage:[1,"error-message"],inputClass:[1,"input-class"],readonly:[4],error:[1028],focused:[1028],hovered:[1028],label:[1],labelWidth:[8,"label-width"],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],inputStyle:[16],name:[1],internalValue:[32],passwordVisible:[32],sdGetNativeElement:[64],sdValidate:[64],sdReset:[64],sdResetValidate:[64],sdFocus:[64]},void 0,{value:[{valueChanged:0}],internalValue:[{internalValueChanged:0}]}]);function _(){"undefined"!=typeof customElements&&["sd-input","sd-button","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-tooltip"].forEach((t=>{switch(t){case"sd-input":customElements.get(n(t))||customElements.define(n(t),g);break;case"sd-button":customElements.get(n(t))||d();break;case"sd-field":customElements.get(n(t))||l();break;case"sd-floating-portal":customElements.get(n(t))||r();break;case"sd-ghost-button":customElements.get(n(t))||u();break;case"sd-icon":customElements.get(n(t))||h();break;case"sd-tooltip":customElements.get(n(t))||p()}}))}export{g as S,_ as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as t,H as i,c as s,h as e,t as h}from"./p-siTDlOb6.js";import{d as n}from"./p-CtxH9xQc.js";import{d as o}from"./p-BNkExhYB.js";var d={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",lineHeight:"20"},focus:{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:"400",lineHeight:"20"}},a={default:"#F6F6F6",error:"#FCEFEF",focus:"#FFFFFF"},r={default:"#555555",error:"#E30000",focus:"#222222"},c={focus:"#E1E1E1",width:"1"};const l={height:`${"24"}px`,paddingX:`${"8"}px`,gap:`${"4"}px`,radius:`${"9999"}px`,borderWidth:`${c.width}px`},p={bg:{default:a.default,error:a.error,focus:a.focus},content:{default:r.default,error:r.error,focus:r.focus},border:{focus:c.focus}},u={default:{fontFamily:d.default.fontFamily,fontSize:`${d.default.fontSize}px`,fontWeight:d.default.fontWeight,lineHeight:`${d.default.lineHeight}px`},focus:{fontFamily:d.focus.fontFamily,fontSize:`${d.focus.fontSize}px`,fontWeight:d.focus.fontWeight,lineHeight:`${d.focus.lineHeight}px`}},f=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.update=s(this,"sdUpdate",7),this.delete=s(this,"sdRemove",7),this.focus=s(this,"sdFocus",7),this.blur=s(this,"sdBlur",7)}get el(){return this}name="";value="";error=!1;disabled=!1;placeholder="";rules=[];internalValue="";isEditing=!1;update;delete;focus;blur;inputEl;draftValue="";shouldInitInput=!1;valueChanged(t){const i=t??"",s=this.isEditing;this.internalValue=i,this.draftValue=i,s&&(this.isEditing=!1,this.shouldInitInput=!1,this.inputEl?.blur(),this.blur.emit())}componentWillLoad(){this.internalValue=this.value??""}componentDidLoad(){this.registerToForm()}disconnectedCallback(){this.unregisterFromForm()}async sdValidate(){if(!this.rules||0===this.rules.length)return this.error=!1,!0;for(const t of this.rules)if(!0!==t(this.internalValue??""))return this.error=!0,!1;return this.error=!1,!0}async sdReset(){this.internalValue="",this.value="",this.error=!1,this.draftValue="",this.isEditing=!1,this.shouldInitInput=!1}async sdResetValidate(){this.error=!1}async sdResetValidation(){this.error=!1}async sdFocus(){this.disabled||this.enterEditMode()}async sdGetNativeElement(){return this.inputEl??null}enterEditMode=()=>{this.disabled||this.isEditing||(this.draftValue=this.internalValue,this.shouldInitInput=!0,this.isEditing=!0,this.focus.emit())};commitEdit=async()=>{if(!this.isEditing)return;const t=(this.inputEl?.textContent??this.draftValue).trim(),i=t!==this.draftValue;this.internalValue=t,this.isEditing=!1,this.shouldInitInput=!1,this.value=t,i&&this.update.emit(t),await this.sdValidate(),this.blur.emit()};cancelEdit=()=>{this.isEditing&&(this.internalValue=this.draftValue,this.isEditing=!1,this.shouldInitInput=!1,this.blur.emit())};handleChipClick=()=>{this.disabled||this.isEditing||this.enterEditMode()};handleChipKeyDown=t=>{this.disabled||this.isEditing||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.enterEditMode())};handleInputChange=t=>{this.internalValue=t.target.textContent??""};handleInputKeyDown=t=>{"Enter"===t.key?(t.preventDefault(),this.commitEdit()):"Escape"===t.key&&(t.preventDefault(),this.cancelEdit())};handleInputBlur=()=>{this.commitEdit()};handlePaste=t=>{t.preventDefault();const i=t.clipboardData?.getData("text/plain")??"";document.execCommand("insertText",!1,i)};handleRemoveClick=t=>{t.stopPropagation(),this.disabled||this.delete.emit()};syncInputValue(t){if(!this.inputEl)return;this.inputEl.textContent=t;const i=document.createRange();i.selectNodeContents(this.inputEl),i.collapse(!1);const s=window.getSelection();s?.removeAllRanges(),s?.addRange(i)}registerToForm(){const t=this.el.closest("sd-form");t&&"function"==typeof t.componentOnReady&&t.componentOnReady().then((t=>{t.sdRegisterField(this)}))}unregisterFromForm(){if(""===this.name)return;const t=this.el.closest("sd-form");t?.componentOnReady().then((t=>{t.sdUnregisterField(this)}))}componentDidUpdate(){this.isEditing&&this.inputEl&&this.shouldInitInput&&(this.inputEl.focus(),this.syncInputValue(this.internalValue),this.shouldInitInput=!1)}resolveState(){return this.isEditing?"focus":this.error?"error":"default"}render(){const t=this.resolveState(),i="focus"===t?u.focus:u.default,s={"--sd-chip-height":l.height,"--sd-chip-padding-x":l.paddingX,"--sd-chip-gap":l.gap,"--sd-chip-radius":l.radius,"--sd-chip-border-width":l.borderWidth,"--sd-chip-bg":p.bg[t],"--sd-chip-content":p.content[t],"--sd-chip-border-color":"focus"===t?p.border.focus:"transparent","--sd-chip-font-family":i.fontFamily,"--sd-chip-font-size":i.fontSize,"--sd-chip-font-weight":i.fontWeight,"--sd-chip-line-height":i.lineHeight};return e("span",{key:"6503611c9cb03be2de4fc09398e2ce1b34b8ab10",class:{"sd-chip":!0,[`sd-chip--${t}`]:!0,"sd-chip--disabled":this.disabled,"sd-chip--editable":!this.disabled},role:this.disabled?void 0:"button",tabIndex:this.disabled||this.isEditing?-1:0,"aria-disabled":this.disabled?"true":void 0,style:s,onClick:this.handleChipClick,onKeyDown:this.handleChipKeyDown},this.isEditing?e("span",{key:"chip-input",ref:t=>this.inputEl=t,class:"sd-chip__input",role:"textbox",tabindex:this.disabled?-1:0,contentEditable:!this.disabled,"data-placeholder":this.placeholder,spellcheck:!1,onInput:this.handleInputChange,onKeyDown:this.handleInputKeyDown,onBlur:this.handleInputBlur,onPaste:this.handlePaste,onClick:t=>t.stopPropagation()}):[e("span",{key:"chip-label",class:"sd-chip__label"},this.internalValue),!this.disabled&&e("sd-ghost-button",{key:"chip-remove",class:"sd-chip__remove",icon:"close",size:"xxs",ariaLabel:"remove",onClick:this.handleRemoveClick})])}static get watchers(){return{value:[{valueChanged:0}]}}static get style(){return"sd-chip{display:inline-flex;width:fit-content;height:fit-content}sd-chip .sd-chip{display:inline-flex;align-items:center;justify-content:center;gap:var(--sd-chip-gap);height:var(--sd-chip-height);padding:0 var(--sd-chip-padding-x);border-radius:var(--sd-chip-radius);background:var(--sd-chip-bg);color:var(--sd-chip-content);border:var(--sd-chip-border-width) solid var(--sd-chip-border-color);font-family:var(--sd-chip-font-family);font-size:var(--sd-chip-font-size);font-weight:var(--sd-chip-font-weight);line-height:var(--sd-chip-line-height);box-sizing:border-box;white-space:nowrap;-webkit-user-select:none;user-select:none}sd-chip .sd-chip--editable:not(.sd-chip--focus){cursor:text}sd-chip .sd-chip--disabled{cursor:not-allowed;opacity:0.6}sd-chip .sd-chip__label{display:inline-flex;align-items:center;min-width:0}sd-chip .sd-chip__input{display:inline-block;min-width:1ch;outline:none;background:transparent;color:inherit;font:inherit;white-space:nowrap;cursor:text}sd-chip .sd-chip__input:empty::before{content:attr(data-placeholder);color:inherit;opacity:0.6;pointer-events:none}sd-chip .sd-chip__remove{flex-shrink:0}"}},[512,"sd-chip",{name:[1],value:[1025],error:[1028],disabled:[4],placeholder:[1],rules:[16],internalValue:[32],isEditing:[32],sdValidate:[64],sdReset:[64],sdResetValidate:[64],sdResetValidation:[64],sdFocus:[64],sdGetNativeElement:[64]},void 0,{value:[{valueChanged:0}]}]);function m(){"undefined"!=typeof customElements&&["sd-chip","sd-ghost-button","sd-icon"].forEach((t=>{switch(t){case"sd-chip":customElements.get(h(t))||customElements.define(h(t),f);break;case"sd-ghost-button":customElements.get(h(t))||n();break;case"sd-icon":customElements.get(h(t))||o()}}))}export{f as S,m as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e,H as a,c as r,h as n,F as d,t}from"./p-siTDlOb6.js";import{u as i,t as s,W as c,C as l}from"./p-BysikR_g.js";import{d as g}from"./p-laVsm9VM.js";import{d as o}from"./p-CtxH9xQc.js";import{d as h}from"./p-BNkExhYB.js";const p=(e,a)=>{const[r,n,d]=e.split("-").map(Number),t=new Date(r,n-1,d);return t.setDate(t.getDate()+a),`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`},k={bg:g.datepicker.calendar.range.bg,height:g.datepicker.calendar.range.height,panelGap:g.datepicker.calendar.range.panelGap,divider:g.datepicker.calendar.range.divider},_=e(class extends a{constructor(e){super(),!1!==e&&this.__registerHost(),this.select=r(this,"sdSelect",7),this.viewChange=r(this,"sdViewChange",7)}value=null;selectable;maxRange;currentYear;currentMonth;pendingStart="";hoverDate="";displayValue=null;select;viewChange;dateUtil=i();componentWillLoad(){this.syncFromValue()}handleValueChange(){this.syncFromValue()}syncFromValue(){const e=this.value?.[0]||s,[a,r]=e.split("-").map(Number);this.currentYear=a,this.currentMonth=r,this.pendingStart="",this.hoverDate="",this.displayValue=this.value?[this.value[0],this.value[1]]:null}get rightYear(){return 12===this.currentMonth?this.currentYear+1:this.currentYear}get rightMonth(){return 12===this.currentMonth?1:this.currentMonth+1}formatDate(e,a,r){return`${e}-${String(a).padStart(2,"0")}-${String(r).padStart(2,"0")}`}buildCells(e,a){const r=new Date(e,a-1,1).getDay(),n=new Date(e,a,0).getDate(),d=1===a?12:a-1,t=1===a?e-1:e,i=new Date(t,d,0).getDate(),s=12===a?1:a+1,c=12===a?e+1:e,l=[];for(let e=r-1;e>=0;e--){const a=i-e;l.push({date:this.formatDate(t,d,a),day:a,inCurrentMonth:!1})}for(let r=1;r<=n;r++)l.push({date:this.formatDate(e,a,r),day:r,inCurrentMonth:!0});const g=(7-l.length%7)%7;for(let e=1;e<=g;e++)l.push({date:this.formatDate(c,s,e),day:e,inCurrentMonth:!1});return l}emitViewChange(){this.viewChange.emit({year:this.currentYear,month:this.currentMonth})}goPrevYear=e=>{e.stopPropagation(),this.currentYear-=1,this.emitViewChange()};goNextYear=e=>{e.stopPropagation(),this.currentYear+=1,this.emitViewChange()};goPrevMonth=e=>{e.stopPropagation();const{newYear:a,newMonth:r}=this.dateUtil.calculateYearMonth(this.currentYear,this.currentMonth,"prev");this.currentYear=a,this.currentMonth=r,this.emitViewChange()};goNextMonth=e=>{e.stopPropagation();const{newYear:a,newMonth:r}=this.dateUtil.calculateYearMonth(this.currentYear,this.currentMonth,"next");this.currentYear=a,this.currentMonth=r,this.emitViewChange()};goToday=e=>{e.stopPropagation();const[a,r]=s.split("-").map(Number);this.currentYear===a&&this.currentMonth===r||(this.currentYear=a,this.currentMonth=r,this.emitViewChange())};isDisabled(e){if(this.selectable){const[a,r]=this.selectable;if(null!=a&&""!==a&&e<a)return!0;if(null!=r&&""!==r&&e>r)return!0}if(null!=this.maxRange&&this.maxRange>0&&""!==this.pendingStart){const a=p(this.pendingStart,-this.maxRange),r=p(this.pendingStart,this.maxRange);if(e<a||e>r)return!0}return!1}handleDayClick(e){if(!e.inCurrentMonth)return;if(this.isDisabled(e.date))return;if(""===this.pendingStart||null!=this.displayValue&&""!==this.displayValue[0]&&""!==this.displayValue[1]||e.date<this.pendingStart)return this.pendingStart=e.date,this.displayValue=null,void(this.hoverDate="");const a=[this.pendingStart,e.date];this.pendingStart="",this.hoverDate="",this.displayValue=a,this.select.emit(a)}handleDayHover(e){e.inCurrentMonth&&""!==this.pendingStart&&(this.hoverDate=e.date)}getRangeState(e,a){if(!a)return{inRange:!1,isRangeStart:!1,isRangeEnd:!1,isSelectedEdge:!1};if(""!==this.pendingStart){const a=e===this.pendingStart,r=""!==this.hoverDate&&this.hoverDate>=this.pendingStart?this.hoverDate:"";return{inRange:""!==r&&e>this.pendingStart&&e<=r,isRangeStart:a,isRangeEnd:""!==r&&e===r,isSelectedEdge:a}}if(null!=this.displayValue&&""!==this.displayValue[0]&&""!==this.displayValue[1]){const[a,r]=this.displayValue,n=e===a,d=e===r;return{inRange:e>a&&e<r,isRangeStart:n,isRangeEnd:d,isSelectedEdge:n||d}}return{inRange:!1,isRangeStart:!1,isRangeEnd:!1,isSelectedEdge:!1}}renderHeader(e,a,r){const d=`${e}.${String(a).padStart(2,"0")}`;return n("div",{class:"sd-date-range-picker-calendar__header"},n("div",{class:"sd-date-range-picker-calendar__nav-group sd-date-range-picker-calendar__nav-group-month"},n("sd-ghost-button",{class:{"sd-date-range-picker-calendar__nav-placeholder":!r},ariaLabel:"prevMonth",size:"xxs",icon:"chevronLeft",onClick:this.goPrevMonth}),n("span",{class:"sd-date-range-picker-calendar__label sd-date-range-picker-calendar__label-month"},d),n("sd-ghost-button",{class:{"sd-date-range-picker-calendar__nav-placeholder":r},ariaLabel:"nextMonth",size:"xxs",icon:"chevronRight",onClick:this.goNextMonth})))}renderYearNav(){return n("div",{class:"sd-date-range-picker-calendar__top-bar"},n("div",{class:"sd-date-range-picker-calendar__year-nav"},n("sd-ghost-button",{ariaLabel:"prevYear",size:"xxs",icon:"chevronLeft",onClick:this.goPrevYear}),n("span",{class:"sd-date-range-picker-calendar__label"},this.currentYear),n("sd-ghost-button",{ariaLabel:"nextYear",size:"xxs",icon:"chevronRight",onClick:this.goNextYear})),n("button",{type:"button",class:"sd-date-range-picker-calendar__today-button",onClick:this.goToday},"오늘"))}renderPanel(e,a,r){const d=this.buildCells(e,a);return n("div",{class:"sd-date-range-picker-calendar__panel"},this.renderHeader(e,a,r),n("div",{class:"sd-date-range-picker-calendar__week"},c.map((e=>n("span",{key:e,class:"sd-date-range-picker-calendar__week-cell"},e)))),n("div",{class:"sd-date-range-picker-calendar__grid"},d.map((e=>{const{inRange:a,isRangeStart:r,isRangeEnd:d,isSelectedEdge:t}=this.getRangeState(e.date,e.inCurrentMonth),i=e.inCurrentMonth&&s===e.date,c=e.inCurrentMonth&&this.isDisabled(e.date);return n("button",{type:"button",key:e.date,class:{"sd-date-range-picker-calendar__day":!0,"sd-date-range-picker-calendar__day--empty":!e.inCurrentMonth,"sd-date-range-picker-calendar__day--today":i,"sd-date-range-picker-calendar__day--in-range":a,"sd-date-range-picker-calendar__day--range-start":r,"sd-date-range-picker-calendar__day--range-end":d,"sd-date-range-picker-calendar__day--selected":t,"sd-date-range-picker-calendar__day--disabled":c},disabled:!e.inCurrentMonth||c,tabindex:e.inCurrentMonth?void 0:-1,"aria-hidden":e.inCurrentMonth?void 0:"true",onClick:()=>this.handleDayClick(e),onMouseEnter:()=>this.handleDayHover(e)},n("span",{class:"sd-date-range-picker-calendar__day-circle"},e.inCurrentMonth?e.day:""))}))))}render(){return n(d,{key:"a9e5bc8198cfda50227069661812341e7a19b21d"},n("div",{key:"a2c5bf6ae806fc24f421cb6b52323f4e92bfc255",class:"sd-date-range-picker-calendar",style:{"--calendar-bg":l.bg,"--calendar-padding":`${l.paddingXY}px`,"--calendar-gap":`${l.gap}px`,"--calendar-radius":`${l.radius}px`,"--calendar-header-gap":`${l.header.gap}px`,"--calendar-header-divider":l.header.divider,"--calendar-header-font-size":`${l.header.fontSize}px`,"--calendar-header-line-height":`${l.header.lineHeight}px`,"--calendar-header-font-weight":l.header.fontWeight,"--calendar-week-font-size":`${l.week.fontSize}px`,"--calendar-week-line-height":`${l.week.lineHeight}px`,"--calendar-week-font-weight":l.week.fontWeight,"--calendar-week-color":l.week.color,"--calendar-grid-row-gap":`${l.grid.rowGap}px`,"--calendar-day-size":`${l.day.size}px`,"--calendar-day-circle-size":`${l.day.circleSize}px`,"--calendar-day-circle-radius":`${l.day.circleRadius}px`,"--calendar-day-text":l.day.defaultText,"--calendar-day-hover-text":l.day.hoverText,"--calendar-day-hover-border":l.day.hoverBorder,"--calendar-day-select-bg":l.day.selectBg,"--calendar-day-select-text":l.day.selectText,"--calendar-day-disabled-text":l.day.disabledText,"--calendar-day-font-size":`${l.day.fontSize}px`,"--calendar-day-line-height":`${l.day.lineHeight}px`,"--calendar-day-font-weight":l.day.fontWeight,"--range-bg":k.bg,"--range-height":`${k.height}px`,"--range-panel-gap":`${k.panelGap}px`,"--range-divider":k.divider}},this.renderYearNav(),n("div",{key:"2575175fa3537e010e1c7d573428d5c8ebfae488",class:"sd-date-range-picker-calendar__panels"},this.renderPanel(this.currentYear,this.currentMonth,!0),n("span",{key:"bd43ac98b88665dbe85804c8b6345c19dca7d9fa",class:"sd-date-range-picker-calendar__divider","aria-hidden":"true"}),this.renderPanel(this.rightYear,this.rightMonth,!1))))}static get watchers(){return{value:[{handleValueChange:0}]}}static get style(){return"sd-date-range-picker-calendar{display:block}sd-date-range-picker-calendar .sd-date-range-picker-calendar{display:flex;flex-direction:column;gap:var(--calendar-gap);height:364px;padding:var(--calendar-padding);background:var(--calendar-bg);border-radius:var(--calendar-radius);box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.2);user-select:none}sd-date-range-picker-calendar .sd-date-range-picker-calendar__top-bar{position:relative;display:flex;align-items:center;justify-content:center}sd-date-range-picker-calendar .sd-date-range-picker-calendar__year-nav{display:flex;align-items:center;justify-content:center;gap:var(--calendar-gap);font-size:var(--calendar-header-font-size);line-height:var(--calendar-header-line-height);font-weight:var(--calendar-header-font-weight);color:var(--calendar-day-text)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__today-button{position:absolute;right:0;background:transparent;cursor:pointer;font-size:var(--calendar-week-font-size);font-weight:var(--calendar-header-font-weight);color:var(--calendar-day-text);min-width:37px;height:24px;line-height:24px;text-align:center}sd-date-range-picker-calendar .sd-date-range-picker-calendar__today-button:hover{text-decoration:underline}sd-date-range-picker-calendar .sd-date-range-picker-calendar__panels{display:flex;flex-direction:row;gap:var(--range-panel-gap)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__divider{flex-shrink:0;width:1px;background:var(--range-divider)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__panel{display:flex;flex-direction:column;gap:var(--calendar-gap)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__header{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center;gap:var(--calendar-header-gap);font-size:var(--calendar-header-font-size);line-height:var(--calendar-header-line-height);font-weight:var(--calendar-header-font-weight);color:var(--calendar-day-text)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__nav-group{display:inline-flex;align-items:center;gap:var(--calendar-gap)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__nav-group-month{display:flex;width:100%;align-items:center;gap:var(--calendar-gap)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__label{display:inline-flex;align-items:center;justify-content:center;min-width:40px;text-align:center}sd-date-range-picker-calendar .sd-date-range-picker-calendar__label-month{flex:1}sd-date-range-picker-calendar .sd-date-range-picker-calendar__nav-placeholder{visibility:hidden;pointer-events:none}sd-date-range-picker-calendar .sd-date-range-picker-calendar__week{display:grid;grid-template-columns:repeat(7, var(--calendar-day-size))}sd-date-range-picker-calendar .sd-date-range-picker-calendar__week-cell{display:inline-flex;align-items:center;justify-content:center;height:20px;font-size:var(--calendar-week-font-size);line-height:var(--calendar-week-line-height);font-weight:var(--calendar-week-font-weight);color:var(--calendar-week-color)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__grid{display:grid;grid-template-columns:repeat(7, var(--calendar-day-size));row-gap:var(--calendar-grid-row-gap)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day{position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--calendar-day-size);height:var(--range-height);padding:0;border:none;background:transparent;cursor:pointer;font-size:var(--calendar-day-font-size);line-height:var(--calendar-day-line-height);font-weight:var(--calendar-day-font-weight);color:var(--calendar-day-text)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day-circle{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;width:var(--calendar-day-circle-size);height:var(--calendar-day-circle-size);border-radius:calc(var(--calendar-day-circle-radius) * 1px);border:1px solid transparent;box-sizing:border-box}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day:not(:disabled):hover .sd-date-range-picker-calendar__day-circle{border-radius:16px;border:1px solid var(--calendar-day-hover-border)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day--today .sd-date-range-picker-calendar__day-circle{font-weight:700}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day--in-range{background:var(--range-bg)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day--range-start{background:linear-gradient(to right, transparent 50%, var(--range-bg) 50%)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day--range-end{background:var(--range-bg)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day--range-startsd-date-range-picker-calendar .sd-date-range-picker-calendar__day--range-end{background:transparent}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day--selected .sd-date-range-picker-calendar__day-circle{border-radius:16px;background:var(--calendar-day-select-bg);color:var(--calendar-day-select-text)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day--selected:not(:disabled):hover .sd-date-range-picker-calendar__day-circle{background:var(--calendar-day-select-bg);color:var(--calendar-day-select-text)}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day--disabled{color:var(--calendar-day-disabled-text);cursor:not-allowed}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day--disabled:not(.sd-date-range-picker-calendar__day--in-range):not(.sd-date-range-picker-calendar__day--range-start):not(.sd-date-range-picker-calendar__day--range-end){background:none}sd-date-range-picker-calendar .sd-date-range-picker-calendar__day--empty{visibility:hidden;pointer-events:none;background:transparent}"}},[512,"sd-date-range-picker-calendar",{value:[16],selectable:[16],maxRange:[2,"max-range"],currentYear:[32],currentMonth:[32],pendingStart:[32],hoverDate:[32],displayValue:[32]},void 0,{value:[{handleValueChange:0}]}]);function u(){"undefined"!=typeof customElements&&["sd-date-range-picker-calendar","sd-ghost-button","sd-icon"].forEach((e=>{switch(e){case"sd-date-range-picker-calendar":customElements.get(t(e))||customElements.define(t(e),_);break;case"sd-ghost-button":customElements.get(t(e))||o();break;case"sd-icon":customElements.get(t(e))||h()}}))}export{_ as S,u as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r={button:{xs:{icon:"12"},sm:{icon:"16"},md:{icon:"20"},lg:{icon:"24"},border:{disabled:"#CCCCCC"},bg:{disabled:"#E1E1E1"},text:{disabled:"#888888"},brand:{strong:{bg:{default:"#025497",hover:"#004177"},content:"#FFFFFF"},subtle:{bg:{default:"#1F8AE1",hover:"#006AC1"},content:"#FFFFFF"},outline:{bg:{default:"#FFFFFF",hover:"#EAF5FE"},border:"#025497",content:"#025497"}},dropdown:{brand:{strong:{split:"#006AC1"},subtle:{split:"#5CB0F3"}},danger:{strong:{split:"#FF7C7C"}}},neutral:{outline:{bg:{default:"#FFFFFF",hover:"#EEEEEE"},border:"#888888",text:"#222222"}},danger:{strong:{bg:{default:"#E30000",hover:"#AD0000"},content:"#FFFFFF"},outline:{bg:{default:"#FFFFFF",hover:"#FCEFEF"},border:"#E30000",content:"#E30000"}}}};const a="#0075FF",e={primary:r.button.brand.strong.bg.default,secondary:r.button.brand.subtle.bg.default,primary_outline:r.button.brand.outline.bg.default,neutral_outline:r.button.neutral.outline.bg.default,danger:r.button.danger.strong.bg.default,danger_outline:r.button.danger.outline.bg.default},n={primary_xs:{variant:"primary",size:"xs",color:e.primary},secondary_xs:{variant:"primary",size:"xs",color:e.secondary},primary_outline_xs:{variant:"outline",size:"xs",color:e.primary_outline},neutral_outline_xs:{variant:"outline",size:"xs",color:e.neutral_outline},danger_xs:{variant:"primary",size:"xs",color:e.danger},danger_outline_xs:{variant:"outline",size:"xs",color:e.danger_outline},primary_sm:{variant:"primary",size:"sm",color:e.primary},secondary_sm:{variant:"primary",size:"sm",color:e.secondary},primary_outline_sm:{variant:"outline",size:"sm",color:e.primary_outline},neutral_outline_sm:{variant:"outline",size:"sm",color:e.neutral_outline},danger_sm:{variant:"primary",size:"sm",color:e.danger},danger_outline_sm:{variant:"outline",size:"sm",color:e.danger_outline},primary_md:{variant:"primary",size:"md",color:e.primary},secondary_md:{variant:"primary",size:"md",color:e.secondary},primary_outline_md:{variant:"outline",size:"md",color:e.primary_outline},neutral_outline_md:{variant:"outline",size:"md",color:e.neutral_outline},danger_md:{variant:"primary",size:"md",color:e.danger},danger_outline_md:{variant:"outline",size:"md",color:e.danger_outline},primary_lg:{variant:"primary",size:"lg",color:e.primary},secondary_lg:{variant:"primary",size:"lg",color:e.secondary},primary_outline_lg:{variant:"outline",size:"lg",color:e.primary_outline},neutral_outline_lg:{variant:"outline",size:"lg",color:e.neutral_outline},danger_lg:{variant:"primary",size:"lg",color:e.danger},danger_outline_lg:{variant:"outline",size:"lg",color:e.danger_outline}},i={xs:Number(r.button.xs.icon),sm:Number(r.button.sm.icon),md:Number(r.button.md.icon),lg:Number(r.button.lg.icon)},o={primary:r.button.brand.strong.bg.hover,secondary:r.button.brand.subtle.bg.hover,primary_outline:r.button.brand.outline.bg.hover,neutral_outline:r.button.neutral.outline.bg.hover,danger:r.button.danger.strong.bg.hover,danger_outline:r.button.danger.outline.bg.hover},t={primary:r.button.brand.strong.content,secondary:r.button.brand.subtle.content,primary_outline:r.button.brand.outline.content,neutral_outline:r.button.neutral.outline.text,danger:r.button.danger.strong.content,danger_outline:r.button.danger.outline.content},l={primary:"transparent",secondary:"transparent",primary_outline:r.button.brand.outline.border,neutral_outline:r.button.neutral.outline.border,danger:"transparent",danger_outline:r.button.danger.outline.border},s=/_(xs|sm|md|lg)$/,d=r=>r in n,m=r=>r.replace(s,"");export{n as B,l as P,t as a,r as b,o as c,a as d,i as e,m as g,d as i}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e,H as i,c as s,h as t,t as l}from"./p-siTDlOb6.js";import{n as r}from"./p-CCwNgVmC.js";import{d as o}from"./p-DqXt80Qn.js";import{d as a}from"./p-BmmIQQlT.js";import{d}from"./p-DGCbSjhn.js";import{d as n}from"./p-BS1cT5dG.js";import{d as c}from"./p-CtxH9xQc.js";import{d as h}from"./p-BNkExhYB.js";import{d as p}from"./p-PDLDFsH7.js";var f={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 u={height:f.sm.height,paddingX:f.sm.paddingX,gap:f.sm.gap,radius:f.sm.radius,fontSize:f.sm.typography.fontSize,lineHeight:f.sm.typography.lineHeight,fontWeight:f.sm.typography.fontWeight,iconSize:f.sm.icon},k={text:f.text,icon:{default:"#888888",disabled:f.icon.disabled}},m=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?k.icon.disabled:k.icon.default}render(){const e=this.hasFiles(),i=this.getDisplayText(),s={"--sd-file-picker-font-size":`${u.fontSize}px`,"--sd-file-picker-line-height":`${u.lineHeight}px`,"--sd-file-picker-font-weight":u.fontWeight,"--sd-file-picker-padding-x":`${u.paddingX}px`,"--sd-file-picker-gap":`${u.gap}px`,"--sd-file-picker-text-color":k.text.default,"--sd-file-picker-placeholder-color":k.text.placeholder,"--sd-file-picker-disabled-color":k.text.disabled,"--sd-system-size-field-sm-height":`${u.height}px`,"--sd-system-radius-field-sm":`${u.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(u.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 x(){"undefined"!=typeof customElements&&["sd-file-picker","sd-button","sd-chip","sd-field","sd-floating-portal","sd-ghost-button","sd-icon","sd-tooltip"].forEach((e=>{switch(e){case"sd-file-picker":customElements.get(l(e))||customElements.define(l(e),m);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-tooltip":customElements.get(l(e))||p()}}))}export{m as S,x as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e,H as a,c as d,h as n,t as r}from"./p-siTDlOb6.js";import{u as t,t as l,W as s,C as c}from"./p-BysikR_g.js";import{d as i}from"./p-CtxH9xQc.js";import{d as o}from"./p-BNkExhYB.js";const h=e(class extends a{constructor(e){super(),!1!==e&&this.__registerHost(),this.update=d(this,"sdUpdate",7),this.viewChange=d(this,"sdViewChange",7)}value=null;selectable;events;elevated=!1;currentYear;currentMonth;update;viewChange;dateUtil=t();_eventMapCache;get eventMap(){const e=this._eventMapCache;if(e&&e.src===this.events)return e.map;const a=new Map;return(this.events??[]).forEach((e=>e.dates.forEach((d=>{const n=a.get(d)??[];n.push({color:e.color,label:e.label}),a.set(d,n)})))),this._eventMapCache={src:this.events,map:a},a}get legendItems(){const e=new Set,a=[];return(this.events??[]).forEach((d=>{const n=`${d.color}|${d.label}`;e.has(n)||(e.add(n),a.push({color:d.color,label:d.label}))})),a}componentWillLoad(){this.syncViewFromValue()}handleValueChange(){this.syncViewFromValue()}syncViewFromValue(){const e=this.value||l,[a,d]=e.split("-").map(Number);this.currentYear=a,this.currentMonth=d}formatDate(e,a,d){return`${e}-${String(a).padStart(2,"0")}-${String(d).padStart(2,"0")}`}get cells(){const e=this.currentYear,a=this.currentMonth,d=new Date(e,a-1,1).getDay(),n=new Date(e,a,0).getDate(),r=1===a?12:a-1,t=1===a?e-1:e,l=new Date(t,r,0).getDate(),s=12===a?1:a+1,c=12===a?e+1:e,i=[];for(let e=d-1;e>=0;e--){const a=l-e;i.push({date:this.formatDate(t,r,a),day:a,inCurrentMonth:!1})}for(let d=1;d<=n;d++)i.push({date:this.formatDate(e,a,d),day:d,inCurrentMonth:!0});const o=(7-i.length%7)%7;for(let e=1;e<=o;e++)i.push({date:this.formatDate(c,s,e),day:e,inCurrentMonth:!1});return i}emitViewChange(){this.viewChange.emit({year:this.currentYear,month:this.currentMonth})}goPrevYear=e=>{e.stopPropagation(),this.currentYear-=1,this.emitViewChange()};goNextYear=e=>{e.stopPropagation(),this.currentYear+=1,this.emitViewChange()};goPrevMonth=e=>{e.stopPropagation();const{newYear:a,newMonth:d}=this.dateUtil.calculateYearMonth(this.currentYear,this.currentMonth,"prev");this.currentYear=a,this.currentMonth=d,this.emitViewChange()};goNextMonth=e=>{e.stopPropagation();const{newYear:a,newMonth:d}=this.dateUtil.calculateYearMonth(this.currentYear,this.currentMonth,"next");this.currentYear=a,this.currentMonth=d,this.emitViewChange()};isDisabled(e){if(!this.selectable)return!1;const[a,d]=this.selectable;return""!==a&&e<a||""!==d&&e>d}handleDayClick(e){this.isDisabled(e.date)||(this.value=e.date,this.update.emit(e.date))}render(){const e={"--calendar-bg":c.bg,"--calendar-padding":`${c.paddingXY}px`,"--calendar-gap":`${c.gap}px`,"--calendar-radius":`${c.radius}px`,"--calendar-header-gap":`${c.header.gap}px`,"--calendar-header-divider":c.header.divider,"--calendar-header-font-size":`${c.header.fontSize}px`,"--calendar-header-line-height":`${c.header.lineHeight}px`,"--calendar-header-font-weight":c.header.fontWeight,"--calendar-week-font-size":`${c.week.fontSize}px`,"--calendar-week-line-height":`${c.week.lineHeight}px`,"--calendar-week-font-weight":c.week.fontWeight,"--calendar-week-color":c.week.color,"--calendar-grid-row-gap":`${c.grid.rowGap}px`,"--calendar-day-size":`${c.day.size}px`,"--calendar-day-circle-size":`${c.day.circleSize}px`,"--calendar-day-circle-radius":`${c.day.circleRadius}px`,"--calendar-day-text":c.day.defaultText,"--calendar-day-hover-text":c.day.hoverText,"--calendar-day-hover-border":c.day.hoverBorder,"--calendar-day-select-bg":c.day.selectBg,"--calendar-day-select-text":c.day.selectText,"--calendar-day-disabled-text":c.day.disabledText,"--calendar-day-font-size":`${c.day.fontSize}px`,"--calendar-day-line-height":`${c.day.lineHeight}px`,"--calendar-day-font-weight":c.day.fontWeight,"--calendar-day-bold-font-weight":c.day.boldFontWeight,"--calendar-day-dot-size":`${c.day.dot.size}px`,"--calendar-day-dot-gap":`${c.day.dot.gap}px`,"--calendar-day-dot-padding-y":`${c.day.dot.paddingY}px`,"--calendar-legend-font-size":`${c.legend.fontSize}px`,"--calendar-legend-line-height":`${c.legend.lineHeight}px`,"--calendar-legend-font-weight":c.legend.fontWeight,"--calendar-legend-gap":`${c.legend.gap}px`,"--calendar-legend-group-gap":`${c.legend.groupGap}px`},a=this.eventMap,d=this.legendItems,r=(this.events?.length??0)>0;return n("div",{key:"d85abe861103677565ff172def182761255eee97",class:{"sd-calendar":!0,"sd-calendar--elevated":this.elevated},style:e},n("div",{key:"2d087beb6f61c1545c61c040d7266eb809c59c56",class:"sd-calendar__header"},n("div",{key:"90b85428cd8f22aac7f0d8915a0fb0fc1ba0fd0f",class:"sd-calendar__nav-group"},n("sd-ghost-button",{key:"6a5b6c35489eeeae6d2fca4a96a77755b5d48c5a",ariaLabel:"prevYear",size:"xxs",icon:"chevronLeft",onClick:this.goPrevYear}),n("span",{key:"b00bab4993fb6f57bf1c6e8fd02243b8cbab8007",class:"sd-calendar__label"},this.currentYear),n("sd-ghost-button",{key:"1ed1ea634a311b429c6e2053c22e1d043d34aa82",ariaLabel:"nextYear",size:"xxs",icon:"chevronRight",onClick:this.goNextYear})),n("span",{key:"1d471e12d7e5a48998b33ef6c3b7208c2fff1796",class:"sd-calendar__divider","aria-hidden":"true"}),n("div",{key:"07e70fb3696cfe6bcf2253c0ead87fead96ad04e",class:"sd-calendar__nav-group sd-calendar__nav-group-month"},n("sd-ghost-button",{key:"c8401e8f8a1018eec46d9ee9857e8aa64235fff5",ariaLabel:"prevMonth",size:"xxs",icon:"chevronLeft",onClick:this.goPrevMonth}),n("span",{key:"3ceaa4a07a45eb16c43ed70e953f4540c2554ae9",class:"sd-calendar__label sd-calendar__label-month"},this.currentMonth,"월"),n("sd-ghost-button",{key:"6dd7c2c29159e549e2294141726b39c0ad559634",ariaLabel:"nextMonth",size:"xxs",icon:"chevronRight",onClick:this.goNextMonth}))),n("div",{key:"623928bc8970c2746f3d924a4ae36149ce7d21f7",class:"sd-calendar__week"},s.map((e=>n("span",{key:e,class:"sd-calendar__week-cell"},e)))),n("div",{key:"5ab1f7042906eb7542f4effa35c0c9992ded34dc",class:"sd-calendar__grid"},this.cells.map((e=>{const d=e.inCurrentMonth&&""!==this.value&&this.value===e.date,t=e.inCurrentMonth&&l===e.date,s=e.inCurrentMonth&&this.isDisabled(e.date),c=e.inCurrentMonth?a.get(e.date):void 0;return n("button",{type:"button",key:e.date,class:{"sd-calendar__day":!0,"sd-calendar__day--empty":!e.inCurrentMonth,"sd-calendar__day--today":t,"sd-calendar__day--selected":d,"sd-calendar__day--disabled":s},disabled:!e.inCurrentMonth||s,tabindex:e.inCurrentMonth?void 0:-1,"aria-hidden":e.inCurrentMonth?void 0:"true",onClick:()=>e.inCurrentMonth&&this.handleDayClick(e)},n("span",{class:"sd-calendar__day-circle"},e.inCurrentMonth?e.day:""),r&&n("span",{class:"sd-calendar__dot-row","aria-hidden":"true"},c?.map(((e,a)=>n("span",{key:`${e.color}|${e.label}|${a}`,class:"sd-calendar__dot",style:{backgroundColor:e.color}})))))}))),d.length>0&&[n("span",{key:"9d3f938ca0ac1d48ec6189a6b9f7598c06dbaf13",class:"sd-calendar__divider-bottom","aria-hidden":"true"}),n("div",{key:"1b5a55959212257085707478d7d0a358dc355403",class:"sd-calendar__legend"},d.map((e=>n("span",{key:`${e.color}|${e.label}`,class:"sd-calendar__legend-item"},n("span",{class:"sd-calendar__legend-dot",style:{backgroundColor:e.color},"aria-hidden":"true"}),n("span",{class:"sd-calendar__legend-label"},e.label)))))])}static get watchers(){return{value:[{handleValueChange:0}]}}static get style(){return"sd-calendar{display:block}sd-calendar .sd-calendar{display:flex;flex-direction:column;gap:var(--calendar-gap);width:328px;min-height:328px;padding:var(--calendar-padding);background:var(--calendar-bg);border-radius:var(--calendar-radius);user-select:none}sd-calendar .sd-calendar--elevated{box-shadow:2px 2px 12px 2px rgba(0, 0, 0, 0.2)}sd-calendar .sd-calendar__header{display:flex;align-items:center;justify-content:center;gap:var(--calendar-header-gap);font-size:var(--calendar-header-font-size);line-height:var(--calendar-header-line-height);font-weight:var(--calendar-header-font-weight);color:var(--calendar-day-text)}sd-calendar .sd-calendar__nav-group{display:inline-flex;align-items:center;gap:var(--calendar-gap)}sd-calendar .sd-calendar__nav-group-month{width:100%}sd-calendar .sd-calendar__label{display:inline-flex;align-items:center;justify-content:center;min-width:40px;text-align:center}sd-calendar .sd-calendar__label-month{width:100%}sd-calendar .sd-calendar__divider{display:inline-block;width:1px;height:16px;background:var(--calendar-header-divider)}sd-calendar .sd-calendar__week{display:grid;grid-template-columns:repeat(7, var(--calendar-day-size))}sd-calendar .sd-calendar__week-cell{display:inline-flex;align-items:center;justify-content:center;height:20px;font-size:var(--calendar-week-font-size);line-height:var(--calendar-week-line-height);font-weight:var(--calendar-week-font-weight);color:var(--calendar-week-color)}sd-calendar .sd-calendar__grid{display:grid;grid-template-columns:repeat(7, var(--calendar-day-size));row-gap:var(--calendar-grid-row-gap)}sd-calendar .sd-calendar__day{display:inline-flex;flex-direction:column;align-items:center;justify-content:flex-start;width:var(--calendar-day-size);min-height:var(--calendar-day-circle-size);padding:0;border:none;background:transparent;cursor:pointer;font-size:var(--calendar-day-font-size);line-height:var(--calendar-day-line-height);font-weight:var(--calendar-day-font-weight);color:var(--calendar-day-text)}sd-calendar .sd-calendar__day-circle{display:inline-flex;align-items:center;justify-content:center;width:var(--calendar-day-circle-size);height:var(--calendar-day-circle-size);border-radius:calc(var(--calendar-day-circle-radius) * 1px);border:1px solid transparent;box-sizing:border-box}sd-calendar .sd-calendar__day:not(:disabled):hover .sd-calendar__day-circle{border-radius:16px;border:1px solid var(--calendar-day-hover-border)}sd-calendar .sd-calendar__day--today .sd-calendar__day-circle{font-weight:700}sd-calendar .sd-calendar__day--selected .sd-calendar__day-circle{border-radius:16px;background:var(--calendar-day-select-bg);color:var(--calendar-day-select-text)}sd-calendar .sd-calendar__day--selected:not(:disabled):hover .sd-calendar__day-circle{background:var(--calendar-day-select-bg);color:var(--calendar-day-select-text)}sd-calendar .sd-calendar__day--disabled{color:var(--calendar-day-disabled-text);background:none !important;cursor:not-allowed}sd-calendar .sd-calendar__day--empty{visibility:hidden;pointer-events:none}sd-calendar .sd-calendar__dot-row{display:flex;flex-wrap:wrap;justify-content:center;gap:var(--calendar-day-dot-gap);box-sizing:border-box;width:100%;min-height:14px;padding-top:var(--calendar-day-dot-padding-y);padding-bottom:var(--calendar-day-dot-padding-y)}sd-calendar .sd-calendar__dot{display:inline-block;width:var(--calendar-day-dot-size);height:var(--calendar-day-dot-size);border-radius:50%}sd-calendar .sd-calendar__divider-bottom{display:block;width:100%;height:1px;background:var(--calendar-header-divider)}sd-calendar .sd-calendar__legend{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;column-gap:var(--calendar-legend-group-gap);row-gap:4px;font-size:var(--calendar-legend-font-size);line-height:var(--calendar-legend-line-height);font-weight:var(--calendar-legend-font-weight);color:var(--calendar-day-text)}sd-calendar .sd-calendar__legend-item{display:inline-flex;align-items:center;gap:var(--calendar-legend-gap)}sd-calendar .sd-calendar__legend-dot{display:inline-block;width:var(--calendar-day-dot-size);height:var(--calendar-day-dot-size);border-radius:50%;flex-shrink:0}sd-calendar .sd-calendar__legend-label{display:inline-block}"}},[512,"sd-calendar",{value:[1025],selectable:[16],events:[16],elevated:[4],currentYear:[32],currentMonth:[32]},void 0,{value:[{handleValueChange:0}]}]);function g(){"undefined"!=typeof customElements&&["sd-calendar","sd-ghost-button","sd-icon"].forEach((e=>{switch(e){case"sd-calendar":customElements.get(r(e))||customElements.define(r(e),h);break;case"sd-ghost-button":customElements.get(r(e))||i();break;case"sd-icon":customElements.get(r(e))||o()}}))}export{h as S,g as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as t,H as s,c as e,h as o,t as i}from"./p-siTDlOb6.js";import{d as n}from"./p-BNkExhYB.js";var r={size:"16",icon:"12"},a={size:"24",icon:"16"},d={size:"28",icon:"20"},b={size:"36",icon:"24"},c={size:"62",icon:"32"},u={sm:"4",md:"6"},h={opacity:"5%"},l={disabled:"#BBBBBB"},g={content:"#888888",hover:{bg:"#222222"}},m={content:"#E30000",hover:{bg:"#E30000"}},p={content:"#025497",hover:{bg:"#0075FF"}},f={content:"#FFFFFF",disabled:"#E1E1E1",hover:{bg:"#FFFFFF"}};const v={xxs:{size:Number(r.size),icon:Number(r.icon)},xs:{size:Number(a.size),icon:Number(a.icon)},sm:{size:Number(d.size),icon:Number(d.icon)},md:{size:Number(b.size),icon:Number(b.icon)},lg:{size:Number(c.size),icon:Number(c.icon)}},x={xxs:Number(u.sm),xs:Number(u.sm),sm:Number(u.sm),md:Number(u.md),lg:Number(u.md)},z=h.opacity,y={default:g.content,danger:m.content,action:p.content,inverse:f.content},F={default:g.hover.bg,danger:m.hover.bg,action:p.hover.bg,inverse:f.hover.bg},N=l.disabled,k={default:N,danger:N,action:N,inverse:f.disabled},E=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.click=e(this,"sdClick",7)}icon;size="sm";intent="default";ariaLabel="";disabled=!1;click;hasWarnedMissingAriaLabel=!1;componentWillLoad(){this.size??="sm",this.intent??="default",this.ariaLabel??=""}handleClick=t=>{this.disabled?t.preventDefault():this.click.emit(t)};componentWillRender(){this.warnIfMissingAriaLabel()}warnIfMissingAriaLabel(){""===(this.ariaLabel??"").trim()?this.hasWarnedMissingAriaLabel||(console.warn(`[sd-ghost-button] icon-only buttons require \`ariaLabel\`. Received icon="${this.icon}".`),this.hasWarnedMissingAriaLabel=!0):this.hasWarnedMissingAriaLabel=!1}render(){const t=this.size??"sm",s=this.intent??"default",e=v[t]??v.sm,i=this.disabled?k[s]:y[s],n=(this.ariaLabel??"").trim()||void 0;return o("button",{key:"7bf9f8b8d487be0b66a969668308fd451faeb442",class:{"sd-ghost-button":!0,"sd-ghost-button--disabled":this.disabled},type:"button",disabled:this.disabled,"aria-label":n,style:{"--sd-ghost-button-size":`${e.size}px`,"--sd-ghost-button-radius":`${x[t]}px`,"--sd-ghost-button-hover-bg":F[s],"--sd-ghost-button-hover-opacity":z,"--sd-ghost-button-accent":"#0075FF"},onClick:this.handleClick},o("sd-icon",{key:"4b6b05d186f8c38d2f05415fa24960349dd6c453",name:this.icon,size:e.icon,color:i}))}static get style(){return'sd-ghost-button{display:inline-flex;width:fit-content;height:fit-content}.sd-ghost-button{position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--sd-ghost-button-size);height:var(--sd-ghost-button-size);padding:0;border:none;border-radius:var(--sd-ghost-button-radius);background:transparent;cursor:pointer;box-sizing:border-box;transition:box-shadow 0.2s ease;-webkit-user-select:none;user-select:none}.sd-ghost-button::before{content:"";position:absolute;inset:0;border-radius:inherit;background:var(--sd-ghost-button-hover-bg);opacity:0;transition:opacity 0.2s ease;pointer-events:none}.sd-ghost-button:hover:not(.sd-ghost-button--disabled)::before{opacity:var(--sd-ghost-button-hover-opacity)}.sd-ghost-button:focus-visible{outline:0;box-shadow:0 0 0 2px var(--sd-ghost-button-accent)}.sd-ghost-button--disabled{cursor:not-allowed}'}},[512,"sd-ghost-button",{icon:[1],size:[1],intent:[1],ariaLabel:[1,"aria-label"],disabled:[4]}]);function w(){"undefined"!=typeof customElements&&["sd-ghost-button","sd-icon"].forEach((t=>{switch(t){case"sd-ghost-button":customElements.get(i(t))||customElements.define(i(t),E);break;case"sd-icon":customElements.get(i(t))||n()}}))}export{E as S,w as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e,H as s,c as t,h as i,t as a}from"./p-siTDlOb6.js";import{n as d}from"./p-CCwNgVmC.js";import{d as o,D as l,a as r}from"./p-B5XCkCeg.js";import{d as n}from"./p-DqXt80Qn.js";import{d as c}from"./p-CqcGVHzJ.js";import{d as h}from"./p-DGCbSjhn.js";import{d as p}from"./p-BS1cT5dG.js";import{d as m}from"./p-CtxH9xQc.js";import{d as b}from"./p-BNkExhYB.js";import{d as u}from"./p-Due8URWT.js";import{d as f}from"./p-PDLDFsH7.js";const g=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=r[this.size]??r.sm;return i("sd-field",{key:"12d77a181caa4a6a9125db8a5c823149386ee059",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":l.border.default,"--sd-system-color-field-border-focus":l.border.focus,"--sd-system-color-field-bg-default":l.bg.default}},i("div",{key:"2abc775817955caf06dd721d7b91c65d1bfd54de",class:"sd-date-picker",ref:e=>{this.triggerRef=e}},i("sd-date-picker-trigger",{key:"c8c041a503785e35ac4a14d902eeef0a20fa2dd7",displayText:this.value??"",placeholder:this.placeholder,disabled:this.disabled,size:this.size,onSdTriggerClick:this.handleTriggerClick})),(this.isOpen||this.isAnimatingOut)&&i("sd-portal",{key:"2c3bf831068ca090247fa4494fac6c2ce3b20e81",open:this.isOpen,parentRef:this.triggerRef,onSdClose:()=>this.closeDropdown()},i("sd-calendar",{key:"52df44d23b85540cbca17c352aba5568ff43685d",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 k(){"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-tooltip"].forEach((e=>{switch(e){case"sd-date-picker":customElements.get(a(e))||customElements.define(a(e),g);break;case"sd-button":customElements.get(a(e))||n();break;case"sd-calendar":customElements.get(a(e))||c();break;case"sd-date-picker-trigger":customElements.get(a(e))||o();break;case"sd-field":customElements.get(a(e))||h();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-tooltip":customElements.get(a(e))||f()}}))}export{g as S,k as d}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e,H as d,h as s,t as i}from"./p-siTDlOb6.js";import{f as t}from"./p-BOJJ_sQS.js";import{d as l}from"./p-DqXt80Qn.js";import{d as r}from"./p-BS1cT5dG.js";import{d as o}from"./p-BNkExhYB.js";import{d as a}from"./p-PDLDFsH7.js";const n={start:"flex-start",center:"center",end:"flex-end"},f=t.field.label.sm,h=t.field.label.md,p={sm:{height:f.height,gap:f.gap,icon:f.icon,fontSize:f.typography.fontSize,lineHeight:f.typography.lineHeight,fontWeight:f.typography.fontWeight},md:{height:h.height,gap:h.gap,icon:h.icon,fontSize:h.typography.fontSize,lineHeight:h.typography.lineHeight,fontWeight:h.typography.fontWeight}},c=["sd-input","sd-barcode-input","sd-textarea","sd-number-input","sd-select","sd-file-picker","sd-date-picker","sd-date-range-picker"],b=e(class extends d{constructor(e){super(),!1!==e&&this.__registerHost()}get el(){return this}name="";rules=[];error=!1;disabled=!1;readonly=!1;hovered=!1;focused=!1;status;hint="";errorMessage="";width="";size="sm";label="";labelWidth="";addonLabel="";addonAlign="start";icon=void 0;labelTooltip="";labelTooltipProps=null;errorMsg="";hostElement=null;get value(){return this.hostElement?.value??null}get fieldStatus(){let e="";return this.disabled?(e="disabled",`sd-field--${e}`):this.readonly?(e="readonly",`sd-field--${e}`):this.focused?(e="focus",`sd-field--${e}`):(this.hovered&&(e="hover"),void 0!==this.status&&(e=this.status),this.error&&(e="error"),""!==e?`sd-field--${e}`:"")}componentDidLoad(){this.hostElement=this.findHostElement(),this.registerToForm()}disconnectedCallback(){this.unregisterFromForm()}findHostElement(){for(const e of c){const d=this.el.closest(e);if(d&&"value"in d)return d}return null}registerToForm(){const e=this.el.closest("sd-form");e&&"function"==typeof e.componentOnReady&&e.componentOnReady().then((e=>{e.sdRegisterField(this)}))}unregisterFromForm(){if(""===this.name)return;const e=this.el.closest("sd-form");e?.componentOnReady().then((e=>{e.sdUnregisterField(this)}))}async sdValidate(){if(!this.rules||0===this.rules.length)return!0;for(const e of this.rules){const d=e(this.value??"");if(!0!==d)return this.setError(!0,d),!1}return this.setError(!1,""),!0}async sdReset(){this.hostElement&&(this.hostElement.value=null),this.setError(!1,"")}async sdResetValidation(){this.setError(!1,"")}async sdFocus(){this.hostElement?.focus?.(),this.hostElement?.scrollIntoView({behavior:"smooth",block:"center"})}setError(e,d){this.errorMsg=d,this.hostElement&&(this.hostElement.error=e)}render(){const e=this.addonLabel,d=t.field.addonLabel,i=this.size in p?this.size:"sm",l=p[i],r={"--sd-field-wrapper-height":`var(--sd-system-size-field-${i}-height)`,"--sd-field-control-radius":`var(--sd-system-radius-field-${i})`,"--sd-field-label-margin-right":`var(--sd-system-space-field-${i}-gap)`},o=""!==this.label?{"--sd-field-label-height":`${l.height}px`,"--sd-field-label-gap":`${l.gap}px`,"--sd-field-label-font-size":`${l.fontSize}px`,"--sd-field-label-line-height":`${l.lineHeight}px`,"--sd-field-label-font-weight":l.fontWeight,...""!==this.labelWidth&&0!==this.labelWidth?{"--sd-field-label-width":"number"==typeof this.labelWidth?`${this.labelWidth}px`:this.labelWidth}:{}}:{},a=""!==e?{"--sd-field-addon-padding-x":`${d.paddingX}px`,"--sd-field-addon-font-size":`${d.typography.fontSize}px`,"--sd-field-addon-line-height":`${d.typography.lineHeight}px`,"--sd-field-addon-font-weight":d.typography.fontWeight,"--sd-field-addon-bg":d.bg,"--sd-field-addon-border-color":this.disabled?d.border.disabled:d.border.default,"--sd-field-addon-gap":`${d.gap}px`,"--sd-field-addon-border-width":`${d.border.width}px`,"--sd-field-addon-justify":n[this.addonAlign]??n.start,...""!==this.labelWidth&&0!==this.labelWidth?{"--sd-field-addon-width":"number"==typeof this.labelWidth?`${this.labelWidth}px`:this.labelWidth}:{}}:{};return s("div",{key:"c6d4bc9d09982d65c31596319569590df9b994b1",class:{"sd-field":!0,"sd-field--has-label":""!==this.label,"sd-field--has-addon":""!==e,[this.fieldStatus]:""!==this.fieldStatus},style:{...r,...o,...a}},s("div",{key:"24f3e7702b3d3be42f8236988e1d64e26a31840e",class:"sd-field__wrapper"},this.renderLabel(this.label),s("div",{key:"7c45edce014adee7e2eb91296779896d9fd9fcc3",class:"sd-field__main",style:""!==this.width&&0!==this.width?{width:"number"==typeof this.width?`${this.width}px`:this.width,flex:"none"}:{}},s("div",{key:"13c99702bf11e4ff76332141a9eaff93185882d3",class:{"sd-field__control":!0,"sd-field__control--has-addon":""!==e}},e&&s("div",{key:"461170360e26e24051fab4507a22e932f5a37244",class:"sd-field__addon"},this.icon&&s("sd-icon",{key:"c8b63273a253da7911e5d8a6f57143a9cc909853",name:this.icon.name,size:this.icon.size??Number(p[this.size in p?this.size:"sm"].icon),color:this.icon.color,rotate:this.icon.rotate}),e),s("slot",{key:"3c4a72a6152c50d525df972a2a4c4d6840240116"})),""!==this.errorMsg||""!==this.errorMessage?s("div",{class:"sd-field__error-message"},""!==this.errorMsg?this.errorMsg:this.errorMessage):""!==this.hint&&s("div",{class:"sd-field__hint"},this.hint))))}renderLabel(e){return null==e||""===e?null:s("label",{class:"sd-field__label"},this.icon&&s("sd-icon",{name:this.icon.name,size:this.icon.size??Number(p[this.size in p?this.size:"sm"].icon),color:this.icon.color,rotate:this.icon.rotate,class:"sd-field__label__icon"}),s("div",{class:"sd-field__label__text"},e),this.labelTooltip&&s("sd-tooltip",{class:"sd-field__label__tooltip",...this.labelTooltipProps},this.labelTooltip))}static get style(){return"sd-field{display:inline-flex;flex-flow:column nowrap;height:fit-content;width:100%}sd-field .sd-field *:focus,sd-field .sd-field *:focus-visible,sd-field .sd-field *:focus-within{outline:none !important}sd-field .sd-field.sd-field--disabled{cursor:not-allowed}sd-field .sd-field.sd-field--disabled .sd-field__wrapper{cursor:not-allowed !important}sd-field .sd-field.sd-field--disabled .sd-field__wrapper .sd-field__label-inside{border-color:#CCCCCC;color:#888888;cursor:not-allowed !important}sd-field .sd-field.sd-field--disabled .sd-field__wrapper .sd-field__control{background-color:#E1E1E1;border-color:#CCCCCC;color:#888888;cursor:not-allowed !important}sd-field .sd-field.sd-field--readonly .sd-field__wrapper .sd-field__control{background-color:var(--sd-system-color-field-bg-read-only);color:var(--sd-system-color-field-text-read-only)}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label{display:flex;align-items:center;flex-shrink:0;width:var(--sd-field-label-width, auto);height:var(--sd-field-label-height);margin-right:var(--sd-field-label-margin-right)}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label__icon{margin-right:var(--sd-field-label-gap);flex-shrink:0}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label__text{font-size:var(--sd-field-label-font-size);line-height:var(--sd-field-label-line-height);font-weight:var(--sd-field-label-font-weight);color:var(--sd-system-color-field-text-default);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}sd-field .sd-field--has-label .sd-field__wrapper .sd-field__label__tooltip{margin-left:var(--sd-field-label-gap);flex-shrink:0}sd-field .sd-field--has-addon .sd-field__control .sd-field__addon{display:flex;gap:var(--sd-field-addon-gap);align-items:center;justify-content:var(--sd-field-addon-justify, flex-start);white-space:nowrap;box-sizing:border-box;flex-shrink:0;width:var(--sd-field-addon-width, auto);padding:0 var(--sd-field-addon-padding-x);font-size:var(--sd-field-addon-font-size);line-height:var(--sd-field-addon-line-height);font-weight:var(--sd-field-addon-font-weight);background:var(--sd-field-addon-bg);border-right:var(--sd-field-addon-border-width) solid var(--sd-field-addon-border-color);border-radius:calc(var(--sd-field-control-radius) - 1px) 0 0 calc(var(--sd-field-control-radius) - 1px)}sd-field .sd-field__wrapper{width:100%;display:flex;align-items:flex-start;flex-flow:row nowrap;position:relative;color:var(--sd-system-color-field-text-default);-webkit-user-select:none;user-select:none}sd-field .sd-field__wrapper .sd-field__main{flex:1;min-width:0;display:flex;flex-direction:column}sd-field .sd-field__wrapper .sd-field__control{position:relative;height:var(--sd-field-wrapper-height);display:flex;min-width:0;border:1px solid var(--sd-system-color-field-border-default);border-radius:var(--sd-field-control-radius);background:var(--sd-system-color-field-bg-default)}sd-field .sd-field--error .sd-field__wrapper .sd-field__control:not(:hover){border:1px solid var(--sd-system-color-field-border-danger) !important}sd-field .sd-field.sd-field--pass .sd-field__wrapper .sd-field__control{border:1px solid var(--sd-system-color-field-border-success) !important}sd-field .sd-field:not(.sd-field--disabled):not(.sd-field--readonly) .sd-field__wrapper .sd-field__control:hover{border:1px solid var(--sd-system-color-field-border-focus) !important;box-shadow:0px 0px 4px 0px rgba(0, 113, 255, 0.4)}sd-field .sd-field.sd-field--focus:not(.sd-field--readonly) .sd-field__wrapper .sd-field__control{border:1px solid var(--sd-system-color-field-border-focus) !important;box-shadow:0px 0px 4px 0px rgba(0, 113, 255, 0.4)}sd-field .sd-field .sd-field__error-message{color:var(--sd-textinput-textinput-text-error-message);font-size:var(--sd-textinput-textinput-error-message-typography-font-size);line-height:var(--sd-textinput-textinput-error-message-typography-line-height);margin-top:var(--sd-textinput-textinput-contents-gap)}sd-field .sd-field .sd-field__hint{color:var(--sd-textinput-textinput-text-hint);font-size:var(--sd-textinput-textinput-hint-typography-font-size);line-height:var(--sd-textinput-textinput-hint-typography-line-height);margin-top:var(--sd-textinput-textinput-contents-gap)}"}},[772,"sd-field",{name:[1],rules:[16],error:[1028],disabled:[1028],readonly:[1028],hovered:[1028],focused:[1028],status:[1],hint:[1],errorMessage:[1,"error-message"],width:[8],size:[513],label:[1],labelWidth:[8,"label-width"],addonLabel:[1,"addon-label"],addonAlign:[1,"addon-align"],icon:[16],labelTooltip:[1,"label-tooltip"],labelTooltipProps:[16],errorMsg:[32],sdValidate:[64],sdReset:[64],sdResetValidation:[64],sdFocus:[64]}]);function u(){"undefined"!=typeof customElements&&["sd-field","sd-button","sd-floating-portal","sd-icon","sd-tooltip"].forEach((e=>{switch(e){case"sd-field":customElements.get(i(e))||customElements.define(i(e),b);break;case"sd-button":customElements.get(i(e))||l();break;case"sd-floating-portal":customElements.get(i(e))||r();break;case"sd-icon":customElements.get(i(e))||o();break;case"sd-tooltip":customElements.get(i(e))||a()}}))}export{b as S,u as d}
|