@sellmate/design-system 1.0.75 → 1.0.76
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/index.cjs.js +5 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sd-button_4.cjs.entry.js +2 -2
- package/dist/cjs/sd-ghost-button.cjs.entry.js +10 -5
- package/dist/cjs/sd-modal-container.cjs.entry.js +76 -68
- package/dist/cjs/sd-pagination_5.cjs.entry.js +889 -0
- package/dist/cjs/sd-radio-button.cjs.entry.js +6 -1
- package/dist/cjs/sd-select-v2-list-item_4.cjs.entry.js +65 -5
- package/dist/cjs/sd-switch.cjs.entry.js +1 -1
- package/dist/cjs/sd-table.cjs.entry.js +167 -20
- package/dist/cjs/sd-tabs.cjs.entry.js +1 -1
- package/dist/cjs/sd-tag.cjs.entry.js +2 -2
- package/dist/cjs/sd-td.cjs.entry.js +53 -1
- package/dist/cjs/sd-text-link.cjs.entry.js +3 -3
- package/dist/cjs/sd-textarea.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/components/sd-ghost-button/sd-ghost-button.js +10 -5
- package/dist/collection/components/sd-modal-container/sd-modal-container.js +77 -71
- package/dist/collection/components/sd-radio-button/sd-radio-button.js +6 -1
- package/dist/collection/components/sd-select-v2/sd-select-v2-listbox/sd-select-v2-listbox.js +103 -3
- 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 +82 -4
- package/dist/collection/components/sd-switch/sd-switch.js +1 -1
- package/dist/collection/components/sd-table/sd-table.css +1 -1
- package/dist/collection/components/sd-table/sd-table.js +170 -21
- package/dist/collection/components/sd-table/sd-tbody/sd-tbody.js +7 -2
- package/dist/collection/components/sd-table/sd-td/sd-td.js +91 -1
- package/dist/collection/components/sd-table/sd-thead/sd-thead.js +9 -4
- package/dist/collection/components/sd-table/sd-tr/sd-tr.css +8 -0
- package/dist/collection/components/sd-table/sd-tr/sd-tr.js +62 -12
- package/dist/collection/components/sd-tabs/sd-tabs.js +1 -1
- 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 +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/collection/utils/modal.js +5 -0
- package/dist/components/index.js +1 -1
- package/dist/components/{p-BALOEavB.js → p-6AvsuYqF.js} +1 -1
- package/dist/components/{p-CTwEbxRN.js → p-6PsyRF61.js} +1 -1
- package/dist/components/{p-DEBakAhm.js → p-7DKZPPev.js} +1 -1
- package/dist/components/p-BBD_1E3n.js +1 -0
- package/dist/components/p-BQvugXhH.js +1 -0
- package/dist/components/p-BRfPoWUn.js +1 -0
- package/dist/components/{p-CHFGWh0m.js → p-C-BOe23n.js} +1 -1
- package/dist/components/p-C7h8lwnU.js +1 -0
- package/dist/components/{p-SDBnyM8D.js → p-CUg9NH6y.js} +1 -1
- package/dist/components/{p-C3dI7f7C.js → p-CgMyz4NQ.js} +1 -1
- package/dist/components/p-Csfj4h1A.js +1 -0
- package/dist/components/{p-Bp0B8tcl.js → p-DAC3TaZV.js} +1 -1
- package/dist/components/p-DfOYYI9m.js +1 -0
- package/dist/components/{p-H-9uoufd.js → p-d4UB2UF7.js} +1 -1
- package/dist/components/p-eEC3ITv0.js +1 -0
- package/dist/components/{p-CWEeXx2E.js → p-nVHDJc9g.js} +1 -1
- package/dist/components/{p-D8fG9Yt7.js → p-rnbt1m4L.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-chip.js +1 -1
- package/dist/components/sd-confirm-modal.js +1 -1
- package/dist/components/sd-date-picker-calendar.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-field.js +1 -1
- package/dist/components/sd-file-picker.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-modal-container.js +1 -1
- package/dist/components/sd-number-input.js +1 -1
- package/dist/components/sd-popover.js +1 -1
- package/dist/components/sd-radio-button.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-search-input.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-switch.js +1 -1
- package/dist/components/sd-table.js +1 -1
- package/dist/components/sd-tabs.js +1 -1
- package/dist/components/sd-tag.js +1 -1
- package/dist/components/sd-tbody.js +1 -1
- package/dist/components/sd-td.js +1 -1
- package/dist/components/sd-text-link.js +1 -1
- package/dist/components/sd-textarea.js +1 -1
- package/dist/components/sd-thead.js +1 -1
- package/dist/components/sd-toast-container.js +1 -1
- package/dist/components/sd-toast.js +1 -1
- package/dist/components/sd-toggle.js +1 -1
- package/dist/components/sd-tooltip.js +1 -1
- package/dist/components/sd-tr.js +1 -1
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/design-system/index.esm.js +1 -1
- package/dist/design-system/p-0e1b27cc.entry.js +1 -0
- package/dist/design-system/p-11029f6e.entry.js +1 -0
- package/dist/design-system/{p-cc62c180.entry.js → p-140b40ab.entry.js} +1 -1
- package/dist/design-system/p-34f7345b.entry.js +1 -0
- package/dist/design-system/p-363c9451.entry.js +1 -0
- package/dist/design-system/{p-fdcfaa7c.entry.js → p-506f2b68.entry.js} +1 -1
- package/dist/design-system/{p-8200b5f2.entry.js → p-531a6a82.entry.js} +1 -1
- package/dist/design-system/p-55b65a41.entry.js +1 -0
- package/dist/design-system/{p-d1dfa0e1.entry.js → p-68d0d67e.entry.js} +1 -1
- package/dist/design-system/p-7fe3a466.entry.js +1 -0
- package/dist/design-system/{p-05a1c092.entry.js → p-9466cd93.entry.js} +1 -1
- package/dist/design-system/{p-33bec0e3.entry.js → p-b683f2fe.entry.js} +1 -1
- package/dist/design-system/p-c521e731.entry.js +1 -0
- package/dist/design-system/{p-16a15368.entry.js → p-c9eb70f5.entry.js} +1 -1
- package/dist/design-system/p-d1846df9.entry.js +1 -0
- package/dist/design-system/{p-2d154fe0.entry.js → p-fdb52620.entry.js} +1 -1
- package/dist/esm/design-system.js +1 -1
- package/dist/esm/index.js +5 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sd-button_4.entry.js +2 -2
- package/dist/esm/sd-ghost-button.entry.js +10 -5
- package/dist/esm/sd-modal-container.entry.js +76 -68
- package/dist/esm/sd-pagination_5.entry.js +883 -0
- package/dist/esm/sd-radio-button.entry.js +6 -1
- package/dist/esm/sd-select-v2-list-item_4.entry.js +65 -5
- package/dist/esm/sd-switch.entry.js +1 -1
- package/dist/esm/sd-table.entry.js +168 -21
- package/dist/esm/sd-tabs.entry.js +1 -1
- package/dist/esm/sd-tag.entry.js +2 -2
- package/dist/esm/sd-td.entry.js +53 -1
- package/dist/esm/sd-text-link.entry.js +3 -3
- package/dist/esm/sd-textarea.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-ghost-button/sd-ghost-button.d.ts +1 -0
- package/dist/types/components/sd-modal-container/sd-modal-container.config.d.ts +1 -1
- package/dist/types/components/sd-modal-container/sd-modal-container.d.ts +6 -4
- package/dist/types/components/sd-radio-button/sd-radio-button.d.ts +1 -0
- package/dist/types/components/sd-select-v2/sd-select-v2-listbox/sd-select-v2-listbox.d.ts +9 -0
- package/dist/types/components/sd-select-v2/sd-select-v2.d.ts +4 -0
- package/dist/types/components/sd-table/sd-table.d.ts +17 -0
- package/dist/types/components/sd-table/sd-td/sd-td.d.ts +8 -0
- package/dist/types/components/sd-table/sd-tr/sd-tr.d.ts +4 -0
- package/dist/types/components.d.ts +52 -0
- package/hydrate/index.js +481 -141
- package/hydrate/index.mjs +481 -141
- package/package.json +1 -1
- package/dist/cjs/sd-pagination_2.cjs.entry.js +0 -427
- package/dist/cjs/sd-tbody.cjs.entry.js +0 -66
- package/dist/cjs/sd-thead.cjs.entry.js +0 -179
- package/dist/cjs/sd-tr.cjs.entry.js +0 -171
- package/dist/components/p-Bbs5Ws0k.js +0 -1
- package/dist/components/p-CgL8_FSD.js +0 -1
- package/dist/components/p-DuMkBStM.js +0 -1
- package/dist/components/p-vQDL-PZ8.js +0 -1
- package/dist/design-system/p-380198bc.entry.js +0 -1
- package/dist/design-system/p-6b537e2f.entry.js +0 -1
- package/dist/design-system/p-6e90fb80.entry.js +0 -1
- package/dist/design-system/p-7b77c65c.entry.js +0 -1
- package/dist/design-system/p-8f88bd67.entry.js +0 -1
- package/dist/design-system/p-ba5fea6f.entry.js +0 -1
- package/dist/design-system/p-be54d6bd.entry.js +0 -1
- package/dist/design-system/p-c3379a6e.entry.js +0 -1
- package/dist/design-system/p-dc07d618.entry.js +0 -1
- package/dist/design-system/p-ef09409c.entry.js +0 -1
- package/dist/design-system/p-f8237991.entry.js +0 -1
- package/dist/esm/sd-pagination_2.entry.js +0 -424
- package/dist/esm/sd-tbody.entry.js +0 -64
- package/dist/esm/sd-thead.entry.js +0 -177
- package/dist/esm/sd-tr.entry.js +0 -169
package/package.json
CHANGED
|
@@ -1,427 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-Dptupbm0.js');
|
|
4
|
-
var index$1 = require('./index-BUvXpPc3.js');
|
|
5
|
-
|
|
6
|
-
const pagination = {
|
|
7
|
-
height: "24",
|
|
8
|
-
paddingX: "6",
|
|
9
|
-
radius: "6",
|
|
10
|
-
gap: "12",
|
|
11
|
-
move: {
|
|
12
|
-
gap: "4"
|
|
13
|
-
},
|
|
14
|
-
icon: "12",
|
|
15
|
-
typography: {
|
|
16
|
-
"default": {
|
|
17
|
-
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",
|
|
18
|
-
fontSize: "12",
|
|
19
|
-
fontWeight: "500",
|
|
20
|
-
lineHeight: "20"},
|
|
21
|
-
selected: {
|
|
22
|
-
fontWeight: "700"}
|
|
23
|
-
},
|
|
24
|
-
item: {
|
|
25
|
-
bg: {
|
|
26
|
-
hover: "#EEEEEE",
|
|
27
|
-
selected: "#E6F1FF"
|
|
28
|
-
},
|
|
29
|
-
content: {
|
|
30
|
-
"default": "#555555",
|
|
31
|
-
hover: "#004290",
|
|
32
|
-
selected: "#004290"
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
var paginationTokens = {
|
|
37
|
-
pagination: pagination
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const PAGINATION_LAYOUT = {
|
|
41
|
-
height: `${paginationTokens.pagination.height}px`,
|
|
42
|
-
paddingX: `${paginationTokens.pagination.paddingX}px`,
|
|
43
|
-
radius: `${paginationTokens.pagination.radius}px`,
|
|
44
|
-
gap: `${paginationTokens.pagination.gap}px`,
|
|
45
|
-
moveGap: `${paginationTokens.pagination.move.gap}px`,
|
|
46
|
-
iconSize: Number(paginationTokens.pagination.icon),
|
|
47
|
-
};
|
|
48
|
-
const PAGINATION_TYPOGRAPHY = {
|
|
49
|
-
fontFamily: paginationTokens.pagination.typography.default.fontFamily,
|
|
50
|
-
fontSize: `${paginationTokens.pagination.typography.default.fontSize}px`,
|
|
51
|
-
lineHeight: `${paginationTokens.pagination.typography.default.lineHeight}px`,
|
|
52
|
-
fontWeightDefault: paginationTokens.pagination.typography.default.fontWeight,
|
|
53
|
-
fontWeightSelected: paginationTokens.pagination.typography.selected.fontWeight,
|
|
54
|
-
};
|
|
55
|
-
const PAGINATION_COLORS = {
|
|
56
|
-
contentDefault: paginationTokens.pagination.item.content.default,
|
|
57
|
-
contentHover: paginationTokens.pagination.item.content.hover,
|
|
58
|
-
contentSelected: paginationTokens.pagination.item.content.selected,
|
|
59
|
-
bgHover: paginationTokens.pagination.item.bg.hover,
|
|
60
|
-
bgSelected: paginationTokens.pagination.item.bg.selected,
|
|
61
|
-
// TODO: 토큰 반영 후 교체 — nav 화살표 색상은 현재 토큰에 없음
|
|
62
|
-
iconDefault: '#888888',
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const sdPaginationCss = () => `sd-pagination{display:inline-flex}.sd-pagination{display:inline-flex;align-items:center;gap:var(--sd-pagination-gap);font-family:var(--sd-pagination-font-family)}.sd-pagination__group{display:inline-flex;align-items:center;gap:var(--sd-pagination-move-gap);min-width:calc(var(--sd-pagination-height) * 2 + var(--sd-pagination-move-gap))}.sd-pagination__group--prev{justify-content:flex-end}.sd-pagination__group--next{justify-content:flex-start}.sd-pagination__numbers{display:inline-flex;align-items:center;gap:var(--sd-pagination-move-gap)}.sd-pagination__nav{display:inline-flex;align-items:center;justify-content:center;width:var(--sd-pagination-height);height:var(--sd-pagination-height);padding:0;background:transparent;border:0;border-radius:var(--sd-pagination-radius);cursor:pointer;outline:none}.sd-pagination__nav:hover{background-color:var(--sd-pagination-bg-hover)}.sd-pagination__item{display:inline-flex;align-items:center;justify-content:center;width:var(--sd-pagination-item-width);height:var(--sd-pagination-height);padding:0 var(--sd-pagination-padding-x);background:transparent;border:0;border-radius:var(--sd-pagination-radius);color:var(--sd-pagination-content);font-size:var(--sd-pagination-font-size);font-weight:var(--sd-pagination-font-weight-default);line-height:var(--sd-pagination-line-height);cursor:pointer;outline:none;box-sizing:border-box}.sd-pagination__item:hover{background-color:var(--sd-pagination-bg-hover);color:var(--sd-pagination-content-hover)}.sd-pagination__item--selected{background-color:var(--sd-pagination-bg-selected);color:var(--sd-pagination-content-selected);font-weight:var(--sd-pagination-font-weight-selected)}.sd-pagination__item--selected:hover{background-color:var(--sd-pagination-bg-selected);color:var(--sd-pagination-content-selected)}.sd-pagination__info{display:inline-flex;align-items:center;gap:var(--sd-pagination-move-gap);height:var(--sd-pagination-height);padding:0 var(--sd-pagination-padding-x);color:var(--sd-pagination-content);font-size:var(--sd-pagination-font-size);font-weight:var(--sd-pagination-font-weight-default);line-height:var(--sd-pagination-line-height)}.sd-pagination__current{color:var(--sd-pagination-content-selected);font-weight:var(--sd-pagination-font-weight-selected)}`;
|
|
66
|
-
|
|
67
|
-
const PER_PAGE = 10;
|
|
68
|
-
const BUTTON_WIDTH = {
|
|
69
|
-
1: 24,
|
|
70
|
-
2: 34,
|
|
71
|
-
3: 40,
|
|
72
|
-
4: 48,
|
|
73
|
-
5: 56,
|
|
74
|
-
};
|
|
75
|
-
const SdPagination = class {
|
|
76
|
-
constructor(hostRef) {
|
|
77
|
-
index.registerInstance(this, hostRef);
|
|
78
|
-
this.pageChange = index.createEvent(this, "sdPageChange", 7);
|
|
79
|
-
}
|
|
80
|
-
currentPage = 1;
|
|
81
|
-
lastPage = 1;
|
|
82
|
-
simple = false;
|
|
83
|
-
pageChange;
|
|
84
|
-
get pageNumbers() {
|
|
85
|
-
const start = Math.floor((this.currentPage - 1) / PER_PAGE) * PER_PAGE + 1;
|
|
86
|
-
const end = Math.min(start + PER_PAGE - 1, this.lastPage);
|
|
87
|
-
return Array.from({ length: end - start + 1 }, (_, i) => start + i);
|
|
88
|
-
}
|
|
89
|
-
get buttonWidth() {
|
|
90
|
-
const lastPageNum = this.pageNumbers.at(-1) ?? 1;
|
|
91
|
-
const maxPageLength = lastPageNum.toString().length;
|
|
92
|
-
return BUTTON_WIDTH[maxPageLength] || BUTTON_WIDTH[1];
|
|
93
|
-
}
|
|
94
|
-
get isFirstGroup() {
|
|
95
|
-
return this.currentPage <= PER_PAGE;
|
|
96
|
-
}
|
|
97
|
-
get isLastGroup() {
|
|
98
|
-
const startPageGroup = Math.floor((this.currentPage - 1) / PER_PAGE) * PER_PAGE + 1;
|
|
99
|
-
return startPageGroup + PER_PAGE - 1 >= this.lastPage;
|
|
100
|
-
}
|
|
101
|
-
handlePageChange = (page) => {
|
|
102
|
-
if (page < 1 || page > this.lastPage)
|
|
103
|
-
return;
|
|
104
|
-
this.currentPage = page;
|
|
105
|
-
this.pageChange.emit(page);
|
|
106
|
-
};
|
|
107
|
-
handleGroupChange = (direction) => {
|
|
108
|
-
const delta = direction === 'forward' ? PER_PAGE : -PER_PAGE;
|
|
109
|
-
const newPage = Math.min(Math.max(this.currentPage + delta, 1), this.lastPage);
|
|
110
|
-
this.handlePageChange(newPage);
|
|
111
|
-
};
|
|
112
|
-
renderNavButton(iconName, ariaLabel, onClick) {
|
|
113
|
-
return (index.h("button", { type: "button", class: "sd-pagination__nav", "aria-label": ariaLabel, onClick: onClick }, index.h("sd-icon", { name: iconName, size: PAGINATION_LAYOUT.iconSize, color: PAGINATION_COLORS.iconDefault })));
|
|
114
|
-
}
|
|
115
|
-
renderPrevButtons() {
|
|
116
|
-
if (this.simple) {
|
|
117
|
-
if (this.currentPage <= 1)
|
|
118
|
-
return null;
|
|
119
|
-
return (index.h(index.Fragment, null, this.renderNavButton('chevronLeftEnd', 'Go to first page', () => this.handlePageChange(1)), this.renderNavButton('chevronLeft', 'Go to previous page', () => this.handlePageChange(this.currentPage - 1))));
|
|
120
|
-
}
|
|
121
|
-
if (this.isFirstGroup)
|
|
122
|
-
return null;
|
|
123
|
-
return (index.h(index.Fragment, null, this.renderNavButton('chevronLeftEnd', 'Go to first page', () => this.handlePageChange(1)), this.renderNavButton('chevronLeft', 'Go to previous page group', () => this.handleGroupChange('backward'))));
|
|
124
|
-
}
|
|
125
|
-
renderNextButtons() {
|
|
126
|
-
if (this.simple) {
|
|
127
|
-
if (this.currentPage >= this.lastPage)
|
|
128
|
-
return null;
|
|
129
|
-
return (index.h(index.Fragment, null, this.renderNavButton('chevronRight', 'Go to next page', () => this.handlePageChange(this.currentPage + 1)), this.renderNavButton('chevronRightEnd', 'Go to last page', () => this.handlePageChange(this.lastPage))));
|
|
130
|
-
}
|
|
131
|
-
if (this.isLastGroup)
|
|
132
|
-
return null;
|
|
133
|
-
return (index.h(index.Fragment, null, this.renderNavButton('chevronRight', 'Go to next page group', () => this.handleGroupChange('forward')), this.renderNavButton('chevronRightEnd', 'Go to last page', () => this.handlePageChange(this.lastPage))));
|
|
134
|
-
}
|
|
135
|
-
render() {
|
|
136
|
-
const cssVars = {
|
|
137
|
-
'--sd-pagination-height': PAGINATION_LAYOUT.height,
|
|
138
|
-
'--sd-pagination-padding-x': PAGINATION_LAYOUT.paddingX,
|
|
139
|
-
'--sd-pagination-radius': PAGINATION_LAYOUT.radius,
|
|
140
|
-
'--sd-pagination-gap': PAGINATION_LAYOUT.gap,
|
|
141
|
-
'--sd-pagination-move-gap': PAGINATION_LAYOUT.moveGap,
|
|
142
|
-
'--sd-pagination-font-family': PAGINATION_TYPOGRAPHY.fontFamily,
|
|
143
|
-
'--sd-pagination-font-size': PAGINATION_TYPOGRAPHY.fontSize,
|
|
144
|
-
'--sd-pagination-line-height': PAGINATION_TYPOGRAPHY.lineHeight,
|
|
145
|
-
'--sd-pagination-font-weight-default': PAGINATION_TYPOGRAPHY.fontWeightDefault,
|
|
146
|
-
'--sd-pagination-font-weight-selected': PAGINATION_TYPOGRAPHY.fontWeightSelected,
|
|
147
|
-
'--sd-pagination-content': PAGINATION_COLORS.contentDefault,
|
|
148
|
-
'--sd-pagination-content-hover': PAGINATION_COLORS.contentHover,
|
|
149
|
-
'--sd-pagination-content-selected': PAGINATION_COLORS.contentSelected,
|
|
150
|
-
'--sd-pagination-bg-hover': PAGINATION_COLORS.bgHover,
|
|
151
|
-
'--sd-pagination-bg-selected': PAGINATION_COLORS.bgSelected,
|
|
152
|
-
'--sd-pagination-item-width': `${this.buttonWidth}px`,
|
|
153
|
-
};
|
|
154
|
-
return (index.h("div", { key: '386fdd2d1c0b5a7284c299201f19fd3384670ab1', class: {
|
|
155
|
-
'sd-pagination': true,
|
|
156
|
-
'sd-pagination--simple': this.simple,
|
|
157
|
-
}, style: cssVars }, index.h("div", { key: 'cd73997ae59f87b70c31e88fd5b4246bd6044bd0', class: "sd-pagination__group sd-pagination__group--prev" }, this.renderPrevButtons()), this.simple ? (index.h("div", { class: "sd-pagination__info" }, index.h("span", { class: "sd-pagination__current" }, this.currentPage), index.h("span", { class: "sd-pagination__divider" }, "/"), index.h("span", { class: "sd-pagination__last" }, this.lastPage))) : (index.h("div", { class: "sd-pagination__numbers" }, this.pageNumbers.map(n => (index.h("button", { type: "button", "aria-current": this.currentPage === n ? 'page' : undefined, class: {
|
|
158
|
-
'sd-pagination__item': true,
|
|
159
|
-
'sd-pagination__item--selected': this.currentPage === n,
|
|
160
|
-
}, onClick: () => this.handlePageChange(n) }, n))))), index.h("div", { key: '86389ea83d2965efdd938d2f9b2e2c3469f05fe8', class: "sd-pagination__group sd-pagination__group--next" }, this.renderNextButtons())));
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
SdPagination.style = sdPaginationCss();
|
|
164
|
-
|
|
165
|
-
const sdSelectV2Css = () => `sd-select-v2{display:inline-flex}sd-select-v2 sd-portal{display:none}sd-select-v2 .sd-select-v2{position:relative;width:100%;height:100%}`;
|
|
166
|
-
|
|
167
|
-
const SdSelectV2 = class {
|
|
168
|
-
constructor(hostRef) {
|
|
169
|
-
index.registerInstance(this, hostRef);
|
|
170
|
-
this.update = index.createEvent(this, "sdUpdate", 7);
|
|
171
|
-
this.dropDownShow = index.createEvent(this, "sdDropDownShow", 7);
|
|
172
|
-
}
|
|
173
|
-
static VIEWPORT_PADDING = 20;
|
|
174
|
-
static PORTAL_OFFSET_Y = 4;
|
|
175
|
-
static CLOSE_ANIMATION_DURATION = 150;
|
|
176
|
-
get el() { return index.getElement(this); }
|
|
177
|
-
type = 'default';
|
|
178
|
-
value = null;
|
|
179
|
-
options = [];
|
|
180
|
-
placeholder = '선택';
|
|
181
|
-
maxDropdownWidth = '640px';
|
|
182
|
-
dropdownHeight = '260px';
|
|
183
|
-
disabled = false;
|
|
184
|
-
label = '';
|
|
185
|
-
labelWidth = '';
|
|
186
|
-
addonLabel = '';
|
|
187
|
-
addonAlign = 'start';
|
|
188
|
-
error = false;
|
|
189
|
-
hint = '';
|
|
190
|
-
errorMessage = '';
|
|
191
|
-
rules = [];
|
|
192
|
-
icon = undefined;
|
|
193
|
-
labelTooltip = '';
|
|
194
|
-
labelTooltipProps = null;
|
|
195
|
-
emitValue = false;
|
|
196
|
-
width = '';
|
|
197
|
-
isOpen = false;
|
|
198
|
-
isAnimatingOut = false;
|
|
199
|
-
triggerWidth = '200px';
|
|
200
|
-
resolvedDropdownHeight = '260px';
|
|
201
|
-
resolvedMaxDropdownWidth = '640px';
|
|
202
|
-
focused = false;
|
|
203
|
-
hovered = false;
|
|
204
|
-
update;
|
|
205
|
-
dropDownShow;
|
|
206
|
-
async sdFocus() {
|
|
207
|
-
if (this.disabled)
|
|
208
|
-
return;
|
|
209
|
-
await this.triggerComponentRef?.sdFocus();
|
|
210
|
-
}
|
|
211
|
-
async sdOpen() {
|
|
212
|
-
// sdFocus 직후 호출 시 트리거 ref/레이아웃이 안정될 때까지 한 틱 대기
|
|
213
|
-
await new Promise(resolve => setTimeout(resolve, 0));
|
|
214
|
-
if (this.disabled || this.isOpen)
|
|
215
|
-
return;
|
|
216
|
-
this.prepareDropdownGeometry();
|
|
217
|
-
if (this.closeAnimationTimer)
|
|
218
|
-
clearTimeout(this.closeAnimationTimer);
|
|
219
|
-
this.isAnimatingOut = false;
|
|
220
|
-
this.isOpen = true;
|
|
221
|
-
}
|
|
222
|
-
triggerRef;
|
|
223
|
-
triggerComponentRef;
|
|
224
|
-
closeAnimationTimer;
|
|
225
|
-
name = index$1.nanoid();
|
|
226
|
-
triggerHasFocus = false;
|
|
227
|
-
watchIsOpen(newValue) {
|
|
228
|
-
this.syncFocusedState(newValue);
|
|
229
|
-
this.dropDownShow.emit({ isOpen: newValue });
|
|
230
|
-
}
|
|
231
|
-
get isMulti() {
|
|
232
|
-
return this.type === 'multi' || this.type === 'multi_depth';
|
|
233
|
-
}
|
|
234
|
-
get displayText() {
|
|
235
|
-
if (this.isMulti) {
|
|
236
|
-
if (!Array.isArray(this.value) || this.value.length === 0)
|
|
237
|
-
return '';
|
|
238
|
-
const flat = this.flattenOptions(this.options);
|
|
239
|
-
return this.value
|
|
240
|
-
.map(item => {
|
|
241
|
-
if (item != null && typeof item === 'object') {
|
|
242
|
-
const opt = item;
|
|
243
|
-
return opt.label ?? flat.find(o => o.value === opt.value)?.label ?? '';
|
|
244
|
-
}
|
|
245
|
-
return flat.find(o => o.value === item)?.label ?? '';
|
|
246
|
-
})
|
|
247
|
-
.filter(Boolean)
|
|
248
|
-
.join(', ');
|
|
249
|
-
}
|
|
250
|
-
if (this.value == null)
|
|
251
|
-
return '';
|
|
252
|
-
if (!this.emitValue && typeof this.value === 'object' && !Array.isArray(this.value)) {
|
|
253
|
-
return this.value.label ?? '';
|
|
254
|
-
}
|
|
255
|
-
const flat = this.flattenOptions(this.options);
|
|
256
|
-
const found = flat.find(o => o.value === this.value);
|
|
257
|
-
return found?.label ?? '';
|
|
258
|
-
}
|
|
259
|
-
flattenOptions(options) {
|
|
260
|
-
return options.flatMap(o => (o.children ? this.flattenOptions(o.children) : [o]));
|
|
261
|
-
}
|
|
262
|
-
getSelectedOptions() {
|
|
263
|
-
const val = this.value;
|
|
264
|
-
if (!val || !Array.isArray(val))
|
|
265
|
-
return [];
|
|
266
|
-
if (this.emitValue) {
|
|
267
|
-
return val
|
|
268
|
-
.map(v => this.findOriginalOption(v, this.options))
|
|
269
|
-
.filter((o) => !!o);
|
|
270
|
-
}
|
|
271
|
-
return val;
|
|
272
|
-
}
|
|
273
|
-
toMultiValue(options) {
|
|
274
|
-
return this.emitValue ? options.map(o => o.value) : options;
|
|
275
|
-
}
|
|
276
|
-
parsePixelValue(value, fallback) {
|
|
277
|
-
const parsed = Number.parseFloat(value);
|
|
278
|
-
return Number.isFinite(parsed) ? parsed : fallback;
|
|
279
|
-
}
|
|
280
|
-
updateDropdownViewportConstraints() {
|
|
281
|
-
if (!this.triggerRef)
|
|
282
|
-
return;
|
|
283
|
-
const triggerRect = this.triggerRef.getBoundingClientRect();
|
|
284
|
-
const viewportPadding = SdSelectV2.VIEWPORT_PADDING;
|
|
285
|
-
const offsetY = SdSelectV2.PORTAL_OFFSET_Y;
|
|
286
|
-
const preferredHeight = this.parsePixelValue(this.dropdownHeight, 260);
|
|
287
|
-
const preferredWidth = this.parsePixelValue(this.maxDropdownWidth, 640);
|
|
288
|
-
const availableBelow = Math.max(window.innerHeight - triggerRect.bottom - viewportPadding - offsetY, 0);
|
|
289
|
-
const availableAbove = Math.max(triggerRect.top - viewportPadding - offsetY, 0);
|
|
290
|
-
const availableHeight = Math.max(availableBelow, availableAbove);
|
|
291
|
-
const availableWidth = Math.max(window.innerWidth - viewportPadding * 2, 0);
|
|
292
|
-
this.resolvedDropdownHeight = `${Math.min(preferredHeight, availableHeight)}px`;
|
|
293
|
-
this.resolvedMaxDropdownWidth = `${Math.min(preferredWidth, availableWidth)}px`;
|
|
294
|
-
}
|
|
295
|
-
handleViewportResize = () => {
|
|
296
|
-
if (!this.isOpen)
|
|
297
|
-
return;
|
|
298
|
-
this.updateDropdownViewportConstraints();
|
|
299
|
-
};
|
|
300
|
-
findOriginalOption(value, options) {
|
|
301
|
-
for (const opt of options) {
|
|
302
|
-
if (opt.value === value)
|
|
303
|
-
return opt;
|
|
304
|
-
if (opt.children) {
|
|
305
|
-
const found = this.findOriginalOption(value, opt.children);
|
|
306
|
-
if (found)
|
|
307
|
-
return found;
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
return undefined;
|
|
311
|
-
}
|
|
312
|
-
closeDropdown() {
|
|
313
|
-
if (!this.isOpen)
|
|
314
|
-
return;
|
|
315
|
-
this.isOpen = false;
|
|
316
|
-
this.isAnimatingOut = true;
|
|
317
|
-
if (this.closeAnimationTimer)
|
|
318
|
-
clearTimeout(this.closeAnimationTimer);
|
|
319
|
-
this.closeAnimationTimer = setTimeout(() => {
|
|
320
|
-
this.isAnimatingOut = false;
|
|
321
|
-
}, SdSelectV2.CLOSE_ANIMATION_DURATION);
|
|
322
|
-
}
|
|
323
|
-
prepareDropdownGeometry() {
|
|
324
|
-
if (this.triggerRef) {
|
|
325
|
-
this.triggerWidth = `${this.triggerRef.offsetWidth}px`;
|
|
326
|
-
}
|
|
327
|
-
this.updateDropdownViewportConstraints();
|
|
328
|
-
}
|
|
329
|
-
syncFocusedState(isOpen = this.isOpen) {
|
|
330
|
-
this.focused = isOpen || this.triggerHasFocus;
|
|
331
|
-
}
|
|
332
|
-
handleTriggerFocus = () => {
|
|
333
|
-
this.triggerHasFocus = true;
|
|
334
|
-
this.syncFocusedState();
|
|
335
|
-
};
|
|
336
|
-
handleTriggerBlur = () => {
|
|
337
|
-
this.triggerHasFocus = false;
|
|
338
|
-
this.syncFocusedState();
|
|
339
|
-
};
|
|
340
|
-
handleTriggerClick = () => {
|
|
341
|
-
if (this.isOpen) {
|
|
342
|
-
this.closeDropdown();
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
this.prepareDropdownGeometry();
|
|
346
|
-
if (this.closeAnimationTimer)
|
|
347
|
-
clearTimeout(this.closeAnimationTimer);
|
|
348
|
-
this.isAnimatingOut = false;
|
|
349
|
-
this.isOpen = true;
|
|
350
|
-
};
|
|
351
|
-
emitUpdate(value) {
|
|
352
|
-
this.update.emit(value);
|
|
353
|
-
}
|
|
354
|
-
handleOptionSelect = (detail) => {
|
|
355
|
-
const { option, leaves } = detail;
|
|
356
|
-
if (this.isMulti) {
|
|
357
|
-
this.handleMultiSelect(option, leaves);
|
|
358
|
-
}
|
|
359
|
-
else {
|
|
360
|
-
this.closeDropdown();
|
|
361
|
-
this.value = this.emitValue ? option.value : option;
|
|
362
|
-
const nextValue = this.value;
|
|
363
|
-
requestAnimationFrame(() => {
|
|
364
|
-
this.emitUpdate(nextValue);
|
|
365
|
-
});
|
|
366
|
-
}
|
|
367
|
-
};
|
|
368
|
-
handleMultiSelect(option, leaves) {
|
|
369
|
-
const selected = this.getSelectedOptions();
|
|
370
|
-
const isGroup = !!option.children;
|
|
371
|
-
let newSelected;
|
|
372
|
-
if (isGroup) {
|
|
373
|
-
const allSelected = leaves.every(l => selected.some(s => s.value === l.value));
|
|
374
|
-
if (allSelected) {
|
|
375
|
-
const leafValues = new Set(leaves.map(l => l.value));
|
|
376
|
-
newSelected = selected.filter(s => !leafValues.has(s.value));
|
|
377
|
-
}
|
|
378
|
-
else {
|
|
379
|
-
const existing = new Set(selected.map(s => s.value));
|
|
380
|
-
const toAdd = leaves.filter(l => !existing.has(l.value));
|
|
381
|
-
newSelected = [...selected, ...toAdd];
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
else {
|
|
385
|
-
const exists = selected.some(s => s.value === option.value);
|
|
386
|
-
newSelected = exists ? selected.filter(s => s.value !== option.value) : [...selected, option];
|
|
387
|
-
}
|
|
388
|
-
this.value = this.toMultiValue(newSelected);
|
|
389
|
-
this.emitUpdate(this.value);
|
|
390
|
-
}
|
|
391
|
-
connectedCallback() {
|
|
392
|
-
window.addEventListener('resize', this.handleViewportResize);
|
|
393
|
-
}
|
|
394
|
-
disconnectedCallback() {
|
|
395
|
-
window.removeEventListener('resize', this.handleViewportResize);
|
|
396
|
-
if (this.closeAnimationTimer)
|
|
397
|
-
clearTimeout(this.closeAnimationTimer);
|
|
398
|
-
}
|
|
399
|
-
render() {
|
|
400
|
-
const portalProps = {
|
|
401
|
-
open: this.isOpen,
|
|
402
|
-
parentRef: this.triggerRef,
|
|
403
|
-
viewportPadding: SdSelectV2.VIEWPORT_PADDING,
|
|
404
|
-
onSdClose: () => {
|
|
405
|
-
this.closeDropdown();
|
|
406
|
-
},
|
|
407
|
-
};
|
|
408
|
-
return (index.h("sd-field", { key: '76b432c04fa0f9fca70e63e9c7d16ed768fc9dd1', 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, icon: this.icon, labelTooltip: this.labelTooltip, labelTooltipProps: this.labelTooltipProps, onMouseEnter: () => {
|
|
409
|
-
this.hovered = true;
|
|
410
|
-
}, onMouseLeave: () => {
|
|
411
|
-
this.hovered = false;
|
|
412
|
-
} }, index.h("div", { key: 'dba3a313b7e0171a441540877aacdc7d5c2e7f04', class: "sd-select-v2", ref: el => {
|
|
413
|
-
this.triggerRef = el;
|
|
414
|
-
} }, index.h("sd-select-v2-trigger", { key: '7790357558f174eb70b15ed72574f738b062c479', ref: el => {
|
|
415
|
-
this.triggerComponentRef = el;
|
|
416
|
-
}, displayText: this.displayText, placeholder: this.placeholder, disabled: this.disabled, isOpen: this.isOpen, onSdTriggerClick: this.handleTriggerClick, onSdTriggerFocus: this.handleTriggerFocus, onSdTriggerBlur: this.handleTriggerBlur })), (this.isOpen || this.isAnimatingOut) && (index.h("sd-portal", { key: '672f3583b24e363b74d184d13866ee19a78b04d9', ...portalProps }, index.h("sd-select-v2-listbox", { key: 'f71d95ad06c74356e4d5ce94da7e720c002390b6', type: this.type, options: this.options, value: this.value, emitValue: this.emitValue, triggerWidth: this.triggerWidth, maxWidth: this.resolvedMaxDropdownWidth, maxHeight: this.resolvedDropdownHeight, onSdOptionSelect: event => this.handleOptionSelect(event.detail) })))));
|
|
417
|
-
}
|
|
418
|
-
static get watchers() { return {
|
|
419
|
-
"isOpen": [{
|
|
420
|
-
"watchIsOpen": 0
|
|
421
|
-
}]
|
|
422
|
-
}; }
|
|
423
|
-
};
|
|
424
|
-
SdSelectV2.style = sdSelectV2Css();
|
|
425
|
-
|
|
426
|
-
exports.sd_pagination = SdPagination;
|
|
427
|
-
exports.sd_select_v2 = SdSelectV2;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-Dptupbm0.js');
|
|
4
|
-
var constants = require('./constants-DJRV1upE.js');
|
|
5
|
-
|
|
6
|
-
const sdTbodyCss = () => `:host{display:contents}:host *{box-sizing:border-box}.tbody{display:table-row-group}.tbody--empty .tbody__no-data-row{display:table-row}.tbody--empty .tbody__no-data-cell{display:table-cell;padding:0;border-bottom:none}`;
|
|
7
|
-
|
|
8
|
-
const SdTbody = class {
|
|
9
|
-
constructor(hostRef) {
|
|
10
|
-
index.registerInstance(this, hostRef);
|
|
11
|
-
}
|
|
12
|
-
get el() { return index.getElement(this); }
|
|
13
|
-
rows = [];
|
|
14
|
-
tableId = '';
|
|
15
|
-
topSpacerHeight = 0;
|
|
16
|
-
bottomSpacerHeight = 0;
|
|
17
|
-
tableEl = null;
|
|
18
|
-
handleRowsChange(newRows) {
|
|
19
|
-
const safeRows = newRows ?? [];
|
|
20
|
-
if (this.tableEl?.setRowCountSync) {
|
|
21
|
-
this.tableEl.setRowCountSync(safeRows.length);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
componentWillLoad() {
|
|
25
|
-
this.syncTableContext();
|
|
26
|
-
this.rows = this.rows ?? [];
|
|
27
|
-
if (this.tableEl?.setRowCountSync) {
|
|
28
|
-
this.tableEl.setRowCountSync(this.rows.length);
|
|
29
|
-
}
|
|
30
|
-
this.el.setSpacersSync = (top, bottom) => {
|
|
31
|
-
this.topSpacerHeight = top;
|
|
32
|
-
this.bottomSpacerHeight = bottom;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
componentDidLoad() {
|
|
36
|
-
this.syncTableContext();
|
|
37
|
-
}
|
|
38
|
-
syncTableContext() {
|
|
39
|
-
const table = this.el.closest('sd-table');
|
|
40
|
-
this.tableEl = table;
|
|
41
|
-
const fromMethod = table?.getTableIdSync?.();
|
|
42
|
-
const fromAttr = table?.getAttribute(constants.TABLE_ID_ATTR);
|
|
43
|
-
const resolvedTableId = (fromMethod && fromMethod !== 'undefined' ? fromMethod : null) ??
|
|
44
|
-
(fromAttr && fromAttr !== 'undefined' ? fromAttr : null) ??
|
|
45
|
-
'';
|
|
46
|
-
if (resolvedTableId && resolvedTableId !== this.tableId) {
|
|
47
|
-
this.tableId = resolvedTableId;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
render() {
|
|
51
|
-
const hasRows = this.rows.length > 0;
|
|
52
|
-
return (index.h(index.Host, { key: 'e4c64dbf97185bbc6eaec4b883c65dc8ebd34ece', slot: `${this.tableId}-body` }, index.h("tbody", { key: 'b2fb886684a5a6055d3af659bba75dd9bc801b73', class: { 'tbody': true, 'tbody--empty': !hasRows } }, hasRows ? ([
|
|
53
|
-
this.topSpacerHeight > 0 && (index.h("tr", { key: "spacer-top", class: "tbody__spacer", style: { height: `${this.topSpacerHeight}px`, display: 'block' } })),
|
|
54
|
-
index.h("slot", null),
|
|
55
|
-
this.bottomSpacerHeight > 0 && (index.h("tr", { key: "spacer-bottom", class: "tbody__spacer", style: { height: `${this.bottomSpacerHeight}px`, display: 'block' } })),
|
|
56
|
-
]) : (index.h("tr", { class: "tbody__no-data-row" }, index.h("td", { class: "tbody__no-data-cell", colSpan: 100 }, index.h("slot", { name: "no-data" })))))));
|
|
57
|
-
}
|
|
58
|
-
static get watchers() { return {
|
|
59
|
-
"rows": [{
|
|
60
|
-
"handleRowsChange": 0
|
|
61
|
-
}]
|
|
62
|
-
}; }
|
|
63
|
-
};
|
|
64
|
-
SdTbody.style = sdTbodyCss();
|
|
65
|
-
|
|
66
|
-
exports.sd_tbody = SdTbody;
|