@sellmate/design-system 0.0.8 → 0.0.10
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 +3 -3
- package/dist/cjs/design-system.cjs.js.map +1 -1
- package/dist/cjs/{index-iB3JlG0y.js → index-D1tXBb8y.js} +5 -7
- package/dist/cjs/index-D1tXBb8y.js.map +1 -0
- package/dist/cjs/index.cjs.js +0 -121
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/resolveColor-DxvExwgo.js +272 -0
- package/dist/cjs/resolveColor-DxvExwgo.js.map +1 -0
- package/dist/cjs/sd-badge.cjs.entry.js +23 -0
- package/dist/cjs/sd-badge.entry.cjs.js.map +1 -0
- package/dist/cjs/sd-button.sd-guide.sd-icon.sd-portal.entry.cjs.js.map +1 -1
- package/dist/cjs/sd-button_4.cjs.entry.js +51 -315
- package/dist/cjs/sd-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/sd-date-box_2.cjs.entry.js +3 -3
- package/dist/cjs/sd-date-picker.cjs.entry.js +3 -3
- package/dist/cjs/sd-date-range-picker.cjs.entry.js +3 -3
- package/dist/cjs/sd-pagination_2.cjs.entry.js +6 -6
- package/dist/cjs/sd-popover.cjs.entry.js +4 -4
- package/dist/cjs/sd-select-option.cjs.entry.js +2 -2
- package/dist/cjs/sd-select.cjs.entry.js +1 -1
- package/dist/cjs/sd-table.cjs.entry.js +1 -1
- package/dist/cjs/sd-tag.cjs.entry.js +1 -1
- package/dist/cjs/sd-tooltip-portal.cjs.entry.js +2 -2
- package/dist/cjs/{tooltipArrow-CSLQDjwL.js → tooltipArrow-D4Vc_pEU.js} +3 -3
- package/dist/cjs/{tooltipArrow-CSLQDjwL.js.map → tooltipArrow-D4Vc_pEU.js.map} +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/sd-badge/sd-badge.css +1386 -0
- package/dist/collection/components/sd-badge/sd-badge.js +88 -0
- package/dist/collection/components/sd-badge/sd-badge.js.map +1 -0
- package/dist/collection/components/sd-checkbox/sd-checkbox.js +1 -1
- 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.js +2 -2
- package/dist/collection/components/sd-guide/sd-guide.js +2 -2
- package/dist/collection/components/sd-icon/sd-icon.js +1 -1
- package/dist/collection/components/sd-input/sd-input.js +2 -2
- package/dist/collection/components/sd-pagination/sd-pagination.js +2 -2
- package/dist/collection/components/sd-popover/sd-popover.js +2 -2
- package/dist/collection/components/sd-portal/sd-portal.js +1 -1
- package/dist/collection/components/sd-select/sd-select-option/sd-select-option.js +1 -1
- package/dist/collection/components/sd-tooltip/sd-tooltip.js +2 -2
- package/dist/collection/components/sd-tooltip-portal/sd-tooltip-portal.js +1 -1
- package/dist/collection/index.js +0 -4
- package/dist/collection/index.js.map +1 -1
- package/dist/components/index.js +2 -115
- package/dist/components/index.js.map +1 -1
- package/dist/components/{p-B0--8AFP.js → p-0rgiptJp.js} +7 -271
- package/dist/components/p-0rgiptJp.js.map +1 -0
- package/dist/components/{p-BVQq85Sb.js → p-6-oOxxG7.js} +5 -5
- package/dist/components/{p-BVQq85Sb.js.map → p-6-oOxxG7.js.map} +1 -1
- package/dist/components/{p-CwAyLWEQ.js → p-8_DE9sf7.js} +7 -7
- package/dist/components/{p-CwAyLWEQ.js.map → p-8_DE9sf7.js.map} +1 -1
- package/dist/components/{p-CIRxuq9O.js → p-BEEv43du.js} +5 -5
- package/dist/components/{p-CIRxuq9O.js.map → p-BEEv43du.js.map} +1 -1
- package/dist/components/{p-CvQARSF2.js → p-BFclKl59.js} +7 -7
- package/dist/components/{p-CvQARSF2.js.map → p-BFclKl59.js.map} +1 -1
- package/dist/components/{p-B3-UiLOb.js → p-BQR8GTeD.js} +4 -4
- package/dist/components/{p-B3-UiLOb.js.map → p-BQR8GTeD.js.map} +1 -1
- package/dist/components/{p-Cwa0Scin.js → p-BV65zDeF.js} +6 -5
- package/dist/components/p-BV65zDeF.js.map +1 -0
- package/dist/components/p-BYf-ybt2.js +269 -0
- package/dist/components/p-BYf-ybt2.js.map +1 -0
- package/dist/components/{p-CmjvNSNS.js → p-Bws0p2kF.js} +3 -3
- package/dist/components/{p-CmjvNSNS.js.map → p-Bws0p2kF.js.map} +1 -1
- package/dist/components/{p-D_I5tXD6.js → p-CLODAhOA.js} +6 -8
- package/dist/components/p-CLODAhOA.js.map +1 -0
- package/dist/components/{p-DyncZo9Q.js → p-Cf1_Ckwe.js} +10 -10
- package/dist/components/{p-DyncZo9Q.js.map → p-Cf1_Ckwe.js.map} +1 -1
- package/dist/components/{p-Dg9QFKjM.js → p-DCdQLHpa.js} +7 -7
- package/dist/components/{p-Dg9QFKjM.js.map → p-DCdQLHpa.js.map} +1 -1
- package/dist/components/{p-BrGg4-IA.js → p-Dy4OXsOy.js} +6 -6
- package/dist/components/{p-BrGg4-IA.js.map → p-Dy4OXsOy.js.map} +1 -1
- package/dist/components/sd-badge.d.ts +11 -0
- package/dist/components/sd-badge.js +46 -0
- package/dist/components/sd-badge.js.map +1 -0
- package/dist/components/sd-button.js +1 -1
- package/dist/components/sd-checkbox.js +1 -1
- package/dist/components/sd-date-box.js +1 -1
- package/dist/components/sd-date-picker.js +8 -8
- package/dist/components/sd-date-range-picker.js +8 -8
- package/dist/components/sd-guide.js +8 -7
- package/dist/components/sd-guide.js.map +1 -1
- package/dist/components/sd-icon.js +1 -1
- package/dist/components/sd-input.js +1 -1
- package/dist/components/sd-pagination.js +1 -1
- package/dist/components/sd-popover.js +8 -8
- package/dist/components/sd-portal.js +1 -1
- package/dist/components/sd-select-option.js +1 -1
- package/dist/components/sd-select.js +7 -7
- package/dist/components/sd-table.js +8 -8
- package/dist/components/sd-tag.js +2 -2
- package/dist/components/sd-tooltip-portal.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/design-system.esm.js.map +1 -1
- package/dist/design-system/index.esm.js +1 -1
- package/dist/design-system/index.esm.js.map +1 -1
- package/dist/design-system/{p-12aaaa03.entry.js → p-1c85c36d.entry.js} +2 -2
- package/dist/design-system/p-308edd31.entry.js +2 -0
- package/dist/design-system/p-308edd31.entry.js.map +1 -0
- package/dist/design-system/p-7b32ab16.entry.js +2 -0
- package/dist/design-system/{p-997af0ed.entry.js.map → p-7b32ab16.entry.js.map} +1 -1
- package/dist/design-system/{p-7e33f5e5.entry.js → p-8ac68037.entry.js} +2 -2
- package/dist/design-system/{p-1f393066.entry.js → p-97900de1.entry.js} +2 -2
- package/dist/design-system/{p-2bb928fc.entry.js → p-9cc14b6e.entry.js} +2 -2
- package/dist/design-system/p-BYf-ybt2.js +2 -0
- package/dist/design-system/p-BYf-ybt2.js.map +1 -0
- package/dist/design-system/p-D8LjiNqp.js +2 -0
- package/dist/design-system/{p-DMW6VeLX.js.map → p-D8LjiNqp.js.map} +1 -1
- package/dist/design-system/{p-DVhJrGoi.js → p-DON0UcbL.js} +2 -2
- package/dist/design-system/p-DON0UcbL.js.map +1 -0
- package/dist/design-system/{p-c87c465b.entry.js → p-acf8aec2.entry.js} +2 -2
- package/dist/design-system/{p-912c7a8d.entry.js → p-b24ace19.entry.js} +2 -2
- package/dist/design-system/{p-8b2b47a7.entry.js → p-b2516c36.entry.js} +2 -2
- package/dist/design-system/p-cb0d8ecc.entry.js +2 -0
- package/dist/design-system/p-cb0d8ecc.entry.js.map +1 -0
- package/dist/design-system/{p-97dbc008.entry.js → p-d4395043.entry.js} +2 -2
- package/dist/design-system/{p-5db3252c.entry.js → p-dfbbde69.entry.js} +2 -2
- package/dist/design-system/{p-682cf57d.entry.js → p-ef6a088a.entry.js} +2 -2
- package/dist/design-system/sd-badge.entry.esm.js.map +1 -0
- package/dist/design-system/sd-button.sd-guide.sd-icon.sd-portal.entry.esm.js.map +1 -1
- package/dist/esm/design-system.js +4 -4
- package/dist/esm/design-system.js.map +1 -1
- package/dist/esm/{index-DVhJrGoi.js → index-DON0UcbL.js} +5 -7
- package/dist/esm/index-DON0UcbL.js.map +1 -0
- package/dist/esm/index.js +1 -114
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/resolveColor-BYf-ybt2.js +269 -0
- package/dist/esm/resolveColor-BYf-ybt2.js.map +1 -0
- package/dist/esm/sd-badge.entry.js +21 -0
- package/dist/esm/sd-badge.entry.js.map +1 -0
- package/dist/esm/sd-button.sd-guide.sd-icon.sd-portal.entry.js.map +1 -1
- package/dist/esm/sd-button_4.entry.js +49 -313
- package/dist/esm/sd-checkbox.entry.js +2 -2
- package/dist/esm/sd-date-box_2.entry.js +3 -3
- package/dist/esm/sd-date-picker.entry.js +3 -3
- package/dist/esm/sd-date-range-picker.entry.js +3 -3
- package/dist/esm/sd-pagination_2.entry.js +6 -6
- package/dist/esm/sd-popover.entry.js +4 -4
- package/dist/esm/sd-select-option.entry.js +2 -2
- package/dist/esm/sd-select.entry.js +1 -1
- package/dist/esm/sd-table.entry.js +1 -1
- package/dist/esm/sd-tag.entry.js +1 -1
- package/dist/esm/sd-tooltip-portal.entry.js +2 -2
- package/dist/esm/{tooltipArrow-BZiofDi8.js → tooltipArrow-Dv8Sb6cw.js} +3 -3
- package/dist/esm/{tooltipArrow-BZiofDi8.js.map → tooltipArrow-Dv8Sb6cw.js.map} +1 -1
- package/dist/types/components/sd-badge/sd-badge.d.ts +6 -0
- package/dist/types/components.d.ts +37 -0
- package/dist/types/index.d.ts +0 -2
- package/dist/types/stencil-public-runtime.d.ts +1 -1
- package/hydrate/index.js +69 -40
- package/hydrate/index.mjs +69 -40
- package/package.json +2 -2
- package/dist/cjs/index-Cbd_FIth.js +0 -21891
- package/dist/cjs/index-Cbd_FIth.js.map +0 -1
- package/dist/cjs/index-DoEgM-7l.js +0 -2586
- package/dist/cjs/index-DoEgM-7l.js.map +0 -1
- package/dist/cjs/index-iB3JlG0y.js.map +0 -1
- package/dist/collection/utils/next-hydrate.js +0 -52
- package/dist/collection/utils/next-hydrate.js.map +0 -1
- package/dist/collection/utils/next-react-wrapper.js +0 -61
- package/dist/collection/utils/next-react-wrapper.js.map +0 -1
- package/dist/components/p-B0--8AFP.js.map +0 -1
- package/dist/components/p-BjTJkvEh.js +0 -21889
- package/dist/components/p-BjTJkvEh.js.map +0 -1
- package/dist/components/p-Cwa0Scin.js.map +0 -1
- package/dist/components/p-D_I5tXD6.js.map +0 -1
- package/dist/components/p-dBol_ZO8.js +0 -2584
- package/dist/components/p-dBol_ZO8.js.map +0 -1
- package/dist/design-system/p-997af0ed.entry.js +0 -2
- package/dist/design-system/p-BjTJkvEh.js +0 -23
- package/dist/design-system/p-BjTJkvEh.js.map +0 -1
- package/dist/design-system/p-DMW6VeLX.js +0 -2
- package/dist/design-system/p-DVhJrGoi.js.map +0 -1
- package/dist/design-system/p-dBol_ZO8.js +0 -3
- package/dist/design-system/p-dBol_ZO8.js.map +0 -1
- package/dist/design-system/p-e40ff66a.entry.js +0 -2
- package/dist/design-system/p-e40ff66a.entry.js.map +0 -1
- package/dist/esm/index-BjTJkvEh.js +0 -21889
- package/dist/esm/index-BjTJkvEh.js.map +0 -1
- package/dist/esm/index-DVhJrGoi.js.map +0 -1
- package/dist/esm/index-dBol_ZO8.js +0 -2584
- package/dist/esm/index-dBol_ZO8.js.map +0 -1
- package/dist/types/utils/next-hydrate.d.ts +0 -18
- package/dist/types/utils/next-react-wrapper.d.ts +0 -23
- /package/dist/design-system/{p-12aaaa03.entry.js.map → p-1c85c36d.entry.js.map} +0 -0
- /package/dist/design-system/{p-7e33f5e5.entry.js.map → p-8ac68037.entry.js.map} +0 -0
- /package/dist/design-system/{p-1f393066.entry.js.map → p-97900de1.entry.js.map} +0 -0
- /package/dist/design-system/{p-2bb928fc.entry.js.map → p-9cc14b6e.entry.js.map} +0 -0
- /package/dist/design-system/{p-c87c465b.entry.js.map → p-acf8aec2.entry.js.map} +0 -0
- /package/dist/design-system/{p-912c7a8d.entry.js.map → p-b24ace19.entry.js.map} +0 -0
- /package/dist/design-system/{p-8b2b47a7.entry.js.map → p-b2516c36.entry.js.map} +0 -0
- /package/dist/design-system/{p-97dbc008.entry.js.map → p-d4395043.entry.js.map} +0 -0
- /package/dist/design-system/{p-5db3252c.entry.js.map → p-dfbbde69.entry.js.map} +0 -0
- /package/dist/design-system/{p-682cf57d.entry.js.map → p-ef6a088a.entry.js.map} +0 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { resolveColor } from "../../utils/color";
|
|
3
|
+
export class SdBadge {
|
|
4
|
+
size = 'md';
|
|
5
|
+
color = 'brilliantblue_75';
|
|
6
|
+
label = '';
|
|
7
|
+
render() {
|
|
8
|
+
const resolvedColor = resolveColor(this.color);
|
|
9
|
+
return (h(Host, { key: 'b4c9fd99102b52d0769cbc1be393620f90077e20' }, h("div", { key: '99c7f6ec6a83273c37cf036fa129d57747c9046d', class: `sd-badge sd-badge--${this.size}`, style: { '--sd-badge-color': resolvedColor } }, h("div", { key: '9d45fad015f4b601adba40e42354252d72bb6fd4', class: "sd-badge__dot" }), h("div", { key: 'c1aebc967cdcbfa0bb8a7f350e668f0ccd7d5a02', class: "sd-badge__label" }, this.label))));
|
|
10
|
+
}
|
|
11
|
+
static get is() { return "sd-badge"; }
|
|
12
|
+
static get encapsulation() { return "scoped"; }
|
|
13
|
+
static get originalStyleUrls() {
|
|
14
|
+
return {
|
|
15
|
+
"$": ["sd-badge.scss"]
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
static get styleUrls() {
|
|
19
|
+
return {
|
|
20
|
+
"$": ["sd-badge.css"]
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
static get properties() {
|
|
24
|
+
return {
|
|
25
|
+
"size": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"mutable": false,
|
|
28
|
+
"complexType": {
|
|
29
|
+
"original": "'sm' | 'md'",
|
|
30
|
+
"resolved": "\"md\" | \"sm\"",
|
|
31
|
+
"references": {}
|
|
32
|
+
},
|
|
33
|
+
"required": false,
|
|
34
|
+
"optional": false,
|
|
35
|
+
"docs": {
|
|
36
|
+
"tags": [],
|
|
37
|
+
"text": ""
|
|
38
|
+
},
|
|
39
|
+
"getter": false,
|
|
40
|
+
"setter": false,
|
|
41
|
+
"reflect": false,
|
|
42
|
+
"attribute": "size",
|
|
43
|
+
"defaultValue": "'md'"
|
|
44
|
+
},
|
|
45
|
+
"color": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"mutable": false,
|
|
48
|
+
"complexType": {
|
|
49
|
+
"original": "string",
|
|
50
|
+
"resolved": "string",
|
|
51
|
+
"references": {}
|
|
52
|
+
},
|
|
53
|
+
"required": false,
|
|
54
|
+
"optional": false,
|
|
55
|
+
"docs": {
|
|
56
|
+
"tags": [],
|
|
57
|
+
"text": ""
|
|
58
|
+
},
|
|
59
|
+
"getter": false,
|
|
60
|
+
"setter": false,
|
|
61
|
+
"reflect": false,
|
|
62
|
+
"attribute": "color",
|
|
63
|
+
"defaultValue": "'brilliantblue_75'"
|
|
64
|
+
},
|
|
65
|
+
"label": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"mutable": false,
|
|
68
|
+
"complexType": {
|
|
69
|
+
"original": "string",
|
|
70
|
+
"resolved": "string",
|
|
71
|
+
"references": {}
|
|
72
|
+
},
|
|
73
|
+
"required": false,
|
|
74
|
+
"optional": false,
|
|
75
|
+
"docs": {
|
|
76
|
+
"tags": [],
|
|
77
|
+
"text": ""
|
|
78
|
+
},
|
|
79
|
+
"getter": false,
|
|
80
|
+
"setter": false,
|
|
81
|
+
"reflect": false,
|
|
82
|
+
"attribute": "label",
|
|
83
|
+
"defaultValue": "''"
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=sd-badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sd-badge.js","sourceRoot":"","sources":["../../../src/components/sd-badge/sd-badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAOjD,MAAM,OAAO,OAAO;IACX,IAAI,GAAgB,IAAI,CAAC;IACzB,KAAK,GAAW,kBAAkB,CAAC;IACnC,KAAK,GAAW,EAAE,CAAC;IAE3B,MAAM;QACL,MAAM,aAAa,GAAG,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAE/C,OAAO,CACN,EAAC,IAAI;YACJ,4DAAK,KAAK,EAAE,sBAAsB,IAAI,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,kBAAkB,EAAE,aAAa,EAAE;gBAC1F,4DAAK,KAAK,EAAC,eAAe,GAAO;gBACjC,4DAAK,KAAK,EAAC,iBAAiB,IAAE,IAAI,CAAC,KAAK,CAAO,CAC1C,CACA,CACP,CAAC;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\r\nimport { resolveColor } from '../../utils/color';\r\n\r\n@Component({\r\n tag: 'sd-badge',\r\n styleUrl: 'sd-badge.scss',\r\n scoped: true,\r\n})\r\nexport class SdBadge {\r\n @Prop() size: 'sm' | 'md' = 'md';\r\n @Prop() color: string = 'brilliantblue_75';\r\n @Prop() label: string = '';\r\n\r\n render() {\r\n const resolvedColor = resolveColor(this.color);\r\n\r\n return (\r\n <Host>\r\n <div class={`sd-badge sd-badge--${this.size}`} style={{ '--sd-badge-color': resolvedColor }}>\r\n <div class=\"sd-badge__dot\"></div>\r\n <div class=\"sd-badge__label\">{this.label}</div>\r\n </div>\r\n </Host>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -60,7 +60,7 @@ export class SdCheckbox {
|
|
|
60
60
|
this.sdChange.emit(newValue);
|
|
61
61
|
};
|
|
62
62
|
render() {
|
|
63
|
-
return (h(Host, { key: '
|
|
63
|
+
return (h(Host, { key: '126d946853dc962cf660a9dbae2c002b7c003606' }, h("label", { key: 'cb1a6a8e427bf199789e3fe594fd01a5f618c0eb', class: this.getCheckboxClasses() }, h("input", { key: '701bb2f8e0434b81f762d36e8b16704e982c6028', type: "checkbox", checked: this.isChecked, disabled: this.disabled, onChange: this.handleChange }), h("div", { key: 'cb03ca961f3118d86b3679a1ae179cf9d90cfa6c', class: "sd-checkbox__bg", style: this.checkboxStyle }, this.isChecked ? (h("sd-icon", { name: "check", size: 12, color: this.disabled ? '#888888' : 'white' })) : null), this.label && h("span", { key: '208435a51caac8190ab8a7fae0a0e98cb6d38ea3', class: "sd-checkbox__label" }, this.label))));
|
|
64
64
|
}
|
|
65
65
|
static get is() { return "sd-checkbox"; }
|
|
66
66
|
static get encapsulation() { return "scoped"; }
|
|
@@ -74,9 +74,9 @@ export class SdDatePicker {
|
|
|
74
74
|
this.isOpen = false;
|
|
75
75
|
};
|
|
76
76
|
render() {
|
|
77
|
-
return (h(Host, { key: '
|
|
77
|
+
return (h(Host, { key: '4bd4950a7e6ee0f0fe8b43c9897473dec079bccd', class: "sd-date-picker" }, h("sd-input", { key: 'cd093c5f36a8bf73bcc1d2d8b2d4a32621e4ef02', ref: el => (this.inputEl = el), value: this.date, label: this.label, "inside-label": true, readonly: true, disabled: this.disabled, inputClass: "text-center", inputStyle: {
|
|
78
78
|
margin: '0 0 0 8px',
|
|
79
|
-
}, onClick: () => this.openMenu() }, h("sd-icon", { key: '
|
|
79
|
+
}, onClick: () => this.openMenu() }, h("sd-icon", { key: '20051be0ceb09a2660c8aacd3f3d7c8d9d78d6e0', slot: "prefix", name: "date", size: "16", color: "#737373", class: "date-icon", onClick: () => this.openMenu() })), this.isOpen && (h("sd-portal", { key: '0045590cea11da3ea09ffb382fa7d0db5eb10e26', open: this.isOpen, parentRef: this.inputEl, onSdClose: this.handleClose }, h("div", { key: '16b035b6b9c9ae6edd9c27bf49f81fbab52f2c0a', class: "sd-date-picker__menu" }, h("div", { key: 'a38e25d987606453c42cd1bc4f79c98a0264c479', class: "sd-date-picker__header" }, h("div", { key: '935ef106ab55ae4d2a28f2991a3a10221921524a', class: "year-nav" }, h("button", { key: '19cb5c006e4cb5ae32dde8c05a75a0df83dde359', type: "button", name: "prev-year", title: "Previous Year", onClick: () => this.setCurrentYear(this.currentYear - 1) }, h("sd-icon", { key: '6f2d8be5371e8ffcc774baba20ed4b776f8bb18c', name: "arrowLeft", size: "12", color: "#CCCCCC" })), h("span", { key: 'cb9df4bc1594ccb8e7536b625a84a30a2e7dfa12', class: "year-nav__current" }, this.currentYear), h("button", { key: '5dd87a18292f29dc6b3b66ecc8c2f1dfaa70feb1', type: "button", name: "next-year", title: "Next Year", onClick: () => this.setCurrentYear(this.currentYear + 1) }, h("sd-icon", { key: 'cf9e278457d72be2dd4b939448c47f6d79c57930', name: "arrowRight", size: "12", color: "#CCCCCC" }))), h("div", { key: '4afb13f370c9d17542f980f2da72cba9b66d1d22', class: "month-nav" }, h("button", { key: '101b4163c3ab4edc48f5ee0342a7a6bf99bde2c3', type: "button", name: "prev-month", title: "Previous ", onClick: () => this.handleUpdateMonth('prev') }, h("sd-icon", { key: '973e065893ac2cc9385a2b1e7ec327b25456e8a6', name: "arrowLeft", size: "12", color: "#CCCCCC" })), h("span", { key: '81228496944a8df087b91c5a0532a4c4e6acc722', class: "month-nav__current" }, this.currentMonth, "\uC6D4"), h("button", { key: '8c0812d9d1f4617422c3d11ed3cd9e66cef2ef7f', type: "button", name: "next-month", title: "Next Month", onClick: () => this.handleUpdateMonth('next') }, h("sd-icon", { key: '3085b6eaaaa768dd9fc3ff4f1b2d91eef8846dbe', name: "arrowRight", size: "12", color: "#CCCCCC" })))), h("div", { key: 'd837807d4a1de792bafd24950e61b6feb0948b2b', class: "sd-date-picker__days" }, ['일', '월', '화', '수', '목', '금', '토'].map(day => (h("div", { key: day, class: "day" }, day)))), h("div", { key: '085b9e8190f7b46184c3e9b1de90e98c96b75f17', class: "sd-date-picker__body" }, [
|
|
80
80
|
...this.calendar.prevMonthDays,
|
|
81
81
|
...this.calendar.days,
|
|
82
82
|
...this.calendar.afterMonthDays,
|
|
@@ -137,9 +137,9 @@ export class SdDateRangePicker {
|
|
|
137
137
|
this.isOpen = false;
|
|
138
138
|
};
|
|
139
139
|
render() {
|
|
140
|
-
return (h(Host, { key: '
|
|
140
|
+
return (h(Host, { key: '8aea2d5a46c733661022aa5925c87ccbebb5187e', class: "sd-date-range-picker" }, h("sd-input", { key: '17b95dcfb188bdde813e69e0cd281e900e3418d4', ref: el => (this.inputEl = el), value: `${this.dateRange[0]} ~ ${this.dateRange[1]}`, label: this.label, "inside-label": true, readonly: true, disabled: this.disabled, inputClass: "text-center", inputStyle: {
|
|
141
141
|
margin: '0 0 0 8px',
|
|
142
|
-
}, onClick: () => this.openMenu() }, h("sd-icon", { key: '
|
|
142
|
+
}, onClick: () => this.openMenu() }, h("sd-icon", { key: '9cb55e06cc6954eb94396d7801b516bfb8c27509', slot: "prefix", name: "date", size: "16", color: "#737373", class: "date-icon", onClick: () => this.openMenu() })), this.isOpen && (h("sd-portal", { key: 'a77b900f2c4d91f8b3b473b131d261e0e0bca64f', open: this.isOpen, parentRef: this.inputEl, onSdClose: this.handleClose }, h("div", { key: '2512ef3cede9630f5eeeed4aeaa49b1e7d204bfc', class: "sd-date-range-picker__menu" }, h("div", { key: 'efa249182fe69e088cd49603426ecbf8488bc90a', class: "sd-date-range-picker__header mb-16pxr flex flex-nowrap items-center justify-center" }, h("button", { key: 'a4b40a969bcfe08fa0426864ca31db94b5bb7c6c', type: "button", name: "prev", title: "Previous", onClick: () => this.setPrevYear(this.prevYear - 1) }, h("sd-icon", { key: '078faf6ed904b7dd7ca20e0d30767946d75cefce', name: "arrowLeft", size: "12", color: "#CCCCCC" })), h("div", { key: '1582407b137ce57eb3cc0d3f62d6d50dace58be9', class: "header-label" }, this.prevYear), h("button", { key: 'dd13bad24056346098e9c780520c75611e34cbf3', type: "button", name: "next", title: "Next", onClick: () => this.setPrevYear(this.prevYear + 1) }, h("sd-icon", { key: '9871ce23b9d3074a0e581ee8731f19beb910ecac', name: "arrowRight", size: "12", color: "#CCCCCC" }))), h("div", { key: 'bd3cf7fb8735d66e9944f1232fcf205d95ff8f99', class: "sd-date-range-picker__body" }, [this.prevCalendar, this.nextCalendar].map((calendar, index) => (h(Fragment, null, index === 1 && h("div", { class: "separator" }), h("div", { key: index, class: "calendar-container" }, h("div", { class: "calendar-header" }, h("button", { type: "button", name: "month", title: "Month", class: index === 0 ? 'header-button-prev' : 'header-button-next', onClick: () => this.updateYearMonth(index === 0 ? 'prev' : 'next') }, h("sd-icon", { name: index === 0 ? 'arrowLeft' : 'arrowRight', size: "12", color: "#CCCCCC" })), index === 0
|
|
143
143
|
? `${this.prevYear}.${String(this.prevMonth).padStart(2, '0')}`
|
|
144
144
|
: `${this.nextYear}.${String(this.nextMonth).padStart(2, '0')}`), h("div", { class: "calendar-days" }, ['일', '월', '화', '수', '목', '금', '토'].map(day => (h("sd-date-box", { key: day, date: day, disabled: true, class: "day" })))), h("div", { class: "calendar-body mt-12pxr grid grid-cols-7 gap-y-8pxr" }, [...calendar.prevMonthDays, ...calendar.days, ...calendar.afterMonthDays].map((day, idx) => (h("sd-date-box", { key: `prev${day}_${idx}`, date: !day ? '' : Number(day), selected: this.dateRange.some(date => date ===
|
|
145
145
|
this.dateUtil.formatDate(index === 0 ? this.prevYear : this.nextYear, index === 0 ? this.prevMonth : this.nextMonth, Number(day))), type: this.getDateBoxType(this.dateUtil.formatDate(index === 0 ? this.prevYear : this.nextYear, index === 0 ? this.prevMonth : this.nextMonth, Number(day))), isToday: today ===
|
|
@@ -66,7 +66,7 @@ export class SdGuide {
|
|
|
66
66
|
};
|
|
67
67
|
render() {
|
|
68
68
|
const { name: iconName, size: iconSize, color: iconColor } = this.getGuidIcon();
|
|
69
|
-
return (h(Host, { key: '
|
|
69
|
+
return (h(Host, { key: '6b9aef7f8ac24d20f19b0007aa6b13de124db93a', style: this.getGuideStyle() }, h("sd-button", { key: '84f1e008e5583d33e008c3c6676b221795af447f', ref: el => (this.guideRef = el), class: this.getGuideClasses(), variant: "outline", label: SdGuide.guideTitle[this.type], size: "md", color: "var(--guide-color)", icon: iconName, iconColor: iconColor, iconSize: iconSize, iconStyle: { marginRight: '4px' }, buttonStyle: {
|
|
70
70
|
height: '28px',
|
|
71
71
|
minHeight: '28px',
|
|
72
72
|
padding: '4px 12px',
|
|
@@ -76,7 +76,7 @@ export class SdGuide {
|
|
|
76
76
|
fontSize: '12px',
|
|
77
77
|
fontWeight: '400',
|
|
78
78
|
backgroundColor: 'var(--guide-background)',
|
|
79
|
-
}, onSdClick: this.handleClickGuide }), this.type === 'help' && this.popupShow && (h("sd-portal", { key: '
|
|
79
|
+
}, onSdClick: this.handleClickGuide }), this.type === 'help' && this.popupShow && (h("sd-portal", { key: '094c0ed48f8cd5e4ad9b39749c5b9e38de776df9', open: this.popupShow, parentRef: this.guideRef, onSdClose: this.closeDropdown, offset: [0, 24] }, h("div", { key: 'c4723cff1757f411b3ec5c618ece202195893062', class: "sd-guide__popup", style: { width: this.popupWidth ? this.popupWidth + 'px' : '426px' } }, h("sd-button", { key: 'a76bd5368390414f8ab3733902780b39d4bfb3ac', class: "sd-guide__popup__close", icon: "close", color: colors.grey_65, size: "md", variant: "ghost", noHover: true, buttonStyle: { padding: '0px', minHeight: '0px' }, onSdClick: this.closeDropdown }), h("div", { key: '56b1e56be7accd939b47d8942c0796214215b9a1', class: "sd-guide__popup__header" }, h("sd-icon", { key: '4c0eee1fb46488a0fc69e767536d8a0abc0465c3', name: "helpOutline", size: 24, color: colors.green_65 }), h("h3", { key: '82159861a5f0dead314dde0648441099fbed1b33', class: "sd-guide__popup__title" }, this.popupTitle || SdGuide.guideTitle[this.type])), h("ul", { key: '656631755547012c689a434aa0db3f6f3676dc2f', class: "sd-guide__popup__list" }, this.renderListItem(this.message)))))));
|
|
80
80
|
}
|
|
81
81
|
// 현재 2depth까지만 스타일 적용
|
|
82
82
|
renderListItem(message, depth = 0) {
|
|
@@ -25,7 +25,7 @@ export class SdIcon {
|
|
|
25
25
|
}
|
|
26
26
|
render() {
|
|
27
27
|
const IconComponent = Icons[this.name]?.[this.size];
|
|
28
|
-
return (h("i", { key: '
|
|
28
|
+
return (h("i", { key: 'e9b6db9025ea08dd24e82dc0f37090109b707a12', class: this.getIconClasses(), style: this.iconStyle }, h(IconComponent, { key: '03592c460972f9ea07cb6b86c8dcbbf1f52bb9ff', color: this.resolvedColor })));
|
|
29
29
|
}
|
|
30
30
|
static get is() { return "sd-icon"; }
|
|
31
31
|
static get encapsulation() { return "scoped"; }
|
|
@@ -89,11 +89,11 @@ export class SdInput {
|
|
|
89
89
|
'--input-width': typeof this.width === 'number' ? `${this.width}px` : this.width,
|
|
90
90
|
}
|
|
91
91
|
: {};
|
|
92
|
-
return (h(Host, { key: '
|
|
92
|
+
return (h(Host, { key: 'a98bd133a5e00feaea2c3d2a4ef8e63a9e9e1dc5', style: inputWidth }, this.label && h("div", { key: 'c5bce4ee152a83f1e34a63a7e347c449f27e568e', class: "sd-input__label" }, this.label), h("label", { key: '77c9bf2b1bad3839afef09a55c170924355b4ec9', class: {
|
|
93
93
|
'sd-input': true,
|
|
94
94
|
[this.getInputStatus()]: true,
|
|
95
95
|
'sd-input--barcode': !!this.barcode,
|
|
96
|
-
}, onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false), style: this.inputStyle }, h("slot", { key: '
|
|
96
|
+
}, onMouseEnter: () => (this.hovered = true), onMouseLeave: () => (this.hovered = false), style: this.inputStyle }, h("slot", { key: 'a81d4ae208787b2a74a000cc1baf3e288cc42132', name: "prefix" }), h("input", { key: 'fc5141f2364ca939e0a8ed7425143f5c1ecab572', ref: el => (this.nativeEl = el), class: `sd-input__native_element ${this.inputClass}`, type: "text", value: this.internalValue || '', placeholder: this.placeholder, disabled: this.disabled, readonly: this.readonly, autofocus: this.autoFocus, onInput: this.handleInput, onChange: this.handleChange, onFocus: event => this.handleFocus('focus', event), onBlur: event => this.handleFocus('blur', event) }), h("slot", { key: 'deabb72ce63756290ba752774a207c65f2bf287f', name: "suffix" }), this.clearable && this.internalValue && (h("sd-icon", { key: '8e62dc1e4a17d12ae26c01ffe5c3ac40da516a46', name: "close", color: "#888", style: { marginRight: '-4px', marginLeft: '8px', cursor: 'pointer' }, onClick: () => {
|
|
97
97
|
this.internalValue = '';
|
|
98
98
|
this.sdChange?.emit(this.internalValue);
|
|
99
99
|
this.sdInput?.emit(this.internalValue);
|
|
@@ -73,12 +73,12 @@ export class SdPagination {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
render() {
|
|
76
|
-
return (h("div", { key: '
|
|
76
|
+
return (h("div", { key: '1065ad3060754151c2097d130a2317ed6c064a6f', class: this.paginationClasses }, h("div", { key: '86aae86adce4d262b49190d06130b6f5b17dd52a', class: "prepend-btns" }, this.renderPrevButtons()), this.simple ? (h("div", { class: "pagination-info" }, h("span", { class: "current-page" }, this.currentPage), h("span", null, "/"), h("span", { class: "last-page" }, this.lastPage))) : (this.pageNumbers.map(n => (h("button", { type: "button", "aria-current": this.currentPage === n ? 'page' : undefined, class: {
|
|
77
77
|
'pagination-btn': true,
|
|
78
78
|
'pagination-btn--selected': this.currentPage === n,
|
|
79
79
|
}, disabled: this.currentPage === n, style: {
|
|
80
80
|
'--pagination-btn-width': `${this.buttonWidth}px`,
|
|
81
|
-
}, onClick: () => this.handlePageChange(n) }, n)))), h("div", { key: '
|
|
81
|
+
}, onClick: () => this.handlePageChange(n) }, n)))), h("div", { key: '6615badfef07e61393bc4519fb784ef84191f784', class: "append-btns" }, this.renderNextButtons())));
|
|
82
82
|
}
|
|
83
83
|
static get is() { return "sd-pagination"; }
|
|
84
84
|
static get encapsulation() { return "shadow"; }
|
|
@@ -31,11 +31,11 @@ export class SdPopover {
|
|
|
31
31
|
this.showPopover = false;
|
|
32
32
|
};
|
|
33
33
|
render() {
|
|
34
|
-
return (h(Fragment, { key: '
|
|
34
|
+
return (h(Fragment, { key: 'ddc099859685637ced58820f2dd8e2cb73a13594' }, 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", onClick: () => (console.log('click popover'), (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: () => (console.log('click popover'), (this.showPopover = !this.showPopover)) })), this.showPopover && (h("sd-tooltip-portal", { key: '07e0fc27a7898027dc1fb3d9652b220ed29dc47d', parentRef: this.buttonEl, onSdClose: this.handleClose, placement: this.placement }, h("div", { key: '63c8601759b01f4e4522c1ebf06210e5e6f73554', class: {
|
|
35
35
|
'sd-popover-menu': true,
|
|
36
36
|
[`sd-popover-menu--${this.placement}`]: true,
|
|
37
37
|
[this.menuClass]: !!this.menuClass,
|
|
38
|
-
} }, h("i", { key: '
|
|
38
|
+
} }, h("i", { key: 'c299090e57d4e0f1d5ee87957c6c271ec63940a2', class: `sd-popover-menu__arrow sd-popover-menu__arrow--${this.placement}` }, h(TooltipArrow, { key: 'b54e63b3748a9251a66da6a9615ba9d8c9cf3818' })), h("div", { key: '3ce1c182e29c77363f929517ceb782c99dbc3a28', class: "sd-popover-menu__content" }, this.menuTitle && h("div", { key: 'e81679dca07a190c54b27b6435c25efb5788b027', class: "sd-popover-menu__title" }, this.menuTitle), this.messages.length > 0 && (h("div", { key: '5793115acdb1723b507f3b31a00157a2b90b16bb', class: "sd-popover-menu__messages" }, this.messages.map(message => (h("div", null, message))))), this.buttons.length > 0 && (h("div", { key: '4f4f4e6d9eab6321737d0be88752ba9be875998e', class: `sd-popover-menu__buttons sd-popover-menu__buttons--${this.buttons.length}` }, this.buttons.map(button => (h("sd-button", { ...button })))))), this.useClose && (h("button", { key: 'a17d12565b7327676ab1637988cfa30a0c9ed35f', class: "sd-popover-menu__close-button", onClick: () => this.handleClose() }, h("sd-icon", { key: 'c3c451b2ff7a3c640c236fb43b9d831f62e0d858', name: "close", size: "12", color: "#AAAAAA" }))))))));
|
|
39
39
|
}
|
|
40
40
|
static get is() { return "sd-popover"; }
|
|
41
41
|
static get encapsulation() { return "shadow"; }
|
|
@@ -92,7 +92,7 @@ export class SdPortal {
|
|
|
92
92
|
this.sdClose.emit();
|
|
93
93
|
}
|
|
94
94
|
render() {
|
|
95
|
-
return h("slot", { key: '
|
|
95
|
+
return h("slot", { key: '1cd6fdea1437dfb749536e76cd5edb8622d0d8c8' });
|
|
96
96
|
}
|
|
97
97
|
static get is() { return "sd-portal"; }
|
|
98
98
|
static get properties() {
|
|
@@ -24,7 +24,7 @@ export class SdSelectOption {
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
render() {
|
|
27
|
-
return (h("div", { key: '
|
|
27
|
+
return (h("div", { key: '420ae30f1928e9051c5078b778e0eefb1ccd8ad7', class: {
|
|
28
28
|
'sd-select__option': true,
|
|
29
29
|
'sd-select__option--selected': this.isSelected,
|
|
30
30
|
'sd-select__option--disabled': !!this.option.disabled,
|
|
@@ -27,11 +27,11 @@ export class SdTooltip {
|
|
|
27
27
|
: {
|
|
28
28
|
onClick: () => (console.log('click tooltip'), (this.showTooltip = !this.showTooltip)),
|
|
29
29
|
};
|
|
30
|
-
return (h(Fragment, { key: '
|
|
30
|
+
return (h(Fragment, { key: '94936b10ef4b9b926ac61b81365fba1cd426248f' }, 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-tooltip", ...handleTrigger })) : (h("sd-icon", { ref: el => (this.buttonEl = el), name: this.icon, size: this.iconSize, color: this.color, class: "sd-tooltip", ...handleTrigger })), this.showTooltip && (h("sd-tooltip-portal", { key: 'f162a5a2bf99f6538c671323cbde58d3adaffb31', parentRef: this.buttonEl, onSdClose: () => this.handleClose(), placement: this.placement }, h("div", { key: '34e9846aa2e8e04de06e994b61ff1c84c62af8b8', class: {
|
|
31
31
|
'sd-tooltip-menu': true,
|
|
32
32
|
[`sd-tooltip-menu--${this.placement}`]: true,
|
|
33
33
|
'sd-tooltip-menu--with-close': this.useClose,
|
|
34
|
-
} }, h("i", { key: '
|
|
34
|
+
} }, h("i", { key: 'dcd5009ae7acbb7421076f2dd5f74f039a9db4c7', class: `sd-tooltip-menu__arrow sd-tooltip-menu__arrow--${this.placement}` }, h(TooltipArrow, { key: '80c198c65d5e2eaece8dbdf71a2dfd287b638bcf' })), h("div", { key: 'bc1392c0a4926ea5ca89d657d151a2dd812ba1fe', class: "sd-tooltip-menu__content" }, h("slot", { key: '038ce320d51e6a405c3d7d00256a5ca1cc82569c' }, this.el.textContent)), this.useClose && (h("div", { key: '435453a6e4d04fae3f44dc9691e2e546e0e34fae', class: "sd-tooltip-menu__close-button" }, h("button", { key: 'b4f0eec2e85eeaad94a4b8da31350f09d01285fb', onClick: () => this.handleClose() }, h("sd-icon", { key: '9e0943a7104d7445ec56ed1286310f0c5d303082', name: "close", size: "12", color: "#AAAAAA" })))))))));
|
|
35
35
|
}
|
|
36
36
|
static get is() { return "sd-tooltip"; }
|
|
37
37
|
static get encapsulation() { return "shadow"; }
|
|
@@ -143,7 +143,7 @@ export class SdTooltipPortal {
|
|
|
143
143
|
this.sdClose.emit();
|
|
144
144
|
}
|
|
145
145
|
render() {
|
|
146
|
-
return h("slot", { key: '
|
|
146
|
+
return h("slot", { key: 'da351ee1e01b2329ab453245f4272758f1f3889e' });
|
|
147
147
|
}
|
|
148
148
|
static get is() { return "sd-tooltip-portal"; }
|
|
149
149
|
static get encapsulation() { return "shadow"; }
|
package/dist/collection/index.js
CHANGED
|
@@ -8,8 +8,4 @@
|
|
|
8
8
|
* to consume components of this package as outlined in the `README.md`.
|
|
9
9
|
*/
|
|
10
10
|
export { format } from './utils/utils';
|
|
11
|
-
// Export Next.js utilities
|
|
12
|
-
export { defineCustomElements, waitForStencilHydration, initStencilForNextjs, CLIENT_ONLY_COMPONENTS, isClientOnlyComponent, } from './utils/next-react-wrapper';
|
|
13
|
-
// Export hydration utilities
|
|
14
|
-
export { renderStencilComponents, hydrateStencilComponents, STENCIL_CONFIG, } from './utils/next-hydrate';
|
|
15
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC","sourcesContent":["/**\r\n * @fileoverview entry point for your component library\r\n *\r\n * This is the entry point for your component library. Use this file to export utilities,\r\n * constants or data structure that accompany your components.\r\n *\r\n * DO NOT use this file to export your components. Instead, use the recommended approaches\r\n * to consume components of this package as outlined in the `README.md`.\r\n */\r\n\r\nexport { format } from './utils/utils';\r\nexport type * from './components.d.ts';\r\n\r\n// Export sd-table types\r\nexport type { SdTableSortDir, SdTableColumn, Row } from './components/sd-table/sd-table';\r\n"]}
|
package/dist/components/index.js
CHANGED
|
@@ -1,123 +1,10 @@
|
|
|
1
|
-
export { g as getAssetPath, r as render, s as setAssetPath, a as setNonce, b as setPlatformOptions } from './p-
|
|
1
|
+
export { g as getAssetPath, r as render, s as setAssetPath, a as setNonce, b as setPlatformOptions } from './p-CLODAhOA.js';
|
|
2
2
|
|
|
3
3
|
function format(first, middle, last) {
|
|
4
4
|
return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
* Next.js에서 Stencil 컴포넌트 사용을 위한 유틸리티 함수들
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* 클라이언트 사이드에서만 Stencil 컴포넌트를 로드하는 함수
|
|
12
|
-
*/
|
|
13
|
-
const defineCustomElements = async () => {
|
|
14
|
-
if (typeof window !== 'undefined') {
|
|
15
|
-
const { defineCustomElements } = await import('./p-dBol_ZO8.js');
|
|
16
|
-
await defineCustomElements();
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Stencil 컴포넌트가 hydrate되었는지 확인하는 함수
|
|
21
|
-
*/
|
|
22
|
-
const waitForStencilHydration = (element, timeout = 5000) => {
|
|
23
|
-
return new Promise(resolve => {
|
|
24
|
-
if (element.hasAttribute('hydrated')) {
|
|
25
|
-
resolve(true);
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
const observer = new MutationObserver(() => {
|
|
29
|
-
if (element.hasAttribute('hydrated')) {
|
|
30
|
-
observer.disconnect();
|
|
31
|
-
resolve(true);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
observer.observe(element, {
|
|
35
|
-
attributes: true,
|
|
36
|
-
attributeFilter: ['hydrated'],
|
|
37
|
-
});
|
|
38
|
-
// 타임아웃 설정
|
|
39
|
-
setTimeout(() => {
|
|
40
|
-
observer.disconnect();
|
|
41
|
-
resolve(false);
|
|
42
|
-
}, timeout);
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* Next.js에서 Stencil 컴포넌트 초기화를 위한 설정
|
|
47
|
-
*/
|
|
48
|
-
const initStencilForNextjs = () => {
|
|
49
|
-
if (typeof window !== 'undefined') {
|
|
50
|
-
// 전역 설정
|
|
51
|
-
window.stencil = {
|
|
52
|
-
...(window.stencil || {}),
|
|
53
|
-
hydrateFlag: 'hydrated',
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
/**
|
|
58
|
-
* SSR에서 제외할 컴포넌트 목록
|
|
59
|
-
*/
|
|
60
|
-
const CLIENT_ONLY_COMPONENTS = ['sd-date-picker', 'sd-date-range-picker'];
|
|
61
|
-
/**
|
|
62
|
-
* 컴포넌트가 클라이언트 전용인지 확인
|
|
63
|
-
*/
|
|
64
|
-
const isClientOnlyComponent = (tagName) => {
|
|
65
|
-
return CLIENT_ONLY_COMPONENTS.includes(tagName);
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Next.js SSR을 위한 서버사이드 렌더링 함수
|
|
70
|
-
* @param html HTML 문자열
|
|
71
|
-
* @returns 렌더링된 HTML 문자열
|
|
72
|
-
*/
|
|
73
|
-
async function renderStencilComponents(html) {
|
|
74
|
-
// 서버 환경에서만 hydrate 모듈을 동적으로 import
|
|
75
|
-
if (typeof window === 'undefined') {
|
|
76
|
-
try {
|
|
77
|
-
const { renderToString } = await import('./p-BjTJkvEh.js');
|
|
78
|
-
const results = await renderToString(html, {
|
|
79
|
-
prettyHtml: false,
|
|
80
|
-
removeUnusedStyles: true,
|
|
81
|
-
clientHydrateAnnotations: true,
|
|
82
|
-
});
|
|
83
|
-
return results.html || html;
|
|
84
|
-
}
|
|
85
|
-
catch (error) {
|
|
86
|
-
console.warn('Failed to render Stencil components on server:', error);
|
|
87
|
-
return html;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return html;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Next.js 클라이언트사이드 하이드레이션 함수
|
|
94
|
-
* @param document HTML 문서 객체
|
|
95
|
-
*/
|
|
96
|
-
async function hydrateStencilComponents(document) {
|
|
97
|
-
// 클라이언트 환경에서만 hydrate 모듈을 동적으로 import
|
|
98
|
-
if (typeof window !== 'undefined') {
|
|
99
|
-
try {
|
|
100
|
-
const { hydrateDocument } = await import('./p-BjTJkvEh.js');
|
|
101
|
-
await hydrateDocument(document, {
|
|
102
|
-
runtimeLogging: false,
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
catch (error) {
|
|
106
|
-
console.warn('Failed to hydrate Stencil components on client:', error);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Next.js에서 Stencil 컴포넌트 사용을 위한 설정
|
|
112
|
-
*/
|
|
113
|
-
const STENCIL_CONFIG = {
|
|
114
|
-
// 컴포넌트가 hydrate되었는지 확인하는 속성
|
|
115
|
-
hydratedAttribute: 'hydrated',
|
|
116
|
-
// SSR에서 제외할 컴포넌트들 (클라이언트에서만 렌더링)
|
|
117
|
-
clientOnlyComponents: ['sd-date-picker', 'sd-date-range-picker'],
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
export { CLIENT_ONLY_COMPONENTS, STENCIL_CONFIG, defineCustomElements, format, hydrateStencilComponents, initStencilForNextjs, isClientOnlyComponent, renderStencilComponents, waitForStencilHydration };
|
|
7
|
+
export { format };
|
|
121
8
|
//# sourceMappingURL=index.js.map
|
|
122
9
|
|
|
123
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"index.js","mappings":";;SAAgB,MAAM,CAAC,KAAc,EAAE,MAAe,EAAE,IAAa,EAAA;AACnE,IAAA,OAAO,CAAC,KAAK,IAAI,EAAE,KAAK,MAAM,GAAG,CAAI,CAAA,EAAA,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,GAAG,CAAI,CAAA,EAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AAChF
|
|
1
|
+
{"file":"index.js","mappings":";;SAAgB,MAAM,CAAC,KAAc,EAAE,MAAe,EAAE,IAAa,EAAA;AACnE,IAAA,OAAO,CAAC,KAAK,IAAI,EAAE,KAAK,MAAM,GAAG,CAAI,CAAA,EAAA,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,GAAG,CAAI,CAAA,EAAA,IAAI,EAAE,GAAG,EAAE,CAAC;AAChF;;;;","names":[],"sources":["src/utils/utils.ts"],"sourcesContent":["export function format(first?: string, middle?: string, last?: string): string {\r\n return (first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : '');\r\n}\r\n"],"version":3}
|