@sellmate/design-system 1.0.47 → 1.0.48
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/{component.button-BjTPq93d.js → component.button-BKa5OPya.js} +2 -2
- package/dist/cjs/design-system.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sd-action-modal.cjs.entry.js +2 -2
- package/dist/cjs/{sd-button-v2.config-DniiNqy_.js → sd-button-v2.config-CQoTThio.js} +1 -1
- package/dist/cjs/sd-button-v2_2.cjs.entry.js +4 -4
- package/dist/cjs/sd-button_4.cjs.entry.js +3 -3
- package/dist/cjs/sd-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/sd-dropdown-button.cjs.entry.js +8 -8
- package/dist/cjs/sd-input_2.cjs.entry.js +3 -3
- package/dist/cjs/sd-loading-spinner_3.cjs.entry.js +2 -2
- package/dist/cjs/sd-number-input.cjs.entry.js +182 -50
- package/dist/cjs/sd-popover.cjs.entry.js +2 -2
- package/dist/cjs/sd-progress.cjs.entry.js +2 -2
- package/dist/cjs/sd-select-dropdown_2.cjs.entry.js +3 -3
- package/dist/cjs/sd-select-group.cjs.entry.js +1 -1
- package/dist/cjs/sd-select-multiple.cjs.entry.js +1 -1
- package/dist/cjs/sd-select-option-group.cjs.entry.js +3 -3
- package/dist/cjs/sd-select-v2-list-item_2.cjs.entry.js +5 -5
- package/dist/cjs/sd-select-v2-listbox_2.cjs.entry.js +3 -3
- package/dist/cjs/sd-select-v2.cjs.entry.js +3 -3
- package/dist/cjs/sd-tag.cjs.entry.js +26 -26
- package/dist/cjs/sd-text-link.cjs.entry.js +3 -3
- package/dist/cjs/sd-textarea.cjs.entry.js +2 -2
- 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-button.cjs.entry.js +1 -1
- package/dist/cjs/sd-toggle.cjs.entry.js +1 -1
- package/dist/collection/components/sd-action-modal/sd-action-modal.js +4 -4
- package/dist/collection/components/sd-button-v2/sd-button-v2.config.js +2 -1
- package/dist/collection/components/sd-button-v2/sd-button-v2.css +3 -1
- package/dist/collection/components/sd-button-v2/sd-button-v2.js +1 -1
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.config.js +2 -1
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.css +1 -1
- package/dist/collection/components/sd-dropdown-button/sd-dropdown-button.js +5 -5
- package/dist/collection/components/sd-number-input/sd-number-input.config.js +39 -0
- package/dist/collection/components/sd-number-input/sd-number-input.css +41 -84
- package/dist/collection/components/sd-number-input/sd-number-input.js +142 -49
- package/dist/collection/components/sd-pagination/sd-pagination.js +2 -2
- package/dist/collection/components/sd-popover/sd-popover.js +2 -2
- package/dist/collection/components/sd-progress/sd-progress.js +2 -2
- package/dist/collection/components/sd-select/sd-select-dropdown/sd-select-dropdown.js +2 -2
- package/dist/collection/components/sd-select/sd-select-option/sd-select-option.js +1 -1
- package/dist/collection/components/sd-select/sd-select-search-input/sd-select-search-input.js +3 -3
- package/dist/collection/components/sd-select-group/sd-select-group.js +1 -1
- package/dist/collection/components/sd-select-multiple/sd-select-multiple.js +1 -1
- package/dist/collection/components/sd-select-multiple-group/sd-select-option-group/sd-select-option-group.js +3 -3
- package/dist/collection/components/sd-select-v2/sd-select-v2-list-item/sd-select-v2-list-item.js +2 -2
- package/dist/collection/components/sd-select-v2/sd-select-v2-list-item-search/sd-select-v2-list-item-search.js +3 -3
- package/dist/collection/components/sd-select-v2/sd-select-v2-listbox/sd-select-v2-listbox.js +1 -1
- package/dist/collection/components/sd-select-v2/sd-select-v2-trigger/sd-select-v2-trigger.js +2 -2
- package/dist/collection/components/sd-select-v2/sd-select-v2.js +3 -3
- package/dist/collection/components/sd-tag/sd-tag.config.js +8 -8
- package/dist/collection/components/sd-tag/sd-tag.js +2 -2
- package/dist/collection/components/sd-text-link/sd-text-link.js +3 -3
- package/dist/collection/components/sd-textarea/sd-textarea.js +2 -2
- 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-toggle-button/sd-toggle-button.js +1 -1
- package/dist/collection/components/sd-tooltip/sd-tooltip.js +2 -2
- package/dist/components/{p-VgEdINd9.js → p-7tPcjtqM.js} +1 -1
- package/dist/components/{p-BdjLD8BG.js → p-B6NYLHOZ.js} +1 -1
- package/dist/components/{p-DeFPfiJf.js → p-BeZsmobQ.js} +1 -1
- package/dist/components/p-By4ufaS3.js +1 -0
- package/dist/components/{p-D1g7VL0r.js → p-CUy8ulXZ.js} +1 -1
- package/dist/components/{p-B0DS3FC2.js → p-CcixoHws.js} +1 -1
- package/dist/components/{p-CCACqlGH.js → p-CdoxVzYC.js} +1 -1
- package/dist/components/p-D73F88PI.js +1 -0
- package/dist/components/{p-D9MEHQTt.js → p-DAWMGK_A.js} +1 -1
- package/dist/components/{p-CDGHjR8K.js → p-DJScHgLW.js} +1 -1
- package/dist/components/{p-BcZ3kfAq.js → p-DNaVRB4m.js} +1 -1
- package/dist/components/p-DdjivpAF.js +1 -0
- package/dist/components/{p-Dn-uC69K.js → p-DeTDTmN7.js} +1 -1
- package/dist/components/{p-BgyCebrU.js → p-DhKZT8lW.js} +1 -1
- package/dist/components/{p-ek1GaThy.js → p-DjBok0fU.js} +1 -1
- package/dist/components/{p-Cnu8Ol-v.js → p-Dl7yIIDW.js} +1 -1
- package/dist/components/{p-DET3nB7T.js → p-DqwiOEb3.js} +1 -1
- package/dist/components/p-DwYSoCyW.js +1 -0
- package/dist/components/{p-vFrxPNO8.js → p-ZoQO0p2E.js} +1 -1
- package/dist/components/{p-pByyQ_xa.js → p-poQ9yAeD.js} +1 -1
- package/dist/components/{p-BUl_ruQ7.js → p-uWsY9w9i.js} +1 -1
- package/dist/components/sd-action-modal.js +1 -1
- package/dist/components/sd-barcode-input.js +1 -1
- package/dist/components/sd-button-v2.js +1 -1
- package/dist/components/sd-button.js +1 -1
- package/dist/components/sd-checkbox.js +1 -1
- package/dist/components/sd-confirm-modal.js +1 -1
- package/dist/components/sd-date-picker.js +1 -1
- package/dist/components/sd-date-range-picker.js +1 -1
- package/dist/components/sd-dropdown-button.js +1 -1
- package/dist/components/sd-field.js +1 -1
- package/dist/components/sd-guide.js +1 -1
- package/dist/components/sd-input.js +1 -1
- package/dist/components/sd-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-progress.js +1 -1
- package/dist/components/sd-select-dropdown.js +1 -1
- package/dist/components/sd-select-group.js +1 -1
- package/dist/components/sd-select-multiple-group.js +1 -1
- package/dist/components/sd-select-multiple.js +1 -1
- package/dist/components/sd-select-option-group.js +1 -1
- package/dist/components/sd-select-option.js +1 -1
- package/dist/components/sd-select-search-input.js +1 -1
- package/dist/components/sd-select-v2-list-item-search.js +1 -1
- package/dist/components/sd-select-v2-list-item.js +1 -1
- package/dist/components/sd-select-v2-listbox.js +1 -1
- package/dist/components/sd-select-v2-trigger.js +1 -1
- package/dist/components/sd-select-v2.js +1 -1
- package/dist/components/sd-select.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-text-link.js +1 -1
- package/dist/components/sd-textarea.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-button.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.css +1 -1
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/design-system/p-07a3c3fc.entry.js +1 -0
- package/dist/design-system/{p-f026f7f4.entry.js → p-0e0992bf.entry.js} +1 -1
- package/dist/design-system/{p-c4aea24e.entry.js → p-127445af.entry.js} +1 -1
- package/dist/design-system/{p-50bfaf92.entry.js → p-19b18e4c.entry.js} +1 -1
- package/dist/design-system/{p-49e0b0bf.entry.js → p-19e62a3d.entry.js} +1 -1
- package/dist/design-system/{p-dd67b2e0.entry.js → p-242c605c.entry.js} +1 -1
- package/dist/design-system/p-4d904e5a.entry.js +1 -0
- package/dist/design-system/{p-5f4b252c.entry.js → p-4e9abae8.entry.js} +1 -1
- package/dist/design-system/{p-3214d7c2.entry.js → p-4e9e2763.entry.js} +1 -1
- package/dist/design-system/{p-3a772b47.entry.js → p-53326ad6.entry.js} +1 -1
- package/dist/design-system/{p-c3117559.entry.js → p-833f828d.entry.js} +1 -1
- package/dist/design-system/{p-136e8453.entry.js → p-83e46793.entry.js} +1 -1
- package/dist/design-system/p-DwYSoCyW.js +1 -0
- package/dist/design-system/{p-CdOU_SOg.js → p-DzagopqQ.js} +1 -1
- package/dist/design-system/{p-f93313da.entry.js → p-ade2ed02.entry.js} +1 -1
- package/dist/design-system/p-b5d8e54d.entry.js +1 -0
- package/dist/design-system/p-bddf2246.entry.js +1 -0
- package/dist/design-system/{p-50a571f7.entry.js → p-cf641008.entry.js} +1 -1
- package/dist/design-system/{p-b113f1e2.entry.js → p-d4da5815.entry.js} +1 -1
- package/dist/design-system/p-d93c6ea8.entry.js +1 -0
- package/dist/design-system/{p-f2df591c.entry.js → p-e58e5fa2.entry.js} +1 -1
- package/dist/design-system/{p-71ea3e9e.entry.js → p-e8cb12b7.entry.js} +1 -1
- package/dist/design-system/{p-3f6de68e.entry.js → p-ee25a675.entry.js} +1 -1
- package/dist/design-system/{p-b136cc18.entry.js → p-ef654bbe.entry.js} +1 -1
- package/dist/design-system/{p-9805bf41.entry.js → p-fc235907.entry.js} +1 -1
- package/dist/design-system/p-fd2e0035.entry.js +1 -0
- package/dist/esm/{component.button-KOzU1j2w.js → component.button-DwYSoCyW.js} +2 -2
- package/dist/esm/design-system.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sd-action-modal.entry.js +2 -2
- package/dist/esm/{sd-button-v2.config-CRtF2Br0.js → sd-button-v2.config-B4Fmn4Ju.js} +1 -1
- package/dist/esm/sd-button-v2_2.entry.js +4 -4
- package/dist/esm/sd-button_4.entry.js +3 -3
- package/dist/esm/sd-checkbox.entry.js +1 -1
- package/dist/esm/sd-dropdown-button.entry.js +8 -8
- package/dist/esm/sd-input_2.entry.js +3 -3
- package/dist/esm/sd-loading-spinner_3.entry.js +2 -2
- package/dist/esm/sd-number-input.entry.js +182 -50
- package/dist/esm/sd-popover.entry.js +2 -2
- package/dist/esm/sd-progress.entry.js +2 -2
- package/dist/esm/sd-select-dropdown_2.entry.js +3 -3
- package/dist/esm/sd-select-group.entry.js +1 -1
- package/dist/esm/sd-select-multiple.entry.js +1 -1
- package/dist/esm/sd-select-option-group.entry.js +3 -3
- package/dist/esm/sd-select-v2-list-item_2.entry.js +5 -5
- package/dist/esm/sd-select-v2-listbox_2.entry.js +3 -3
- package/dist/esm/sd-select-v2.entry.js +3 -3
- package/dist/esm/sd-tag.entry.js +26 -26
- package/dist/esm/sd-text-link.entry.js +3 -3
- package/dist/esm/sd-textarea.entry.js +2 -2
- package/dist/esm/sd-toast-container.entry.js +1 -1
- package/dist/esm/sd-toast.entry.js +2 -2
- package/dist/esm/sd-toggle-button.entry.js +1 -1
- package/dist/esm/sd-toggle.entry.js +1 -1
- package/dist/types/components/sd-action-modal/sd-action-modal.d.ts +1 -1
- package/dist/types/components/sd-button-v2/sd-button-v2.config.d.ts +2 -1
- package/dist/types/components/sd-dropdown-button/sd-dropdown-button.config.d.ts +2 -1
- package/dist/types/components/sd-number-input/sd-number-input.config.d.ts +67 -0
- package/dist/types/components/sd-number-input/sd-number-input.d.ts +7 -2
- package/dist/types/components.d.ts +34 -5
- package/hydrate/index.js +298 -163
- package/hydrate/index.mjs +298 -163
- package/package.json +1 -1
- package/dist/components/p-B2GnuHlE.js +0 -1
- package/dist/components/p-BGW3nie7.js +0 -1
- package/dist/components/p-DM5hNBSY.js +0 -1
- package/dist/components/p-KOzU1j2w.js +0 -1
- package/dist/design-system/p-0c07a9be.entry.js +0 -1
- package/dist/design-system/p-KOzU1j2w.js +0 -1
- package/dist/design-system/p-a443cbef.entry.js +0 -1
- package/dist/design-system/p-a44975fc.entry.js +0 -1
- package/dist/design-system/p-b6f4369d.entry.js +0 -1
- package/dist/design-system/p-bad64f8a.entry.js +0 -1
- package/dist/design-system/p-da57a2e6.entry.js +0 -1
|
@@ -1,7 +1,114 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, g as getElement, h } from './index-B8tGP77V.js';
|
|
2
2
|
import { n as nanoid } from './index-CCwNgVmC.js';
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const numberInput = {
|
|
5
|
+
sm: {
|
|
6
|
+
height: "28",
|
|
7
|
+
paddingX: "6",
|
|
8
|
+
gap: "8",
|
|
9
|
+
radius: "4",
|
|
10
|
+
typography: {
|
|
11
|
+
fontWeight: "400",
|
|
12
|
+
fontSize: "12",
|
|
13
|
+
lineHeight: "20"}
|
|
14
|
+
},
|
|
15
|
+
md: {
|
|
16
|
+
height: "36",
|
|
17
|
+
paddingX: "8",
|
|
18
|
+
gap: "12",
|
|
19
|
+
radius: "6",
|
|
20
|
+
typography: {
|
|
21
|
+
fontWeight: "400",
|
|
22
|
+
fontSize: "16",
|
|
23
|
+
lineHeight: "26"}
|
|
24
|
+
},
|
|
25
|
+
contents: {
|
|
26
|
+
gap: "4"
|
|
27
|
+
},
|
|
28
|
+
border: {
|
|
29
|
+
"default": "#AAAAAA",
|
|
30
|
+
focus: "#0075FF",
|
|
31
|
+
danger: "#FB4444"},
|
|
32
|
+
bg: {
|
|
33
|
+
"default": "#FFFFFF"},
|
|
34
|
+
text: {
|
|
35
|
+
"default": "#222222",
|
|
36
|
+
placeholder: "#AAAAAA",
|
|
37
|
+
disabled: "#888888"
|
|
38
|
+
},
|
|
39
|
+
hint: {
|
|
40
|
+
color: "#555555",
|
|
41
|
+
typography: {
|
|
42
|
+
fontSize: "12",
|
|
43
|
+
lineHeight: "20"}
|
|
44
|
+
},
|
|
45
|
+
errorMessage: {
|
|
46
|
+
color: "#E30000",
|
|
47
|
+
typography: {
|
|
48
|
+
fontSize: "12",
|
|
49
|
+
lineHeight: "20"}
|
|
50
|
+
},
|
|
51
|
+
stepper: {
|
|
52
|
+
sm: {
|
|
53
|
+
size: "20"
|
|
54
|
+
},
|
|
55
|
+
md: {
|
|
56
|
+
size: "24"
|
|
57
|
+
},
|
|
58
|
+
radius: "4",
|
|
59
|
+
bg: {
|
|
60
|
+
"default": "#EFF6FF",
|
|
61
|
+
disabled: "#EEEEEE"
|
|
62
|
+
},
|
|
63
|
+
icon: {
|
|
64
|
+
"default": "#0075FF",
|
|
65
|
+
disabled: "#BBBBBB"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
var numberInputTokens = {
|
|
70
|
+
numberInput: numberInput
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const sm = numberInputTokens.numberInput.sm;
|
|
74
|
+
const md = numberInputTokens.numberInput.md;
|
|
75
|
+
const NUMBER_INPUT_SIZE_MAP = {
|
|
76
|
+
sm: {
|
|
77
|
+
height: sm.height,
|
|
78
|
+
paddingX: sm.paddingX,
|
|
79
|
+
gap: sm.gap,
|
|
80
|
+
radius: sm.radius,
|
|
81
|
+
fontSize: sm.typography.fontSize,
|
|
82
|
+
lineHeight: sm.typography.lineHeight,
|
|
83
|
+
fontWeight: sm.typography.fontWeight,
|
|
84
|
+
},
|
|
85
|
+
md: {
|
|
86
|
+
height: md.height,
|
|
87
|
+
paddingX: md.paddingX,
|
|
88
|
+
gap: md.gap,
|
|
89
|
+
radius: md.radius,
|
|
90
|
+
fontSize: md.typography.fontSize,
|
|
91
|
+
lineHeight: md.typography.lineHeight,
|
|
92
|
+
fontWeight: md.typography.fontWeight,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
const NUMBER_INPUT_COLORS = {
|
|
96
|
+
border: numberInputTokens.numberInput.border,
|
|
97
|
+
bg: numberInputTokens.numberInput.bg,
|
|
98
|
+
text: numberInputTokens.numberInput.text,
|
|
99
|
+
};
|
|
100
|
+
const NUMBER_INPUT_STEPPER = {
|
|
101
|
+
sm: { size: numberInputTokens.numberInput.stepper.sm.size },
|
|
102
|
+
md: { size: numberInputTokens.numberInput.stepper.md.size },
|
|
103
|
+
radius: numberInputTokens.numberInput.stepper.radius,
|
|
104
|
+
bg: numberInputTokens.numberInput.stepper.bg,
|
|
105
|
+
icon: numberInputTokens.numberInput.stepper.icon,
|
|
106
|
+
};
|
|
107
|
+
const NUMBER_INPUT_HINT = numberInputTokens.numberInput.hint;
|
|
108
|
+
const NUMBER_INPUT_ERROR_MESSAGE = numberInputTokens.numberInput.errorMessage;
|
|
109
|
+
const NUMBER_INPUT_CONTENTS_GAP = numberInputTokens.numberInput.contents.gap;
|
|
110
|
+
|
|
111
|
+
const sdNumberInputCss = () => `sd-number-input{display:inline-flex}sd-number-input .sd-number-input__content{width:100%;height:100%;display:flex;flex-flow:row nowrap;align-items:center;color:var(--sd-number-input-text-color);font-size:var(--sd-number-input-font-size);line-height:var(--sd-number-input-line-height);font-weight:var(--sd-number-input-font-weight);padding:0 var(--sd-number-input-padding-x);gap:var(--sd-number-input-gap)}sd-number-input .sd-number-input__content .sd-number-input__native{width:100%;height:100%;min-width:0;border:none;outline:none;background:transparent;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit;padding-block:0;padding-inline:0}sd-number-input .sd-number-input__content .sd-number-input__native[disabled]{cursor:not-allowed;color:var(--sd-number-input-disabled-color)}sd-number-input .sd-number-input__content .sd-number-input__native::placeholder{color:var(--sd-number-input-placeholder-color)}sd-number-input .sd-number-input__content .sd-number-input__prefix,sd-number-input .sd-number-input__content .sd-number-input__suffix{flex-shrink:0;white-space:nowrap;color:var(--sd-number-input-placeholder-color);font-size:inherit;line-height:inherit}sd-number-input .sd-number-input__content .sd-number-input__stepper{flex-shrink:0;width:var(--sd-number-input-stepper-size);height:var(--sd-number-input-stepper-size);border:none;border-radius:var(--sd-number-input-stepper-radius);background-color:var(--sd-number-input-stepper-bg);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;margin:0;transition:background-color 0.15s ease}sd-number-input .sd-number-input__content .sd-number-input__stepper:hover:not(:disabled){filter:brightness(0.95)}sd-number-input .sd-number-input__content .sd-number-input__stepper:disabled{background-color:var(--sd-number-input-stepper-bg-disabled);cursor:not-allowed}`;
|
|
5
112
|
|
|
6
113
|
const SdNumberInput = class {
|
|
7
114
|
constructor(hostRef) {
|
|
@@ -11,6 +118,7 @@ const SdNumberInput = class {
|
|
|
11
118
|
this.blur = createEvent(this, "sdBlur");
|
|
12
119
|
}
|
|
13
120
|
get el() { return getElement(this); }
|
|
121
|
+
size = 'sm';
|
|
14
122
|
min = Number.NEGATIVE_INFINITY;
|
|
15
123
|
max = Number.POSITIVE_INFINITY;
|
|
16
124
|
step = 1;
|
|
@@ -27,6 +135,8 @@ const SdNumberInput = class {
|
|
|
27
135
|
status;
|
|
28
136
|
hint = '';
|
|
29
137
|
errorMessage = '';
|
|
138
|
+
inputPrefix = '';
|
|
139
|
+
inputSuffix = '';
|
|
30
140
|
inputClass = '';
|
|
31
141
|
readonly = false;
|
|
32
142
|
inputStyle = {};
|
|
@@ -41,8 +151,18 @@ const SdNumberInput = class {
|
|
|
41
151
|
update;
|
|
42
152
|
focus;
|
|
43
153
|
blur;
|
|
154
|
+
toNumber(val) {
|
|
155
|
+
if (val === null || val === undefined || val === '')
|
|
156
|
+
return null;
|
|
157
|
+
if (typeof val === 'number')
|
|
158
|
+
return isNaN(val) ? null : val;
|
|
159
|
+
if (typeof val === 'string')
|
|
160
|
+
return this.parseInput(val);
|
|
161
|
+
const num = Number(val);
|
|
162
|
+
return isNaN(num) ? null : num;
|
|
163
|
+
}
|
|
44
164
|
formatWithCommas(value) {
|
|
45
|
-
if (value === null || value === undefined)
|
|
165
|
+
if (value === null || value === undefined || isNaN(value))
|
|
46
166
|
return '';
|
|
47
167
|
const isNegative = value < 0;
|
|
48
168
|
const absValue = Math.abs(value);
|
|
@@ -55,20 +175,20 @@ const SdNumberInput = class {
|
|
|
55
175
|
if (!input || input.trim() === '')
|
|
56
176
|
return null;
|
|
57
177
|
const cleaned = input.replace(/,/g, '').trim();
|
|
58
|
-
// -로 시작을 할 수 있을 수 있고, 소수점 0.n | .n
|
|
59
178
|
if (!/^-?(\d+\.?\d*|\d*\.\d+)$/.test(cleaned)) {
|
|
60
179
|
return null;
|
|
61
180
|
}
|
|
62
181
|
const parsed = parseFloat(cleaned);
|
|
63
182
|
if (isNaN(parsed))
|
|
64
183
|
return null;
|
|
65
|
-
// 소수점 사용 하지 않는데 . 이 있는 경우
|
|
66
184
|
if (!this.useDecimal && cleaned.includes('.')) {
|
|
67
185
|
return null;
|
|
68
186
|
}
|
|
69
187
|
return parsed;
|
|
70
188
|
}
|
|
71
189
|
clampMinMax(value) {
|
|
190
|
+
if (isNaN(value))
|
|
191
|
+
return 0;
|
|
72
192
|
return Math.min(Math.max(value, this.min), this.max);
|
|
73
193
|
}
|
|
74
194
|
updateDisplay() {
|
|
@@ -91,14 +211,12 @@ const SdNumberInput = class {
|
|
|
91
211
|
return false;
|
|
92
212
|
}
|
|
93
213
|
valueChanged(newValue) {
|
|
94
|
-
|
|
95
|
-
|
|
214
|
+
const parsed = this.toNumber(newValue);
|
|
215
|
+
if (parsed !== null) {
|
|
216
|
+
this.internalValue = this.clampMinMax(parsed);
|
|
96
217
|
}
|
|
97
218
|
else {
|
|
98
|
-
|
|
99
|
-
if (parsed !== null) {
|
|
100
|
-
this.internalValue = this.clampMinMax(parsed);
|
|
101
|
-
}
|
|
219
|
+
this.internalValue = null;
|
|
102
220
|
}
|
|
103
221
|
this.updateDisplay();
|
|
104
222
|
}
|
|
@@ -121,15 +239,21 @@ const SdNumberInput = class {
|
|
|
121
239
|
async sdFocus() {
|
|
122
240
|
this.formField?.sdFocus();
|
|
123
241
|
}
|
|
242
|
+
async sdGetNativeElement() {
|
|
243
|
+
return this.nativeEl || null;
|
|
244
|
+
}
|
|
124
245
|
componentWillLoad() {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
this.internalValue = this.clampMinMax(parsed);
|
|
129
|
-
}
|
|
246
|
+
const parsed = this.toNumber(this.value);
|
|
247
|
+
if (parsed !== null) {
|
|
248
|
+
this.internalValue = this.clampMinMax(parsed);
|
|
130
249
|
}
|
|
131
250
|
this.updateDisplay();
|
|
132
251
|
}
|
|
252
|
+
componentDidLoad() {
|
|
253
|
+
if (this.autoFocus) {
|
|
254
|
+
this.nativeEl?.focus();
|
|
255
|
+
}
|
|
256
|
+
}
|
|
133
257
|
// TODO: 현재 숫자를 크게 넣어서 숫자e+21등의 형식으로 변환되면 값이 바뀌지않음 수정 필요
|
|
134
258
|
handleInput = (event) => {
|
|
135
259
|
const target = event.target;
|
|
@@ -140,18 +264,15 @@ const SdNumberInput = class {
|
|
|
140
264
|
return;
|
|
141
265
|
}
|
|
142
266
|
const commasRemoved = inputValue.replace(/,/g, '');
|
|
143
|
-
// 만약에 소수점 (.) 이 여러개 일 경우
|
|
144
267
|
const decimalCount = (commasRemoved.match(/\./g) || []).length;
|
|
145
268
|
if (decimalCount > 1) {
|
|
146
269
|
target.value = this.displayValue;
|
|
147
270
|
return;
|
|
148
271
|
}
|
|
149
|
-
// 가능: "-", ".", "-." (단순 기호만 있는 경우)
|
|
150
272
|
if (commasRemoved === '-' || commasRemoved === '.' || commasRemoved === '-.') {
|
|
151
273
|
target.value = commasRemoved;
|
|
152
274
|
return;
|
|
153
275
|
}
|
|
154
|
-
// 숫자 뒤에 . 이 있는 경우 (예: "1000.") -> 콤마 포맷 적용 + . 유지
|
|
155
276
|
if (commasRemoved.endsWith('.') && decimalCount === 1) {
|
|
156
277
|
const numberPart = commasRemoved.slice(0, -1);
|
|
157
278
|
const parsed = this.parseInput(numberPart);
|
|
@@ -228,40 +349,51 @@ const SdNumberInput = class {
|
|
|
228
349
|
return;
|
|
229
350
|
this.internalValue = nextVal;
|
|
230
351
|
};
|
|
231
|
-
async sdGetNativeElement() {
|
|
232
|
-
return this.nativeEl || null;
|
|
233
|
-
}
|
|
234
|
-
getInputStatus() {
|
|
235
|
-
if (this.disabled)
|
|
236
|
-
return 'sd-number-input--disabled';
|
|
237
|
-
if (this.hovered)
|
|
238
|
-
return 'sd-number-input--hovered';
|
|
239
|
-
if (this.status)
|
|
240
|
-
return `sd-number-input--${this.status}`;
|
|
241
|
-
if (this.error)
|
|
242
|
-
return 'sd-number-input--error';
|
|
243
|
-
return '';
|
|
244
|
-
}
|
|
245
352
|
render() {
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
353
|
+
const sizeTokens = NUMBER_INPUT_SIZE_MAP[this.size] ?? NUMBER_INPUT_SIZE_MAP.sm;
|
|
354
|
+
const stepperSize = NUMBER_INPUT_STEPPER[this.size]?.size ?? NUMBER_INPUT_STEPPER.sm.size;
|
|
355
|
+
const iconSize = this.size === 'md' ? 14 : 12;
|
|
356
|
+
const cssVars = {
|
|
357
|
+
// 컴포넌트 로컬 토큰
|
|
358
|
+
'--sd-number-input-font-size': `${sizeTokens.fontSize}px`,
|
|
359
|
+
'--sd-number-input-line-height': `${sizeTokens.lineHeight}px`,
|
|
360
|
+
'--sd-number-input-font-weight': sizeTokens.fontWeight,
|
|
361
|
+
'--sd-number-input-padding-x': `${sizeTokens.paddingX}px`,
|
|
362
|
+
'--sd-number-input-gap': `${sizeTokens.gap}px`,
|
|
363
|
+
'--sd-number-input-text-color': NUMBER_INPUT_COLORS.text.default,
|
|
364
|
+
'--sd-number-input-placeholder-color': NUMBER_INPUT_COLORS.text.placeholder,
|
|
365
|
+
'--sd-number-input-disabled-color': NUMBER_INPUT_COLORS.text.disabled,
|
|
366
|
+
// 스테퍼 토큰
|
|
367
|
+
'--sd-number-input-stepper-size': `${stepperSize}px`,
|
|
368
|
+
'--sd-number-input-stepper-radius': `${NUMBER_INPUT_STEPPER.radius}px`,
|
|
369
|
+
'--sd-number-input-stepper-bg': NUMBER_INPUT_STEPPER.bg.default,
|
|
370
|
+
'--sd-number-input-stepper-bg-disabled': NUMBER_INPUT_STEPPER.bg.disabled,
|
|
371
|
+
'--sd-number-input-stepper-icon-color': NUMBER_INPUT_STEPPER.icon.default,
|
|
372
|
+
'--sd-number-input-stepper-icon-disabled': NUMBER_INPUT_STEPPER.icon.disabled,
|
|
373
|
+
// sd-field 시스템 변수 오버라이드
|
|
374
|
+
'--sd-system-size-field-sm-height': `${sizeTokens.height}px`,
|
|
375
|
+
'--sd-system-radius-field-sm': `${sizeTokens.radius}px`,
|
|
376
|
+
'--sd-system-color-field-border-default': NUMBER_INPUT_COLORS.border.default,
|
|
377
|
+
'--sd-system-color-field-border-focus': NUMBER_INPUT_COLORS.border.focus,
|
|
378
|
+
'--sd-system-color-field-border-danger': NUMBER_INPUT_COLORS.border.danger,
|
|
379
|
+
'--sd-system-color-field-bg-default': NUMBER_INPUT_COLORS.bg.default,
|
|
380
|
+
// 힌트/에러 메시지 오버라이드
|
|
381
|
+
'--sd-textinput-input-text-error-message': NUMBER_INPUT_ERROR_MESSAGE.color,
|
|
382
|
+
'--sd-textinput-input-error-message-typography-font-size': `${NUMBER_INPUT_ERROR_MESSAGE.typography.fontSize}px`,
|
|
383
|
+
'--sd-textinput-input-error-message-typography-line-height': `${NUMBER_INPUT_ERROR_MESSAGE.typography.lineHeight}px`,
|
|
384
|
+
'--sd-textinput-input-text-hint': NUMBER_INPUT_HINT.color,
|
|
385
|
+
'--sd-textinput-input-hint-typography-font-size': `${NUMBER_INPUT_HINT.typography.fontSize}px`,
|
|
386
|
+
'--sd-textinput-input-hint-typography-line-height': `${NUMBER_INPUT_HINT.typography.lineHeight}px`,
|
|
387
|
+
'--sd-textinput-input-contents-gap': `${NUMBER_INPUT_CONTENTS_GAP}px`,
|
|
253
388
|
};
|
|
254
|
-
return (h("sd-field", { key: '
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
'sd-number-input__button': true,
|
|
263
|
-
'sd-number-input__button--increment': true,
|
|
264
|
-
}, disabled: this.isIncrementDisabled(), onClick: this.handleIncrement, tabindex: -1 }, h("sd-icon", { key: '3b94c87f4596e18b77cc31f54e779160b422562f', name: "add", size: 12, color: this.isIncrementDisabled() ? 'grey_45' : 'brilliantblue_70' })))))));
|
|
389
|
+
return (h("sd-field", { key: '3c0c340cb1078a7f3763ee9f7339ef0cec63b020', name: this.name, label: this.label, addonLabel: this.addonLabel, 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, ref: el => (this.formField = el), onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false), style: cssVars }, h("div", { key: 'd2be35e6a7e1201436ad625f4d9678b023187666', class: "sd-number-input__content" }, this.useButton && (h("button", { key: 'd048a5c576601ff6ac61eda9613d5981b415cd53', type: "button", class: "sd-number-input__stepper sd-number-input__stepper--decrement", disabled: this.isDecrementDisabled(), onClick: this.handleDecrement, tabindex: -1 }, h("sd-icon", { key: 'e618f41dda4f8afcb52ec4dc20828adf0ddc77c3', name: "minus", size: iconSize, color: this.isDecrementDisabled()
|
|
390
|
+
? NUMBER_INPUT_STEPPER.icon.disabled
|
|
391
|
+
: NUMBER_INPUT_STEPPER.icon.default }))), this.inputPrefix && (h("span", { key: 'd293f7530b94c340af5495feaa3323f5f6d7e6bc', class: "sd-number-input__prefix" }, this.inputPrefix)), h("input", { key: '21d97799b6222f8c5f2145660d4cf25bf5fdeabe', name: this.name, ref: el => (this.nativeEl = el), class: `sd-number-input__native ${this.inputClass}`, type: "text", inputMode: "numeric", value: this.displayValue, placeholder: this.placeholder, disabled: this.disabled, readonly: this.readonly, autofocus: this.autoFocus, onInput: this.handleInput, onKeyDown: this.handleKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur, style: {
|
|
392
|
+
textAlign: this.useButton ? 'center' : 'right',
|
|
393
|
+
...this.inputStyle,
|
|
394
|
+
} }), this.inputSuffix && (h("span", { key: '2008a9aa47389bcac4df03de3e357df6f684f379', class: "sd-number-input__suffix" }, this.inputSuffix)), this.useButton && (h("button", { key: '5841af412ad228796debe31f7578fd332bf8883a', type: "button", class: "sd-number-input__stepper sd-number-input__stepper--increment", disabled: this.isIncrementDisabled(), onClick: this.handleIncrement, tabindex: -1 }, h("sd-icon", { key: 'ebc2f66dbb12664a976b36eb5b333ff7597d6d52', name: "add", size: iconSize, color: this.isIncrementDisabled()
|
|
395
|
+
? NUMBER_INPUT_STEPPER.icon.disabled
|
|
396
|
+
: NUMBER_INPUT_STEPPER.icon.default }))))));
|
|
265
397
|
}
|
|
266
398
|
static get watchers() { return {
|
|
267
399
|
"value": [{
|
|
@@ -54,14 +54,14 @@ const SdPopover = class {
|
|
|
54
54
|
this.showPopover = false;
|
|
55
55
|
};
|
|
56
56
|
render() {
|
|
57
|
-
return (h(Fragment, { key: '
|
|
57
|
+
return (h(Fragment, { key: '32543028f51799b838817a81d82c8fc4e16d34d9' }, this.label ? (h("sd-button", { ref: el => (this.buttonEl = el), label: this.label, icon: this.icon, size: this.buttonSize, color: this.color, variant: this.buttonVariant, class: "sd-popover", onSdClick: () => (this.showPopover = !this.showPopover) })) : (h("sd-icon", { ref: el => (this.buttonEl = el), name: this.icon, size: this.iconSize, color: this.color, class: "sd-popover", onClick: () => (this.showPopover = !this.showPopover) })), this.showPopover && (h("sd-floating-portal", { key: '146f7b10c48d0e43d9daad84f2b0d73a53c1f083', parentRef: this.buttonEl, onSdClose: this.handleClose, placement: this.placement, offset: this.popoverOffset }, h("div", { key: '020b1bc52cb001ef761aac5e88fdfe4a3cc1dbfc', class: {
|
|
58
58
|
'sd-floating-menu': true,
|
|
59
59
|
'sd-floating-menu--popover': true,
|
|
60
60
|
[`sd-floating-menu--${this.placement}`]: true,
|
|
61
61
|
[this.menuClass]: !!this.menuClass,
|
|
62
62
|
}, style: {
|
|
63
63
|
'--sd-floating-bg': popoverTokens.popover.bg,
|
|
64
|
-
} }, h("i", { key: '
|
|
64
|
+
} }, h("i", { key: '819af7776ce65a25c996262105b05e37d4d04652', class: `sd-floating-menu__arrow sd-floating-menu__arrow--${this.placement}` }, h(TooltipArrow, { key: '053b299c5a41acb16042adfa2aba7c35eedb0602' })), h("div", { key: '109f2b1044827112922e40b04671785209b9d816', class: "sd-floating-menu__content" }, this.menuTitle && h("div", { key: '99f49b0165ce502ba30ecac3369ba6086cbabb6f', class: "sd-floating-menu__title" }, this.menuTitle), this.messages.length > 0 && (h("div", { key: '5ecd1eea5a83c3fcf71719b308b75734ba42f96d', class: "sd-floating-menu__messages" }, this.messages.map(message => (h("div", null, message))))), this.buttons.length > 0 && (h("div", { key: '9a3a3a38dd3fac46e370f45e65dd22dbcf49bce7', class: `sd-floating-menu__buttons sd-floating-menu__buttons--${this.buttons.length}` }, this.buttons.map(button => (h("sd-button", { ...button })))))), this.useClose && (h("button", { key: '6f231ddb997a45f23c258a092b45f3d6a5e49e60', title: "close", class: "sd-floating-menu__close-button", onClick: () => this.handleClose() }, h("sd-icon", { key: '738c152ec2435992ae21394bf2c164515cef7ed9', name: "close", size: popoverTokens.popover.close.icon, color: popoverTokens.popover.close.color }))))))));
|
|
65
65
|
}
|
|
66
66
|
static get watchers() { return {
|
|
67
67
|
"show": [{
|
|
@@ -39,10 +39,10 @@ const SdProgress = class {
|
|
|
39
39
|
return this.statusColor[this.progressStatus];
|
|
40
40
|
}
|
|
41
41
|
render() {
|
|
42
|
-
return (h("div", { key: '
|
|
42
|
+
return (h("div", { key: '483f8f0ec69bc7f4bd608332eb2f87b722bc947f', style: {
|
|
43
43
|
'--progress-color': this.progressColor,
|
|
44
44
|
'--progress-percentage': `${this.progressPercentage}%`,
|
|
45
|
-
} }, this.type === 'bar' ? this.renderBarProgress() : this.renderSpinnerProgress(), this.label && h("div", { key: '
|
|
45
|
+
} }, this.type === 'bar' ? this.renderBarProgress() : this.renderSpinnerProgress(), this.label && h("div", { key: 'b4d3f1f425cd4ae96ef02a6c56671a182ab7ca09', class: "sd-progress__label" }, this.label)));
|
|
46
46
|
}
|
|
47
47
|
renderBarProgress() {
|
|
48
48
|
return (h("div", { class: `sd-progress__bar sd-progress__bar--${this.progressStatus}` }, h("div", { class: ['sd-progress__bar__percent', this.progressPercentage < 100 ? 'proceed' : ''].join(' ') }), h("div", { class: "sd-progress__bar__indicator sd-progress__bar__indicator--left" }, this.progressPercentage, "%"), h("div", { class: "sd-progress__bar__indicator sd-progress__bar__indicator--right" }, this.progressPercentage, "%")));
|
|
@@ -153,10 +153,10 @@ const SdSelectDropdown = class {
|
|
|
153
153
|
this.isScrolled = scrollTop > 0;
|
|
154
154
|
};
|
|
155
155
|
render() {
|
|
156
|
-
return (h("div", { key: '
|
|
156
|
+
return (h("div", { key: '0e45aa22a4566ec4a1a4f8dbecd2f60a024b0a34', class: {
|
|
157
157
|
'sd-select-dropdown': true,
|
|
158
158
|
'sd-select-dropdown--ready': this.isDropdownReady,
|
|
159
|
-
}, style: this.dropdownSize, onScroll: this.handleDropdownScroll, ref: el => (this.dropdownRef = el) }, this.searchable && (h("sd-select-search-input", { key: '
|
|
159
|
+
}, style: this.dropdownSize, onScroll: this.handleDropdownScroll, ref: el => (this.dropdownRef = el) }, this.searchable && (h("sd-select-search-input", { key: 'c8f63d17ec76fff2bbb36773baa2dc015396956a', ref: el => (this.searchRef = el), isScrolled: this.isScrolled, searchText: this.searchText, onSdSearchInput: (event) => (this.searchText = event.detail || ''), onSdSearchFocus: () => (this.itemIndex = -1) })), this.filteredOptions.length > 0 ? (this.filteredOptions.map((option, index) => (h("slot", { name: `option-${option.value}` }, h("sd-select-option", { option: option, index: index, isSelected: this.isOptionSelected(option.value), isFocused: index === this.itemIndex, onOptionClick: ({ detail }) => this.optionClick.emit(detail), useCheckbox: this.useCheckbox }))))) : (h("slot", { name: "option-placeholder" }, h("div", { class: 'sd-select-option-placeholder' }, this.optionPlaceholder)))));
|
|
160
160
|
}
|
|
161
161
|
static get watchers() { return {
|
|
162
162
|
"filteredOptions": [{
|
|
@@ -203,7 +203,7 @@ const SdSelectOption = class {
|
|
|
203
203
|
}
|
|
204
204
|
};
|
|
205
205
|
render() {
|
|
206
|
-
return (h("div", { key: '
|
|
206
|
+
return (h("div", { key: '1312407dd54318273dd5be025d20c992a5e8bd97', class: {
|
|
207
207
|
'sd-select__option': true,
|
|
208
208
|
'sd-select__option--selected': this.isSelected,
|
|
209
209
|
'sd-select__option--disabled': !!this.option.disabled,
|
|
@@ -273,7 +273,7 @@ const SdSelectGroup = class extends BaseDropdownEvent {
|
|
|
273
273
|
});
|
|
274
274
|
}
|
|
275
275
|
render() {
|
|
276
|
-
return (h("sd-field", { key: '
|
|
276
|
+
return (h("sd-field", { key: '7dc16e6167d57ea23971ddc60f6414c1894f4163', label: this.label, name: this.name, rules: this.rules, error: this.error, disabled: this.disabled, icon: this.icon, addonLabel: this.addonLabel, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el), style: { '--field-width': this.width || '200px' } }, h("div", { key: '470501b3bd905154bb090c11237feea3c3566fd5', class: {
|
|
277
277
|
'sd-select-group': true,
|
|
278
278
|
'sd-select-group--open': this.isOpen,
|
|
279
279
|
'sd-select-group--disabled': this.disabled,
|
|
@@ -153,7 +153,7 @@ const SdSelectMultiple = class extends BaseDropdownEvent {
|
|
|
153
153
|
this.handleOptionSelection(option);
|
|
154
154
|
};
|
|
155
155
|
render() {
|
|
156
|
-
return (h("sd-field", { key: '
|
|
156
|
+
return (h("sd-field", { key: '526a52f1fb3a8bd80a55d7094857901d7c933ca5', label: this.label, name: this.name, rules: this.rules, error: this.error, disabled: this.disabled, icon: this.icon, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, ref: el => (this.formField = el) }, h("div", { key: '1084a5740aca5ea9d27485807e7edfc276d78ba3', class: {
|
|
157
157
|
'sd-select-multiple': true,
|
|
158
158
|
'sd-select-multiple--open': this.isOpen,
|
|
159
159
|
'sd-select-multiple--disabled': this.disabled,
|
|
@@ -46,7 +46,7 @@ const SdSelectOptionGroup = class {
|
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
render() {
|
|
49
|
-
return (h("div", { key: '
|
|
49
|
+
return (h("div", { key: 'a26c5527bd3ffcf56d9811f5bca91fd859a232ea', class: {
|
|
50
50
|
'sd-select__option-group': true,
|
|
51
51
|
'sd-select__option-group--selected': !!this.isSelected,
|
|
52
52
|
'sd-select__option-group--disabled': !!this.option.disabled,
|
|
@@ -55,10 +55,10 @@ const SdSelectOptionGroup = class {
|
|
|
55
55
|
'sd-select__option-group--group': this.option.type === 'group',
|
|
56
56
|
'sd-select__option-group--subgroup': this.option.type === 'subgroup',
|
|
57
57
|
'sd-select__option-group--item': this.option.type === 'item',
|
|
58
|
-
}, onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false), style: this.optionStyle, "data-index": this.index, onClick: event => this.handleClick(this.option, this.isSelected, event) }, h("div", { key: '
|
|
58
|
+
}, onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false), style: this.optionStyle, "data-index": this.index, onClick: event => this.handleClick(this.option, this.isSelected, event) }, h("div", { key: '30ac15175f13b9cffe740052dbf18ca14753ab6d', class: "sd-select__option-group__label-wrapper" }, this.useCheckbox && (h("sd-checkbox", { key: '04a8a8a8bdc847c6c7cb757961f69e1e40161775', value: this.isSelected, disabled: this.option.disabled, onClick: e => {
|
|
59
59
|
e.preventDefault();
|
|
60
60
|
this.handleClick(this.option, this.isSelected, e);
|
|
61
|
-
} })), h("span", { key: '
|
|
61
|
+
} })), h("span", { key: 'eca4b0955a7988a1a293b709bf29dc23f9443def', class: "sd-select__option-group-label" }, this.option.label), this.useIndicator && this.option.type !== 'item' && (h("span", { key: '39e0a7a5444b9096da0d759cdb4cd0ee04bf2250', class: "sd-select__option-group__count-indicator" }, `(${this.countInfo?.selectedCount}/${this.countInfo?.totalCount})`)))));
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
SdSelectOptionGroup.style = sdSelectOptionGroupCss();
|
|
@@ -71,7 +71,7 @@ const SdSelectV2ListItem = class {
|
|
|
71
71
|
if (isDepth1Group) {
|
|
72
72
|
cssVars['--list-item-border-top'] = `${LIST_ITEM_COLORS.depth1.borderWidth}px solid ${LIST_ITEM_COLORS.depth1.border}`;
|
|
73
73
|
}
|
|
74
|
-
return (h("div", { key: '
|
|
74
|
+
return (h("div", { key: 'c84ff08d801e2775edfb55e30e11b3ec37c3e0e1', class: {
|
|
75
75
|
'sd-select-v2-list-item': true,
|
|
76
76
|
'sd-select-v2-list-item--group': isGroup,
|
|
77
77
|
'sd-select-v2-list-item--depth1-group': isDepth1Group,
|
|
@@ -81,7 +81,7 @@ const SdSelectV2ListItem = class {
|
|
|
81
81
|
'sd-select-v2-list-item--focused': this.isFocused,
|
|
82
82
|
'sd-select-v2-list-item--selectable': this.isSelectable && !this.option.disabled,
|
|
83
83
|
'sd-select-v2-list-item--disabled': !!this.option.disabled,
|
|
84
|
-
}, style: cssVars, onClick: this.handleClick }, this.useCheckbox && (h("sd-checkbox", { key: '
|
|
84
|
+
}, style: cssVars, onClick: this.handleClick }, this.useCheckbox && (h("sd-checkbox", { key: '96423d573fd7cbd158196d114ae6c81a371c2fd7', value: this.isSelected === null ? null : !!this.isSelected, disabled: this.option.disabled, class: "sd-select-v2-list-item__checkbox", onClick: this.handleCheckboxClick, onSdUpdate: this.handleCheckboxUpdate })), h("span", { key: '4745f1f61994b31b2b84fb651eb47974e9cb5f0e', class: "sd-select-v2-list-item__label" }, this.option.label), this.countInfo && (h("span", { key: '311244150b27e9aa50d4ab790bacca3552af43ae', class: "sd-select-v2-list-item__count" }, "(", this.countInfo.selected, "/", this.countInfo.total, ")"))));
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
87
|
SdSelectV2ListItem.style = sdSelectV2ListItemCss();
|
|
@@ -134,12 +134,12 @@ const SdSelectV2ListItemSearch = class {
|
|
|
134
134
|
clearTimeout(this.debounceTimer);
|
|
135
135
|
}
|
|
136
136
|
render() {
|
|
137
|
-
return (h("div", { key: '
|
|
137
|
+
return (h("div", { key: 'c09115eed7c6fc796f80aa965b64dec18caf6c49', class: {
|
|
138
138
|
'sd-select-v2-list-item-search': true,
|
|
139
139
|
'sd-select-v2-list-item-search--scrolled': this.isScrolled,
|
|
140
|
-
} }, h("div", { key: '
|
|
140
|
+
} }, h("div", { key: 'd5d4132740768db4b1e9df4f7e4e7085f5fbe408', class: "sd-select-v2-list-item-search__inner" }, h("sd-icon", { key: '428d646550ed6d3488a493f1614ba4211611c945', name: "search", size: 16, color: "grey_70", class: "sd-select-v2-list-item-search__icon" }), h("input", { key: '5fb8aea3be8de6cf81cee48667d552b8a3bd47dd', ref: el => {
|
|
141
141
|
this.inputEl = el;
|
|
142
|
-
}, type: "text", class: "sd-select-v2-list-item-search__input", placeholder: "\uAC80\uC0C9\uC5B4 \uC785\uB825", value: this.searchText, onInput: this.handleInput, onFocus: () => this.searchFocus.emit() }), this.searchText && (h("button", { key: '
|
|
142
|
+
}, type: "text", class: "sd-select-v2-list-item-search__input", placeholder: "\uAC80\uC0C9\uC5B4 \uC785\uB825", value: this.searchText, onInput: this.handleInput, onFocus: () => this.searchFocus.emit() }), this.searchText && (h("button", { key: '64178df4690ea5736c554f13d7613f172fb7ff9a', type: "button", class: "sd-select-v2-list-item-search__clear", onClick: this.handleClear }, h("sd-icon", { key: '4143f22fbfd890a39ee7149dfbc4c46e07ba259b', name: "close", size: 12, color: "#888888" }))))));
|
|
143
143
|
}
|
|
144
144
|
};
|
|
145
145
|
SdSelectV2ListItemSearch.style = sdSelectV2ListItemSearchCss();
|
|
@@ -290,7 +290,7 @@ const SdSelectV2Listbox = class {
|
|
|
290
290
|
'--listbox-radius': `${LIST_BOX_LAYOUT.radius}px`,
|
|
291
291
|
'--listbox-padding-bottom': `${LIST_BOX_LAYOUT.paddingBottom}px`,
|
|
292
292
|
};
|
|
293
|
-
return (h("div", { key: '
|
|
293
|
+
return (h("div", { key: 'b6a2e5bdc338bceb6fff14fb4dd1dff7aa5ef8d4', class: "sd-select-v2-listbox", style: cssVars }, this.showSearch && (h("sd-select-v2-list-item-search", { key: '70698ce176c33401a5846a078e56b1f20332881c', isScrolled: this.isScrolled, onSdSearchFilter: this.handleSearchFilter })), h("div", { key: 'b8106d8003dde8476b119cdde89fe4ddcaab2611', class: "sd-select-v2-listbox__list", onScroll: this.handleScroll, ref: el => {
|
|
294
294
|
this.listEl = el;
|
|
295
295
|
} }, this.isEmpty ? (h("div", { class: "sd-select-v2-listbox__empty" }, EMPTY_MESSAGE)) : this.isDepth ? (this.renderOptions(this.filteredOptions)) : (this.filteredOptions.map(option => (h("sd-select-v2-list-item", { option: option, depth: 1, isSelected: this.isOptionSelected(option), isFocused: this.isOptionFocused(option), useCheckbox: this.isMulti, onSdListItemClick: this.handleOptionClick, onMouseEnter: () => this.handleOptionHover(option) })))))));
|
|
296
296
|
}
|
|
@@ -336,11 +336,11 @@ const SdSelectV2Trigger = class {
|
|
|
336
336
|
? SELECT_COLORS.icon.disabled
|
|
337
337
|
: SELECT_COLORS.icon.default,
|
|
338
338
|
};
|
|
339
|
-
return (h("div", { key: '
|
|
339
|
+
return (h("div", { key: 'bc824455fa516812712fe2c3f5858a7afe64340a', class: {
|
|
340
340
|
'sd-select-v2-trigger': true,
|
|
341
341
|
'sd-select-v2-trigger--open': this.isOpen,
|
|
342
342
|
'sd-select-v2-trigger--disabled': this.disabled,
|
|
343
|
-
}, style: cssVars, onClick: this.handleClick }, h("div", { key: '
|
|
343
|
+
}, style: cssVars, onClick: this.handleClick }, h("div", { key: 'bf7bae47cc19b07d76dcadf118f8490a40a7b635', class: "sd-select-v2-trigger__content" }, h("span", { key: '89799c367a752c6a7403ed20801e5dc87c9f3426', class: "sd-select-v2-trigger__text" }, hasValue ? this.displayText : this.placeholder), h("sd-icon", { key: 'dac0037a8c2f3d475795786b642f7cd725358fa4', name: "chevronDown", size: 12, color: "var(--trigger-icon-color)", class: {
|
|
344
344
|
'sd-select-v2-trigger__icon': true,
|
|
345
345
|
'sd-select-v2-trigger__icon--open': this.isOpen,
|
|
346
346
|
} }))));
|
|
@@ -214,13 +214,13 @@ const SdSelectV2 = class {
|
|
|
214
214
|
this.closeDropdown();
|
|
215
215
|
},
|
|
216
216
|
};
|
|
217
|
-
return (h("sd-field", { key: '
|
|
217
|
+
return (h("sd-field", { key: '94a50bd86ecb1fdaab2e5edd816f123f985bb5e1', name: this.fieldName || this.internalName, label: this.label, addonLabel: this.addonLabel, hint: this.hint, errorMessage: this.errorMessage, width: this.width, rules: this.rules, error: this.error, disabled: this.disabled, focused: this.focused, hovered: this.hovered, icon: this.icon, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, onMouseEnter: () => {
|
|
218
218
|
this.hovered = true;
|
|
219
219
|
}, onMouseLeave: () => {
|
|
220
220
|
this.hovered = false;
|
|
221
|
-
} }, h("div", { key: '
|
|
221
|
+
} }, h("div", { key: '6986034ffd38602b111724ea998199d88bbed270', class: "sd-select-v2", ref: el => {
|
|
222
222
|
this.triggerRef = el;
|
|
223
|
-
} }, h("sd-select-v2-trigger", { key: '
|
|
223
|
+
} }, h("sd-select-v2-trigger", { key: '3af08facaebc0ec5b99ced0bb93cf8daea3367cb', displayText: this.displayText, placeholder: this.placeholder, disabled: this.disabled, isOpen: this.isOpen, onSdTriggerClick: this.handleTriggerClick })), (this.isOpen || this.isAnimatingOut) && (h("sd-portal", { key: '6fa4284cdd6d69d02a93e2e18423a7029122e58f', ...portalProps }, h("sd-select-v2-listbox", { key: '323f811ace6ee59c1d7b15ae7fa497a49b1d2f17', name: this.name, options: this.options, value: this.value, emitValue: this.emitValue, triggerWidth: this.triggerWidth, maxWidth: this.resolvedMaxDropdownWidth, maxHeight: this.resolvedDropdownHeight, onSdOptionSelect: event => this.handleOptionSelect(event.detail) })))));
|
|
224
224
|
}
|
|
225
225
|
static get watchers() { return {
|
|
226
226
|
"isOpen": [{
|
package/dist/esm/sd-tag.entry.js
CHANGED
|
@@ -35,36 +35,36 @@ const tag = {
|
|
|
35
35
|
radius: "8"
|
|
36
36
|
},
|
|
37
37
|
red: {
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
content: "#FB4444",
|
|
39
|
+
bg: "#FCEFEF"
|
|
40
40
|
},
|
|
41
41
|
orange: {
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
content: "#FF6B00",
|
|
43
|
+
bg: "#FEF1EA"
|
|
44
44
|
},
|
|
45
45
|
yellow: {
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
content: "#916C0D",
|
|
47
|
+
bg: "#FFF7DD"
|
|
48
48
|
},
|
|
49
49
|
green: {
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
content: "#00973C",
|
|
51
|
+
bg: "#E8F9EF"
|
|
52
52
|
},
|
|
53
53
|
blue: {
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
content: "#0075FF",
|
|
55
|
+
bg: "#E6F1FF"
|
|
56
56
|
},
|
|
57
57
|
darkblue: {
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
content: "#006AC1",
|
|
59
|
+
bg: "#EAF5FE"
|
|
60
60
|
},
|
|
61
61
|
indigo: {
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
content: "#004290",
|
|
63
|
+
bg: "#EFF6FF"
|
|
64
64
|
},
|
|
65
65
|
grey: {
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
content: "#737373",
|
|
67
|
+
bg: "#EEEEEE"
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
var tagTokens = {
|
|
@@ -84,14 +84,14 @@ const TAG_COLORS = [
|
|
|
84
84
|
'indigo',
|
|
85
85
|
];
|
|
86
86
|
const TAG_COLOR_CONFIG = {
|
|
87
|
-
grey: { background: tagTokens.tag.grey.
|
|
88
|
-
red: { background: tagTokens.tag.red.
|
|
89
|
-
orange: { background: tagTokens.tag.orange.
|
|
90
|
-
yellow: { background: tagTokens.tag.yellow.
|
|
91
|
-
green: { background: tagTokens.tag.green.
|
|
92
|
-
blue: { background: tagTokens.tag.blue.
|
|
93
|
-
darkblue: { background: tagTokens.tag.darkblue.
|
|
94
|
-
indigo: { background: tagTokens.tag.indigo.
|
|
87
|
+
grey: { background: tagTokens.tag.grey.bg, content: tagTokens.tag.grey.content, icon: tagTokens.tag.grey.content },
|
|
88
|
+
red: { background: tagTokens.tag.red.bg, content: tagTokens.tag.red.content, icon: tagTokens.tag.red.content },
|
|
89
|
+
orange: { background: tagTokens.tag.orange.bg, content: tagTokens.tag.orange.content, icon: tagTokens.tag.orange.content },
|
|
90
|
+
yellow: { background: tagTokens.tag.yellow.bg, content: tagTokens.tag.yellow.content, icon: tagTokens.tag.yellow.content },
|
|
91
|
+
green: { background: tagTokens.tag.green.bg, content: tagTokens.tag.green.content, icon: tagTokens.tag.green.content },
|
|
92
|
+
blue: { background: tagTokens.tag.blue.bg, content: tagTokens.tag.blue.content, icon: tagTokens.tag.blue.content },
|
|
93
|
+
darkblue: { background: tagTokens.tag.darkblue.bg, content: tagTokens.tag.darkblue.content, icon: tagTokens.tag.darkblue.content },
|
|
94
|
+
indigo: { background: tagTokens.tag.indigo.bg, content: tagTokens.tag.indigo.content, icon: tagTokens.tag.indigo.content },
|
|
95
95
|
};
|
|
96
96
|
const SQUARE_SIZE_CONFIG = {
|
|
97
97
|
xs: {
|
|
@@ -169,7 +169,7 @@ const SdTag = class {
|
|
|
169
169
|
render() {
|
|
170
170
|
const config = this.resolvedConfig;
|
|
171
171
|
const iconNode = this.renderIcon(config.icon, config.iconSize);
|
|
172
|
-
return (h("span", { key: '
|
|
172
|
+
return (h("span", { key: 'e2ea10f2795e7cb481108903609785d490046539', class: "sd-tag", style: {
|
|
173
173
|
'--sd-tag-background': config.background,
|
|
174
174
|
'--sd-tag-content': config.content,
|
|
175
175
|
'--sd-tag-height': config.height,
|
|
@@ -179,7 +179,7 @@ const SdTag = class {
|
|
|
179
179
|
'--sd-tag-font-weight': config.fontWeight,
|
|
180
180
|
'--sd-tag-line-height': config.lineHeight,
|
|
181
181
|
'--sd-tag-radius': config.radius,
|
|
182
|
-
}, "aria-label": this.label || 'tag' }, this.icon && this.isLeft && iconNode, h("span", { key: '
|
|
182
|
+
}, "aria-label": this.label || 'tag' }, this.icon && this.isLeft && iconNode, h("span", { key: '129b9791f345e368de9d19afef62f740435dd07f', class: "sd-tag__label" }, this.label), this.icon && !this.isLeft && iconNode));
|
|
183
183
|
}
|
|
184
184
|
};
|
|
185
185
|
SdTag.style = sdTagCss();
|