@sula-tech/webcomponents 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-BtkenDV1.js → index-Bbryl0vg.js} +30 -4
- package/dist/cjs/index-Bbryl0vg.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/sula-avatar.sula-badge.sula-button.sula-checkbox.sula-chip.sula-dropdown.sula-icon.sula-loader.sula-menu-select-list.sula-radio-button.sula-switch.sula-tag.sula-textarea.sula-textfield.sula-tiles.sula-timeline-list.entry.cjs.js.map +1 -0
- package/dist/cjs/{sula-avatar_14.cjs.entry.js → sula-avatar_16.cjs.entry.js} +215 -33
- package/dist/cjs/sula-avatar_16.cjs.entry.js.map +1 -0
- package/dist/cjs/webcomponents.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/sula-chip/sula-chip.css +1 -1
- package/dist/collection/components/sula-dropdown/sula-dropdown.css +1 -0
- package/dist/collection/components/sula-dropdown/sula-dropdown.js +275 -0
- package/dist/collection/components/sula-dropdown/sula-dropdown.js.map +1 -0
- package/dist/collection/components/sula-dropdown/sula-dropdown.stories.js +155 -0
- package/dist/collection/components/sula-dropdown/sula-dropdown.stories.js.map +1 -0
- package/dist/collection/components/sula-icon/sula-icon.css +1 -1
- package/dist/collection/components/sula-icon/sula-icon.js +1 -1
- package/dist/collection/components/sula-loader/sula-loader.js +1 -1
- package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.css +1 -1
- package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.js +29 -1
- package/dist/collection/components/sula-menu-select-list/sula-menu-select-list.js.map +1 -1
- package/dist/collection/components/sula-radio-button/sula-radio-button.js +2 -2
- package/dist/collection/components/sula-switch/sula-switch.js +4 -4
- package/dist/collection/components/sula-tag/sula-tag.js +3 -3
- package/dist/collection/components/sula-textarea/sula-textarea.css +1 -1
- package/dist/collection/components/sula-textarea/sula-textarea.js +26 -13
- package/dist/collection/components/sula-textarea/sula-textarea.js.map +1 -1
- package/dist/collection/components/sula-textfield/sula-textfield.js +2 -2
- package/dist/collection/components/sula-tiles/sula-tiles.js +1 -1
- package/dist/collection/components/sula-timeline-list/model/sula-timeline-list.model.js +7 -0
- package/dist/collection/components/sula-timeline-list/model/sula-timeline-list.model.js.map +1 -0
- package/dist/collection/components/sula-timeline-list/sula-timeline-list.css +1 -0
- package/dist/collection/components/sula-timeline-list/sula-timeline-list.js +123 -0
- package/dist/collection/components/sula-timeline-list/sula-timeline-list.js.map +1 -0
- package/dist/collection/components/sula-timeline-list/sula-timeline-list.stories.js +217 -0
- package/dist/collection/components/sula-timeline-list/sula-timeline-list.stories.js.map +1 -0
- package/dist/components/index.js +20 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/{p-CEU3PNQs.js → p-CYhL1fU6.js} +4 -4
- package/dist/components/{p-CEU3PNQs.js.map → p-CYhL1fU6.js.map} +1 -1
- package/dist/components/{p-DJGFqp8r.js → p-CjYWDIHR.js} +14 -5
- package/dist/components/p-CjYWDIHR.js.map +1 -0
- package/dist/components/sula-avatar.js +1 -1
- package/dist/components/sula-badge.js +1 -1
- package/dist/components/sula-button.js +1 -1
- package/dist/components/sula-checkbox.js +1 -1
- package/dist/components/sula-chip.js +3 -3
- package/dist/components/sula-chip.js.map +1 -1
- package/dist/components/sula-dropdown.d.ts +11 -0
- package/dist/components/sula-dropdown.js +137 -0
- package/dist/components/sula-dropdown.js.map +1 -0
- package/dist/components/sula-icon.js +1 -1
- package/dist/components/sula-loader.js +1 -1
- package/dist/components/sula-menu-select-list.js +1 -1
- package/dist/components/sula-radio-button.js +2 -2
- package/dist/components/sula-switch.js +4 -4
- package/dist/components/sula-tag.js +4 -4
- package/dist/components/sula-textarea.js +27 -14
- package/dist/components/sula-textarea.js.map +1 -1
- package/dist/components/sula-textfield.js +3 -3
- package/dist/components/sula-tiles.js +2 -2
- package/dist/components/sula-timeline-list.d.ts +11 -0
- package/dist/components/sula-timeline-list.js +101 -0
- package/dist/components/sula-timeline-list.js.map +1 -0
- package/dist/esm/{index-Yyeke16a.js → index-or7qTZgT.js} +30 -4
- package/dist/esm/index-or7qTZgT.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/sula-avatar.sula-badge.sula-button.sula-checkbox.sula-chip.sula-dropdown.sula-icon.sula-loader.sula-menu-select-list.sula-radio-button.sula-switch.sula-tag.sula-textarea.sula-textfield.sula-tiles.sula-timeline-list.entry.js.map +1 -0
- package/dist/esm/{sula-avatar_14.entry.js → sula-avatar_16.entry.js} +214 -34
- package/dist/esm/sula-avatar_16.entry.js.map +1 -0
- package/dist/esm/webcomponents.js +3 -3
- package/dist/types/components/sula-dropdown/sula-dropdown.d.ts +49 -0
- package/dist/types/components/sula-dropdown/sula-dropdown.stories.d.ts +68 -0
- package/dist/types/components/sula-menu-select-list/sula-menu-select-list.d.ts +4 -0
- package/dist/types/components/sula-textarea/sula-textarea.d.ts +4 -1
- package/dist/types/components/sula-timeline-list/model/sula-timeline-list.model.d.ts +16 -0
- package/dist/types/components/sula-timeline-list/sula-timeline-list.d.ts +17 -0
- package/dist/types/components/sula-timeline-list/sula-timeline-list.stories.d.ts +47 -0
- package/dist/types/components.d.ts +139 -0
- package/dist/webcomponents/{p-67f9fa90.entry.js → p-51f9d6a5.entry.js} +1138 -884
- package/dist/webcomponents/p-51f9d6a5.entry.js.map +1 -0
- package/dist/webcomponents/{p-Yyeke16a.js → p-or7qTZgT.js} +229 -204
- package/dist/webcomponents/p-or7qTZgT.js.map +1 -0
- package/dist/webcomponents/sula-avatar.sula-badge.sula-button.sula-checkbox.sula-chip.sula-dropdown.sula-icon.sula-loader.sula-menu-select-list.sula-radio-button.sula-switch.sula-tag.sula-textarea.sula-textfield.sula-tiles.sula-timeline-list.entry.esm.js.map +1 -0
- package/dist/webcomponents/webcomponents.esm.js +22 -10
- package/package.json +1 -1
- package/dist/cjs/index-BtkenDV1.js.map +0 -1
- package/dist/cjs/sula-avatar.sula-badge.sula-button.sula-checkbox.sula-chip.sula-icon.sula-loader.sula-menu-select-list.sula-radio-button.sula-switch.sula-tag.sula-textarea.sula-textfield.sula-tiles.entry.cjs.js.map +0 -1
- package/dist/cjs/sula-avatar_14.cjs.entry.js.map +0 -1
- package/dist/components/p-DJGFqp8r.js.map +0 -1
- package/dist/esm/index-Yyeke16a.js.map +0 -1
- package/dist/esm/sula-avatar.sula-badge.sula-button.sula-checkbox.sula-chip.sula-icon.sula-loader.sula-menu-select-list.sula-radio-button.sula-switch.sula-tag.sula-textarea.sula-textfield.sula-tiles.entry.js.map +0 -1
- package/dist/esm/sula-avatar_14.entry.js.map +0 -1
- package/dist/webcomponents/p-67f9fa90.entry.js.map +0 -1
- package/dist/webcomponents/p-Yyeke16a.js.map +0 -1
- package/dist/webcomponents/sula-avatar.sula-badge.sula-button.sula-checkbox.sula-chip.sula-icon.sula-loader.sula-menu-select-list.sula-radio-button.sula-switch.sula-tag.sula-textarea.sula-textfield.sula-tiles.entry.esm.js.map +0 -1
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { SulaTimelineListItemIconStatus } from "./model/sula-timeline-list.model";
|
|
3
|
+
export class SulaTimelineList {
|
|
4
|
+
constructor() {
|
|
5
|
+
/**
|
|
6
|
+
* Timeline list. (Can be use with weekday text or icon with status)
|
|
7
|
+
*/
|
|
8
|
+
this.sulaTimelineList = [];
|
|
9
|
+
this.handleItemClick = (item) => {
|
|
10
|
+
if (!item.hasLink)
|
|
11
|
+
return;
|
|
12
|
+
this.itemClicked.emit(item);
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
getIconBackgroundColorByStatus(status) {
|
|
16
|
+
const iconColorByStatus = {
|
|
17
|
+
[SulaTimelineListItemIconStatus.Success]: 'bg-surface-on-body-feedback-success',
|
|
18
|
+
[SulaTimelineListItemIconStatus.Warning]: 'bg-surface-on-body-feedback-alert',
|
|
19
|
+
[SulaTimelineListItemIconStatus.Error]: 'bg-surface-on-body-feedback-error',
|
|
20
|
+
};
|
|
21
|
+
return iconColorByStatus[status];
|
|
22
|
+
}
|
|
23
|
+
getIconByStatus(status) {
|
|
24
|
+
const iconByStatus = {
|
|
25
|
+
[SulaTimelineListItemIconStatus.Success]: 'ph ph-check-circle',
|
|
26
|
+
[SulaTimelineListItemIconStatus.Warning]: 'ph ph-warning',
|
|
27
|
+
[SulaTimelineListItemIconStatus.Error]: 'ph ph-warning-circle',
|
|
28
|
+
};
|
|
29
|
+
return iconByStatus[status];
|
|
30
|
+
}
|
|
31
|
+
getIconColorByStatus(status) {
|
|
32
|
+
const iconByStatus = {
|
|
33
|
+
[SulaTimelineListItemIconStatus.Success]: 'text-feedback-success',
|
|
34
|
+
[SulaTimelineListItemIconStatus.Warning]: 'text-feedback-alert',
|
|
35
|
+
[SulaTimelineListItemIconStatus.Error]: 'text-feedback-error',
|
|
36
|
+
};
|
|
37
|
+
return iconByStatus[status];
|
|
38
|
+
}
|
|
39
|
+
render() {
|
|
40
|
+
return (h(Host, { key: '07297e038cc1d0dd20219b34ebc3539c408fdab5' }, h("div", { key: '20094eed02e4e6ba917576bdae2e67337cbfac68', class: "flex flex-col bg-surface-on-body px-24 py-32 w-fit rounded-md" }, this.sulaTimelineList.map((item, index) => {
|
|
41
|
+
const isLastItem = index === this.sulaTimelineList.length - 1;
|
|
42
|
+
return (h("div", { class: {
|
|
43
|
+
'relative timeline-item': true,
|
|
44
|
+
'cursor-pointer group': item.hasLink,
|
|
45
|
+
}, onClick: () => this.handleItemClick(item) }, h("div", { class: "flex space-x-24 items-center justify-between flex-row w-full" }, h("div", { class: "relative flex flex-row space-x-24 items-center" }, h("div", { class: "relative" }, h("div", { class: {
|
|
46
|
+
'rounded-full h-56 w-56 bg-surface-body flex justify-center items-center relative z-10': true,
|
|
47
|
+
'p-6': !!item.iconStatus,
|
|
48
|
+
} }, item.weekdayText && (h("div", { class: "flex flex-col justify-center items-center space-y-4" }, h("span", { class: "text-text-secondary text-xs leading-3" }, item.weekdayText.weekday), h("span", { class: "text-xl leading-5 text-text-primary" }, item.weekdayText.day))), item.iconStatus && (h("div", { class: {
|
|
49
|
+
'flex justify-center items-center w-44 h-44 rounded-full': true,
|
|
50
|
+
[this.getIconBackgroundColorByStatus(item.iconStatus)]: true,
|
|
51
|
+
} }, h("div", { class: "flex justify-center items-center leading-6 w-44" }, h("sula-icon", { icon: this.getIconByStatus(item.iconStatus), customClass: `${this.getIconColorByStatus(item.iconStatus)} text-2xl` })))))), h("div", { class: "flex flex-col" }, h("span", { class: "text-text-primary font-bold text-base leading-4" }, item.title), item.message && h("span", { class: "text-text-secondary text-base leading-4 mt-4" }, item.message))), item.hasLink && (h("div", { class: {
|
|
52
|
+
'px-[6px] py-2 rounded-full leading-6 flex items-center justify-center margin-left': true,
|
|
53
|
+
'group-hover:bg-states-empty-bg-hover transition': item.hasLink,
|
|
54
|
+
} }, h("sula-icon", { icon: "ph ph-caret-right", customClass: "text-2xl text-text-primary" })))), !isLastItem && h("div", { class: "absolute bg-surface-body left-[28px] top-56 w-2 h-full" }), !isLastItem && h("div", { class: "h-24" })));
|
|
55
|
+
}))));
|
|
56
|
+
}
|
|
57
|
+
static get is() { return "sula-timeline-list"; }
|
|
58
|
+
static get encapsulation() { return "shadow"; }
|
|
59
|
+
static get originalStyleUrls() {
|
|
60
|
+
return {
|
|
61
|
+
"$": ["sula-timeline-list.scss"]
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
static get styleUrls() {
|
|
65
|
+
return {
|
|
66
|
+
"$": ["sula-timeline-list.css"]
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
static get properties() {
|
|
70
|
+
return {
|
|
71
|
+
"sulaTimelineList": {
|
|
72
|
+
"type": "unknown",
|
|
73
|
+
"attribute": "sula-timeline-list",
|
|
74
|
+
"mutable": true,
|
|
75
|
+
"complexType": {
|
|
76
|
+
"original": "SulaTimelineListItem[]",
|
|
77
|
+
"resolved": "SulaTimelineListItem[]",
|
|
78
|
+
"references": {
|
|
79
|
+
"SulaTimelineListItem": {
|
|
80
|
+
"location": "import",
|
|
81
|
+
"path": "./model/sula-timeline-list.model",
|
|
82
|
+
"id": "src/components/sula-timeline-list/model/sula-timeline-list.model.ts::SulaTimelineListItem"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"required": false,
|
|
87
|
+
"optional": false,
|
|
88
|
+
"docs": {
|
|
89
|
+
"tags": [],
|
|
90
|
+
"text": "Timeline list. (Can be use with weekday text or icon with status)"
|
|
91
|
+
},
|
|
92
|
+
"getter": false,
|
|
93
|
+
"setter": false,
|
|
94
|
+
"defaultValue": "[]"
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
static get events() {
|
|
99
|
+
return [{
|
|
100
|
+
"method": "itemClicked",
|
|
101
|
+
"name": "itemClicked",
|
|
102
|
+
"bubbles": true,
|
|
103
|
+
"cancelable": true,
|
|
104
|
+
"composed": true,
|
|
105
|
+
"docs": {
|
|
106
|
+
"tags": [],
|
|
107
|
+
"text": "Event emitted when item is clicked."
|
|
108
|
+
},
|
|
109
|
+
"complexType": {
|
|
110
|
+
"original": "SulaTimelineListItem",
|
|
111
|
+
"resolved": "SulaTimelineListItem",
|
|
112
|
+
"references": {
|
|
113
|
+
"SulaTimelineListItem": {
|
|
114
|
+
"location": "import",
|
|
115
|
+
"path": "./model/sula-timeline-list.model",
|
|
116
|
+
"id": "src/components/sula-timeline-list/model/sula-timeline-list.model.ts::SulaTimelineListItem"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}];
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=sula-timeline-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sula-timeline-list.js","sourceRoot":"","sources":["../../../src/components/sula-timeline-list/sula-timeline-list.tsx"],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IAAI,CAAC,UAAU,CAAC,WAAW,GAAc,CACvI,CACF,CACP,CACG,CACF;4BAEN,WAAK,KAAK,EAAC,eAAe;gCACxB,YAAM,KAAK,EAAC,iDAAiD,IAAE,IAAI,CAAC,KAAK,CAAQ;gCAChF,IAAI,CAAC,OAAO,IAAI,YAAM,KAAK,EAAC,8CAA8C,IAAE,IAAI,CAAC,OAAO,CAAQ,CAC7F,CACF;wBAEL,IAAI,CAAC,OAAO,IAAI,CACf,WACE,KAAK,EAAE;gCACL,mFAAmF,EAAE,IAAI;gCACzF,iDAAiD,EAAE,IAAI,CAAC,OAAO;6BAChE;4BAED,iBAAW,IAAI,EAAC,mBAAmB,EAAC,WAAW,EAAC,4BAA4B,GAAa,CACrF,CACP,CACG;oBAEL,CAAC,UAAU,IAAI,WAAK,KAAK,EAAC,wDAAwD,GAAO;oBAEzF,CAAC,UAAU,IAAI,WAAK,KAAK,EAAC,MAAM,GAAO,CACpC,CACP,CAAC;YACJ,CAAC,CAAC,CACE,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, Host, Prop, h } from '@stencil/core';\nimport { SulaTimelineListItem, SulaTimelineListItemIconStatus } from './model/sula-timeline-list.model';\n\n@Component({\n tag: 'sula-timeline-list',\n styleUrl: 'sula-timeline-list.scss',\n shadow: true,\n})\nexport class SulaTimelineList {\n /**\n * Timeline list. (Can be use with weekday text or icon with status)\n */\n @Prop({ mutable: true })\n sulaTimelineList: SulaTimelineListItem[] = [];\n\n /**\n * Event emitted when item is clicked.\n */\n @Event()\n itemClicked: EventEmitter<SulaTimelineListItem>;\n\n handleItemClick = (item: SulaTimelineListItem) => {\n if (!item.hasLink) return;\n this.itemClicked.emit(item);\n };\n\n getIconBackgroundColorByStatus(status: SulaTimelineListItemIconStatus) {\n const iconColorByStatus = {\n [SulaTimelineListItemIconStatus.Success]: 'bg-surface-on-body-feedback-success',\n [SulaTimelineListItemIconStatus.Warning]: 'bg-surface-on-body-feedback-alert',\n [SulaTimelineListItemIconStatus.Error]: 'bg-surface-on-body-feedback-error',\n };\n\n return iconColorByStatus[status];\n }\n\n getIconByStatus(status: SulaTimelineListItemIconStatus) {\n const iconByStatus = {\n [SulaTimelineListItemIconStatus.Success]: 'ph ph-check-circle',\n [SulaTimelineListItemIconStatus.Warning]: 'ph ph-warning',\n [SulaTimelineListItemIconStatus.Error]: 'ph ph-warning-circle',\n };\n\n return iconByStatus[status];\n }\n\n getIconColorByStatus(status: SulaTimelineListItemIconStatus) {\n const iconByStatus = {\n [SulaTimelineListItemIconStatus.Success]: 'text-feedback-success',\n [SulaTimelineListItemIconStatus.Warning]: 'text-feedback-alert',\n [SulaTimelineListItemIconStatus.Error]: 'text-feedback-error',\n };\n\n return iconByStatus[status];\n }\n\n render() {\n return (\n <Host>\n <div class=\"flex flex-col bg-surface-on-body px-24 py-32 w-fit rounded-md\">\n {this.sulaTimelineList.map((item, index) => {\n const isLastItem = index === this.sulaTimelineList.length - 1;\n\n return (\n <div\n class={{\n 'relative timeline-item': true,\n 'cursor-pointer group': item.hasLink,\n }}\n onClick={() => this.handleItemClick(item)}\n >\n <div class=\"flex space-x-24 items-center justify-between flex-row w-full\">\n <div class=\"relative flex flex-row space-x-24 items-center\">\n <div class=\"relative\">\n <div\n class={{\n 'rounded-full h-56 w-56 bg-surface-body flex justify-center items-center relative z-10': true,\n 'p-6': !!item.iconStatus,\n }}\n >\n {item.weekdayText && (\n <div class=\"flex flex-col justify-center items-center space-y-4\">\n <span class=\"text-text-secondary text-xs leading-3\">{item.weekdayText.weekday}</span>\n <span class=\"text-xl leading-5 text-text-primary\">{item.weekdayText.day}</span>\n </div>\n )}\n\n {item.iconStatus && (\n <div\n class={{\n 'flex justify-center items-center w-44 h-44 rounded-full': true,\n [this.getIconBackgroundColorByStatus(item.iconStatus)]: true,\n }}\n >\n <div class=\"flex justify-center items-center leading-6 w-44\">\n <sula-icon icon={this.getIconByStatus(item.iconStatus)} customClass={`${this.getIconColorByStatus(item.iconStatus)} text-2xl`}></sula-icon>\n </div>\n </div>\n )}\n </div>\n </div>\n\n <div class=\"flex flex-col\">\n <span class=\"text-text-primary font-bold text-base leading-4\">{item.title}</span>\n {item.message && <span class=\"text-text-secondary text-base leading-4 mt-4\">{item.message}</span>}\n </div>\n </div>\n\n {item.hasLink && (\n <div\n class={{\n 'px-[6px] py-2 rounded-full leading-6 flex items-center justify-center margin-left': true,\n 'group-hover:bg-states-empty-bg-hover transition': item.hasLink,\n }}\n >\n <sula-icon icon=\"ph ph-caret-right\" customClass=\"text-2xl text-text-primary\"></sula-icon>\n </div>\n )}\n </div>\n\n {!isLastItem && <div class=\"absolute bg-surface-body left-[28px] top-56 w-2 h-full\"></div>}\n\n {!isLastItem && <div class=\"h-24\"></div>}\n </div>\n );\n })}\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { SulaTimelineListItemIconStatus } from "./model/sula-timeline-list.model";
|
|
2
|
+
export default {
|
|
3
|
+
title: 'Components/sula-timeline-list',
|
|
4
|
+
tags: ['autodocs'],
|
|
5
|
+
argTypes: {
|
|
6
|
+
sulaTimelineList: {
|
|
7
|
+
control: 'object',
|
|
8
|
+
defaultValue: [
|
|
9
|
+
{
|
|
10
|
+
title: 'Item 1',
|
|
11
|
+
message: 'Primeira mensagem da timeline',
|
|
12
|
+
weekdayText: {
|
|
13
|
+
weekday: 'SEG',
|
|
14
|
+
day: '15',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
title: 'Item 2',
|
|
19
|
+
message: 'Segunda mensagem da timeline',
|
|
20
|
+
iconStatus: SulaTimelineListItemIconStatus.Success,
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
description: 'Lista de itens da timeline (pode usar texto de dia da semana ou ícone com status)',
|
|
24
|
+
type: {
|
|
25
|
+
required: true,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
itemClicked: {
|
|
29
|
+
action: 'itemClicked',
|
|
30
|
+
description: 'Evento emitido quando o item é clicado',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
parameters: {
|
|
34
|
+
docs: {
|
|
35
|
+
description: {
|
|
36
|
+
component: 'O componente Timeline List do Sula Design System é utilizado para exibir uma sequência cronológica de eventos ou etapas. Cada item pode conter um título, mensagem opcional, e pode ser representado por um dia da semana ou por um ícone com status (sucesso, aviso ou erro).',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
const Template = args => {
|
|
42
|
+
const container = document.createElement('div');
|
|
43
|
+
container.style.margin = '20px';
|
|
44
|
+
const el = document.createElement('sula-timeline-list');
|
|
45
|
+
// Converte o array para string JSON para passar como atributo
|
|
46
|
+
if (args.sulaTimelineList) {
|
|
47
|
+
el.sulaTimelineList = args.sulaTimelineList;
|
|
48
|
+
}
|
|
49
|
+
container.appendChild(el);
|
|
50
|
+
el.addEventListener('itemClicked', args.itemClicked);
|
|
51
|
+
return container;
|
|
52
|
+
};
|
|
53
|
+
export const Default = Template.bind({});
|
|
54
|
+
Default.args = {
|
|
55
|
+
sulaTimelineList: [
|
|
56
|
+
{
|
|
57
|
+
title: 'Primeiro evento',
|
|
58
|
+
message: 'Descrição do primeiro evento da timeline',
|
|
59
|
+
weekdayText: {
|
|
60
|
+
weekday: 'SEG',
|
|
61
|
+
day: '15',
|
|
62
|
+
},
|
|
63
|
+
hasLink: true
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
title: 'Segundo evento',
|
|
67
|
+
message: 'Descrição do segundo evento',
|
|
68
|
+
weekdayText: {
|
|
69
|
+
weekday: 'TER',
|
|
70
|
+
day: '16',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
title: 'Terceiro evento',
|
|
75
|
+
message: 'Descrição do terceiro evento',
|
|
76
|
+
weekdayText: {
|
|
77
|
+
weekday: 'QUA',
|
|
78
|
+
day: '17',
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
};
|
|
83
|
+
export const WithIconStatus = Template.bind({});
|
|
84
|
+
WithIconStatus.args = {
|
|
85
|
+
sulaTimelineList: [
|
|
86
|
+
{
|
|
87
|
+
title: 'Tarefa concluída',
|
|
88
|
+
message: 'Esta tarefa foi finalizada com sucesso',
|
|
89
|
+
iconStatus: SulaTimelineListItemIconStatus.Success,
|
|
90
|
+
hasLink: true
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
title: 'Atenção necessária',
|
|
94
|
+
message: 'Esta tarefa precisa de atenção',
|
|
95
|
+
iconStatus: SulaTimelineListItemIconStatus.Warning,
|
|
96
|
+
hasLink: true
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
title: 'Erro encontrado',
|
|
100
|
+
message: 'Houve um problema nesta etapa',
|
|
101
|
+
iconStatus: SulaTimelineListItemIconStatus.Error,
|
|
102
|
+
hasLink: true
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
};
|
|
106
|
+
export const MixedContent = Template.bind({});
|
|
107
|
+
MixedContent.args = {
|
|
108
|
+
sulaTimelineList: [
|
|
109
|
+
{
|
|
110
|
+
title: 'Reunião agendada',
|
|
111
|
+
message: 'Reunião de planejamento semanal',
|
|
112
|
+
weekdayText: {
|
|
113
|
+
weekday: 'SEG',
|
|
114
|
+
day: '20',
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
title: 'Projeto aprovado',
|
|
119
|
+
message: 'O projeto foi aprovado pela diretoria',
|
|
120
|
+
iconStatus: SulaTimelineListItemIconStatus.Success,
|
|
121
|
+
hasLink: true
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
title: 'Revisão pendente',
|
|
125
|
+
message: 'Documentação precisa ser revisada',
|
|
126
|
+
iconStatus: SulaTimelineListItemIconStatus.Warning,
|
|
127
|
+
hasLink: true
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
title: 'Entrega final',
|
|
131
|
+
message: 'Entrega do produto final',
|
|
132
|
+
weekdayText: {
|
|
133
|
+
weekday: 'SEX',
|
|
134
|
+
day: '24',
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
};
|
|
139
|
+
export const OnlyTitles = Template.bind({});
|
|
140
|
+
OnlyTitles.args = {
|
|
141
|
+
sulaTimelineList: [
|
|
142
|
+
{
|
|
143
|
+
title: 'Início do projeto',
|
|
144
|
+
weekdayText: {
|
|
145
|
+
weekday: 'SEG',
|
|
146
|
+
day: '01',
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
title: 'Desenvolvimento',
|
|
151
|
+
iconStatus: SulaTimelineListItemIconStatus.Warning,
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
title: 'Testes',
|
|
155
|
+
iconStatus: SulaTimelineListItemIconStatus.Success,
|
|
156
|
+
hasLink: true
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
title: 'Deploy',
|
|
160
|
+
weekdayText: {
|
|
161
|
+
weekday: 'SEX',
|
|
162
|
+
day: '05',
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
};
|
|
167
|
+
export const SingleItem = Template.bind({});
|
|
168
|
+
SingleItem.args = {
|
|
169
|
+
sulaTimelineList: [
|
|
170
|
+
{
|
|
171
|
+
title: 'Evento único',
|
|
172
|
+
message: 'Este é um evento isolado na timeline',
|
|
173
|
+
iconStatus: SulaTimelineListItemIconStatus.Success,
|
|
174
|
+
},
|
|
175
|
+
],
|
|
176
|
+
};
|
|
177
|
+
export const SuccessFlow = Template.bind({});
|
|
178
|
+
SuccessFlow.args = {
|
|
179
|
+
sulaTimelineList: [
|
|
180
|
+
{
|
|
181
|
+
title: 'Pedido recebido',
|
|
182
|
+
message: 'Seu pedido foi recebido e está sendo processado',
|
|
183
|
+
iconStatus: SulaTimelineListItemIconStatus.Success,
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
title: 'Pagamento confirmado',
|
|
187
|
+
message: 'O pagamento foi processado com sucesso',
|
|
188
|
+
iconStatus: SulaTimelineListItemIconStatus.Success,
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
title: 'Produto enviado',
|
|
192
|
+
message: 'Seu produto foi enviado e está a caminho',
|
|
193
|
+
iconStatus: SulaTimelineListItemIconStatus.Success,
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
};
|
|
197
|
+
export const ErrorFlow = Template.bind({});
|
|
198
|
+
ErrorFlow.args = {
|
|
199
|
+
sulaTimelineList: [
|
|
200
|
+
{
|
|
201
|
+
title: 'Pedido iniciado',
|
|
202
|
+
message: 'Processo de pedido foi iniciado',
|
|
203
|
+
iconStatus: SulaTimelineListItemIconStatus.Success,
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
title: 'Problema no pagamento',
|
|
207
|
+
message: 'Houve um erro no processamento do pagamento',
|
|
208
|
+
iconStatus: SulaTimelineListItemIconStatus.Error,
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
title: 'Aguardando correção',
|
|
212
|
+
message: 'Aguardando nova tentativa de pagamento',
|
|
213
|
+
iconStatus: SulaTimelineListItemIconStatus.Warning,
|
|
214
|
+
},
|
|
215
|
+
],
|
|
216
|
+
};
|
|
217
|
+
//# sourceMappingURL=sula-timeline-list.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sula-timeline-list.stories.js","sourceRoot":"","sources":["../../../src/components/sula-timeline-list/sula-timeline-list.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAElF,eAAe;IACb,KAAK,EAAE,+BAA+B;IACtC,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,g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AC;AAC7C,WAAW,CAAC,IAAI,GAAG;IACjB,gBAAgB,EAAE;QAChB;YACE,KAAK,EAAE,iBAAiB;YACxB,OAAO,EAAE,iDAAiD;YAC1D,UAAU,EAAE,8BAA8B,CAAC,OAAO;SACnD;QACD;YACE,KAAK,EAAE,sBAAsB;YAC7B,OAAO,EAAE,wCAAwC;YACjD,UAAU,EAAE,8BAA8B,CAAC,OAAO;SACnD;QACD;YACE,KAAK,EAAE,iBAAiB;YACxB,OAAO,EAAE,0CAA0C;YACnD,UAAU,EAAE,8BAA8B,CAAC,OAAO;SACnD;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3C,SAAS,CAAC,IAAI,GAAG;IACf,gBAAgB,EAAE;QAChB;YACE,KAAK,EAAE,iBAAiB;YACxB,OAAO,EAAE,iCAAiC;YAC1C,UAAU,EAAE,8BAA8B,CAAC,OAAO;SACnD;QACD;YACE,KAAK,EAAE,uBAAuB;YAC9B,OAAO,EAAE,6CAA6C;YACtD,UAAU,EAAE,8BAA8B,CAAC,KAAK;SACjD;QACD;YACE,KAAK,EAAE,qBAAqB;YAC5B,OAAO,EAAE,wCAAwC;YACjD,UAAU,EAAE,8BAA8B,CAAC,OAAO;SACnD;KACF;CACF,CAAC","sourcesContent":["import { SulaTimelineListItemIconStatus } from './model/sula-timeline-list.model';\n\nexport default {\n title: 'Components/sula-timeline-list',\n tags: ['autodocs'],\n argTypes: {\n sulaTimelineList: {\n control: 'object',\n defaultValue: [\n {\n title: 'Item 1',\n message: 'Primeira mensagem da timeline',\n weekdayText: {\n weekday: 'SEG',\n day: '15',\n },\n },\n {\n title: 'Item 2',\n message: 'Segunda mensagem da timeline',\n iconStatus: SulaTimelineListItemIconStatus.Success,\n },\n ],\n description: 'Lista de itens da timeline (pode usar texto de dia da semana ou ícone com status)',\n type: {\n required: true,\n },\n },\n itemClicked: {\n action: 'itemClicked',\n description: 'Evento emitido quando o item é clicado',\n },\n },\n parameters: {\n docs: {\n description: {\n component:\n 'O componente Timeline List do Sula Design System é utilizado para exibir uma sequência cronológica de eventos ou etapas. Cada item pode conter um título, mensagem opcional, e pode ser representado por um dia da semana ou por um ícone com status (sucesso, aviso ou erro).',\n },\n },\n },\n};\n\nconst Template = args => {\n const container = document.createElement('div');\n container.style.margin = '20px';\n\n const el = document.createElement('sula-timeline-list');\n\n // Converte o array para string JSON para passar como atributo\n if (args.sulaTimelineList) {\n el.sulaTimelineList = args.sulaTimelineList;\n }\n\n container.appendChild(el);\n el.addEventListener('itemClicked', args.itemClicked);\n\n return container;\n};\n\nexport const Default = Template.bind({});\nDefault.args = {\n sulaTimelineList: [\n {\n title: 'Primeiro evento',\n message: 'Descrição do primeiro evento da timeline',\n weekdayText: {\n weekday: 'SEG',\n day: '15',\n },\n hasLink: true\n },\n {\n title: 'Segundo evento',\n message: 'Descrição do segundo evento',\n weekdayText: {\n weekday: 'TER',\n day: '16',\n },\n },\n {\n title: 'Terceiro evento',\n message: 'Descrição do terceiro evento',\n weekdayText: {\n weekday: 'QUA',\n day: '17',\n },\n },\n ],\n};\n\nexport const WithIconStatus = Template.bind({});\nWithIconStatus.args = {\n sulaTimelineList: [\n {\n title: 'Tarefa concluída',\n message: 'Esta tarefa foi finalizada com sucesso',\n iconStatus: SulaTimelineListItemIconStatus.Success,\n hasLink: true\n },\n {\n title: 'Atenção necessária',\n message: 'Esta tarefa precisa de atenção',\n iconStatus: SulaTimelineListItemIconStatus.Warning,\n hasLink: true\n },\n {\n title: 'Erro encontrado',\n message: 'Houve um problema nesta etapa',\n iconStatus: SulaTimelineListItemIconStatus.Error,\n hasLink: true\n },\n ],\n};\n\nexport const MixedContent = Template.bind({});\nMixedContent.args = {\n sulaTimelineList: [\n {\n title: 'Reunião agendada',\n message: 'Reunião de planejamento semanal',\n weekdayText: {\n weekday: 'SEG',\n day: '20',\n },\n },\n {\n title: 'Projeto aprovado',\n message: 'O projeto foi aprovado pela diretoria',\n iconStatus: SulaTimelineListItemIconStatus.Success,\n hasLink: true\n },\n {\n title: 'Revisão pendente',\n message: 'Documentação precisa ser revisada',\n iconStatus: SulaTimelineListItemIconStatus.Warning,\n hasLink: true\n },\n {\n title: 'Entrega final',\n message: 'Entrega do produto final',\n weekdayText: {\n weekday: 'SEX',\n day: '24',\n },\n },\n ],\n};\n\nexport const OnlyTitles = Template.bind({});\nOnlyTitles.args = {\n sulaTimelineList: [\n {\n title: 'Início do projeto',\n weekdayText: {\n weekday: 'SEG',\n day: '01',\n },\n },\n {\n title: 'Desenvolvimento',\n iconStatus: SulaTimelineListItemIconStatus.Warning,\n },\n {\n title: 'Testes',\n iconStatus: SulaTimelineListItemIconStatus.Success,\n hasLink: true\n },\n {\n title: 'Deploy',\n weekdayText: {\n weekday: 'SEX',\n day: '05',\n },\n },\n ],\n};\n\nexport const SingleItem = Template.bind({});\nSingleItem.args = {\n sulaTimelineList: [\n {\n title: 'Evento único',\n message: 'Este é um evento isolado na timeline',\n iconStatus: SulaTimelineListItemIconStatus.Success,\n },\n ],\n};\n\nexport const SuccessFlow = Template.bind({});\nSuccessFlow.args = {\n sulaTimelineList: [\n {\n title: 'Pedido recebido',\n message: 'Seu pedido foi recebido e está sendo processado',\n iconStatus: SulaTimelineListItemIconStatus.Success,\n },\n {\n title: 'Pagamento confirmado',\n message: 'O pagamento foi processado com sucesso',\n iconStatus: SulaTimelineListItemIconStatus.Success,\n },\n {\n title: 'Produto enviado',\n message: 'Seu produto foi enviado e está a caminho',\n iconStatus: SulaTimelineListItemIconStatus.Success,\n },\n ],\n};\n\nexport const ErrorFlow = Template.bind({});\nErrorFlow.args = {\n sulaTimelineList: [\n {\n title: 'Pedido iniciado',\n message: 'Processo de pedido foi iniciado',\n iconStatus: SulaTimelineListItemIconStatus.Success,\n },\n {\n title: 'Problema no pagamento',\n message: 'Houve um erro no processamento do pagamento',\n iconStatus: SulaTimelineListItemIconStatus.Error,\n },\n {\n title: 'Aguardando correção',\n message: 'Aguardando nova tentativa de pagamento',\n iconStatus: SulaTimelineListItemIconStatus.Warning,\n },\n ],\n};\n"]}
|
package/dist/components/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const globalStyles = "*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box }:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4 }body{line-height:inherit;margin:0 }hr{border-top-width:1px;color:inherit;height:0 }abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal }small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0 }button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0 }button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none }:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px }::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit }summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1 }[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle }img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:root{text-rendering:optimizeLegibility}";
|
|
2
2
|
|
|
3
3
|
const NAMESPACE = 'webcomponents';
|
|
4
|
-
const BUILD = /* webcomponents */ { hydratedSelectorName: "hydrated", lazyLoad: false, updatable: true
|
|
4
|
+
const BUILD = /* webcomponents */ { hydratedSelectorName: "hydrated", lazyLoad: false, updatable: true};
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
Stencil Client Platform v4.35.1 | MIT Licensed | https://stenciljs.com
|
|
@@ -952,6 +952,18 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
952
952
|
if (didValueChange) {
|
|
953
953
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
954
954
|
{
|
|
955
|
+
if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
956
|
+
const watchMethods = cmpMeta.$watchers$[propName];
|
|
957
|
+
if (watchMethods) {
|
|
958
|
+
watchMethods.map((watchMethodName) => {
|
|
959
|
+
try {
|
|
960
|
+
instance[watchMethodName](newVal, oldVal, propName);
|
|
961
|
+
} catch (e) {
|
|
962
|
+
consoleError(e, elm);
|
|
963
|
+
}
|
|
964
|
+
});
|
|
965
|
+
}
|
|
966
|
+
}
|
|
955
967
|
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
956
968
|
if (instance.componentShouldUpdate) {
|
|
957
969
|
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
@@ -968,7 +980,10 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
968
980
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
969
981
|
var _a, _b;
|
|
970
982
|
const prototype = Cstr.prototype;
|
|
971
|
-
if (cmpMeta.$members$ ||
|
|
983
|
+
if (cmpMeta.$members$ || (cmpMeta.$watchers$ || Cstr.watchers)) {
|
|
984
|
+
if (Cstr.watchers && !cmpMeta.$watchers$) {
|
|
985
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
986
|
+
}
|
|
972
987
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
973
988
|
members.map(([memberName, [memberFlags]]) => {
|
|
974
989
|
if ((memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
|
|
@@ -1161,6 +1176,9 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
1161
1176
|
{
|
|
1162
1177
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
1163
1178
|
}
|
|
1179
|
+
{
|
|
1180
|
+
cmpMeta.$watchers$ = Cstr.$watchers$;
|
|
1181
|
+
}
|
|
1164
1182
|
const originalConnectedCallback = Cstr.prototype.connectedCallback;
|
|
1165
1183
|
const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
|
|
1166
1184
|
Object.assign(Cstr.prototype, {
|