@dubai-design-system/components-js 3.12.4 → 3.12.5
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/dda-attach-file.cjs.entry.js +5 -2
- package/dist/cjs/dda-attach-file.cjs.entry.js.map +1 -1
- package/dist/cjs/dda-header.cjs.entry.js +8 -5
- package/dist/cjs/dda-header.cjs.entry.js.map +1 -1
- package/dist/cjs/dda-horizontal-stepper.cjs.entry.js +1 -1
- package/dist/cjs/dda-segmented-tabs.cjs.entry.js +1 -1
- package/dist/cjs/dda-select.cjs.entry.js +2 -2
- package/dist/cjs/dda-select.cjs.entry.js.map +1 -1
- package/dist/cjs/dda-split-button.cjs.entry.js +56 -0
- package/dist/cjs/dda-split-button.cjs.entry.js.map +1 -0
- package/dist/cjs/dda-sticky-footer.cjs.entry.js +1 -1
- package/dist/cjs/dda-tabs.cjs.entry.js +1 -1
- package/dist/cjs/dda-textarea.cjs.entry.js +1 -1
- package/dist/cjs/dda-toggle.cjs.entry.js +2 -2
- package/dist/cjs/dda-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/dda-vertical-stepper.cjs.entry.js +1 -1
- package/dist/cjs/dda.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/dda-attach-file/dda-attach-file.js +24 -2
- package/dist/collection/components/dda-attach-file/dda-attach-file.js.map +1 -1
- package/dist/collection/components/dda-attach-file/dda-attach-file.stories.js +3 -0
- package/dist/collection/components/dda-attach-file/dda-attach-file.stories.js.map +1 -1
- package/dist/collection/components/dda-header/dda-header.js +8 -5
- package/dist/collection/components/dda-header/dda-header.js.map +1 -1
- package/dist/collection/components/dda-select/dda-select.js +2 -2
- package/dist/collection/components/dda-select/dda-select.js.map +1 -1
- package/dist/collection/components/dda-select/dda-select.stories.js +4 -3
- package/dist/collection/components/dda-select/dda-select.stories.js.map +1 -1
- package/dist/collection/components/dda-split-button/dda-split-button.css +607 -0
- package/dist/collection/components/dda-split-button/dda-split-button.js +395 -0
- package/dist/collection/components/dda-split-button/dda-split-button.js.map +1 -0
- package/dist/collection/components/dda-split-button/dda-split-button.stories.js +125 -0
- package/dist/collection/components/dda-split-button/dda-split-button.stories.js.map +1 -0
- package/dist/collection/components/dda-sticky-footer/dda-sticky-footer.js +1 -1
- package/dist/collection/components/dda-tabs/dda-tabs.js +1 -1
- package/dist/collection/components/dda-textarea/dda-textarea.js +1 -1
- package/dist/collection/components/dda-toggle/dda-toggle.js +2 -2
- package/dist/collection/components/dda-tooltip/dda-tooltip.js +1 -1
- package/dist/collection/components/segmented-groups/dda-segmented-tabs/dda-segmented-tabs.js +1 -1
- package/dist/collection/components/stepper/dda-horizontal-stepper/dda-horizontal-stepper.js +1 -1
- package/dist/collection/components/stepper/dda-vertical-stepper/dda-vertical-stepper.js +1 -1
- package/dist/components/dda-attach-file.js +6 -2
- package/dist/components/dda-attach-file.js.map +1 -1
- package/dist/components/dda-header.js +9 -6
- package/dist/components/dda-header.js.map +1 -1
- package/dist/components/dda-horizontal-stepper.js +1 -1
- package/dist/components/dda-segmented-tabs.js +1 -1
- package/dist/components/dda-select.js +2 -2
- package/dist/components/dda-select.js.map +1 -1
- package/dist/components/dda-split-button.d.ts +11 -0
- package/dist/components/dda-split-button.js +87 -0
- package/dist/components/dda-split-button.js.map +1 -0
- package/dist/components/dda-sticky-footer.js +2 -2
- package/dist/components/dda-tabs.js +1 -1
- package/dist/components/dda-textarea.js +1 -1
- package/dist/components/dda-toggle.js +2 -2
- package/dist/components/dda-tooltip.js +1 -1
- package/dist/components/dda-vertical-stepper.js +1 -1
- package/dist/components/{p-e5df7bea.js → p-426c4cde.js} +2 -2
- package/dist/components/{p-e5df7bea.js.map → p-426c4cde.js.map} +1 -1
- package/dist/dda/dda.esm.js +1 -1
- package/dist/dda/dda.esm.js.map +1 -1
- package/dist/dda/{p-1cf47f82.entry.js → p-11b79158.entry.js} +2 -2
- package/dist/dda/{p-210d62fb.entry.js → p-24da4601.entry.js} +2 -2
- package/dist/dda/p-24da4601.entry.js.map +1 -0
- package/dist/dda/p-2525597b.entry.js +2 -0
- package/dist/dda/p-2525597b.entry.js.map +1 -0
- package/dist/dda/{p-6907700e.entry.js → p-27c798b5.entry.js} +2 -2
- package/dist/dda/{p-bdaee99c.entry.js → p-4a2eeccb.entry.js} +2 -2
- package/dist/dda/{p-448d72f4.entry.js → p-5c5aeda7.entry.js} +2 -2
- package/dist/dda/p-5c5aeda7.entry.js.map +1 -0
- package/dist/dda/{p-3e36c414.entry.js → p-78b3487b.entry.js} +2 -2
- package/dist/dda/{p-cd518bfb.entry.js → p-9c090bc6.entry.js} +2 -2
- package/dist/dda/p-9c090bc6.entry.js.map +1 -0
- package/dist/dda/{p-f60d6c1f.entry.js → p-af2345fb.entry.js} +2 -2
- package/dist/dda/{p-a42f8db6.entry.js → p-b0185c4d.entry.js} +2 -2
- package/dist/dda/{p-e5783b18.entry.js → p-ca2e33b9.entry.js} +2 -2
- package/dist/dda/{p-90c3c3b3.entry.js → p-ca50cf49.entry.js} +2 -2
- package/dist/esm/dda-attach-file.entry.js +5 -2
- package/dist/esm/dda-attach-file.entry.js.map +1 -1
- package/dist/esm/dda-header.entry.js +8 -5
- package/dist/esm/dda-header.entry.js.map +1 -1
- package/dist/esm/dda-horizontal-stepper.entry.js +1 -1
- package/dist/esm/dda-segmented-tabs.entry.js +1 -1
- package/dist/esm/dda-select.entry.js +2 -2
- package/dist/esm/dda-select.entry.js.map +1 -1
- package/dist/esm/dda-split-button.entry.js +52 -0
- package/dist/esm/dda-split-button.entry.js.map +1 -0
- package/dist/esm/dda-sticky-footer.entry.js +1 -1
- package/dist/esm/dda-tabs.entry.js +1 -1
- package/dist/esm/dda-textarea.entry.js +1 -1
- package/dist/esm/dda-toggle.entry.js +2 -2
- package/dist/esm/dda-tooltip.entry.js +1 -1
- package/dist/esm/dda-vertical-stepper.entry.js +1 -1
- package/dist/esm/dda.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/dda-attach-file/dda-attach-file.d.ts +1 -0
- package/dist/types/components/dda-attach-file/dda-attach-file.stories.d.ts +4 -0
- package/dist/types/components/dda-split-button/dda-split-button.d.ts +27 -0
- package/dist/types/components/dda-split-button/dda-split-button.stories.d.ts +77 -0
- package/dist/types/components.d.ts +63 -0
- package/package.json +2 -2
- package/readme.md +6 -0
- package/www/build/dda.esm.js +1 -1
- package/www/build/dda.esm.js.map +1 -1
- package/www/build/{p-1cf47f82.entry.js → p-11b79158.entry.js} +2 -2
- package/www/build/{p-210d62fb.entry.js → p-24da4601.entry.js} +2 -2
- package/www/build/p-24da4601.entry.js.map +1 -0
- package/www/build/p-2525597b.entry.js +2 -0
- package/www/build/p-2525597b.entry.js.map +1 -0
- package/www/build/{p-6907700e.entry.js → p-27c798b5.entry.js} +2 -2
- package/www/build/{p-bdaee99c.entry.js → p-4a2eeccb.entry.js} +2 -2
- package/www/build/{p-448d72f4.entry.js → p-5c5aeda7.entry.js} +2 -2
- package/www/build/p-5c5aeda7.entry.js.map +1 -0
- package/www/build/{p-3e36c414.entry.js → p-78b3487b.entry.js} +2 -2
- package/www/build/{p-cd518bfb.entry.js → p-9c090bc6.entry.js} +2 -2
- package/www/build/p-9c090bc6.entry.js.map +1 -0
- package/www/build/{p-f60d6c1f.entry.js → p-af2345fb.entry.js} +2 -2
- package/www/build/{p-a42f8db6.entry.js → p-b0185c4d.entry.js} +2 -2
- package/www/build/{p-e5783b18.entry.js → p-ca2e33b9.entry.js} +2 -2
- package/www/build/{p-90c3c3b3.entry.js → p-ca50cf49.entry.js} +2 -2
- package/dist/dda/p-210d62fb.entry.js.map +0 -1
- package/dist/dda/p-448d72f4.entry.js.map +0 -1
- package/dist/dda/p-cd518bfb.entry.js.map +0 -1
- package/www/build/p-210d62fb.entry.js.map +0 -1
- package/www/build/p-448d72f4.entry.js.map +0 -1
- package/www/build/p-cd518bfb.entry.js.map +0 -1
- /package/dist/dda/{p-1cf47f82.entry.js.map → p-11b79158.entry.js.map} +0 -0
- /package/dist/dda/{p-6907700e.entry.js.map → p-27c798b5.entry.js.map} +0 -0
- /package/dist/dda/{p-bdaee99c.entry.js.map → p-4a2eeccb.entry.js.map} +0 -0
- /package/dist/dda/{p-3e36c414.entry.js.map → p-78b3487b.entry.js.map} +0 -0
- /package/dist/dda/{p-f60d6c1f.entry.js.map → p-af2345fb.entry.js.map} +0 -0
- /package/dist/dda/{p-a42f8db6.entry.js.map → p-b0185c4d.entry.js.map} +0 -0
- /package/dist/dda/{p-e5783b18.entry.js.map → p-ca2e33b9.entry.js.map} +0 -0
- /package/dist/dda/{p-90c3c3b3.entry.js.map → p-ca50cf49.entry.js.map} +0 -0
- /package/www/build/{p-1cf47f82.entry.js.map → p-11b79158.entry.js.map} +0 -0
- /package/www/build/{p-6907700e.entry.js.map → p-27c798b5.entry.js.map} +0 -0
- /package/www/build/{p-bdaee99c.entry.js.map → p-4a2eeccb.entry.js.map} +0 -0
- /package/www/build/{p-3e36c414.entry.js.map → p-78b3487b.entry.js.map} +0 -0
- /package/www/build/{p-f60d6c1f.entry.js.map → p-af2345fb.entry.js.map} +0 -0
- /package/www/build/{p-a42f8db6.entry.js.map → p-b0185c4d.entry.js.map} +0 -0
- /package/www/build/{p-e5783b18.entry.js.map → p-ca2e33b9.entry.js.map} +0 -0
- /package/www/build/{p-90c3c3b3.entry.js.map → p-ca50cf49.entry.js.map} +0 -0
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
export class DdaSplitButton {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.button_type = 'button';
|
|
5
|
+
this.disabled = false;
|
|
6
|
+
this.start_icon_family = '';
|
|
7
|
+
this.start_icon = '';
|
|
8
|
+
this.button_text = '';
|
|
9
|
+
this.aria_label = '';
|
|
10
|
+
this.button_color = 'primary';
|
|
11
|
+
this.button_shape = '';
|
|
12
|
+
this.icon_button_shape = '';
|
|
13
|
+
this.custom_class = '';
|
|
14
|
+
this.button_name = '';
|
|
15
|
+
this.handleClick = (event) => {
|
|
16
|
+
if (this.disabled)
|
|
17
|
+
return;
|
|
18
|
+
this.buttonClick.emit({
|
|
19
|
+
event,
|
|
20
|
+
id: this.button_id,
|
|
21
|
+
value: this.value,
|
|
22
|
+
name: this.button_name,
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
const buttonClass = [
|
|
28
|
+
'dda-split-btn',
|
|
29
|
+
`btn-color-${this.button_color}`,
|
|
30
|
+
this.size ? `btn-size-${this.size}` : '',
|
|
31
|
+
this.button_shape ? `split-btn-shape-${this.button_shape}` : '',
|
|
32
|
+
this.icon_button_shape ? `icon-btn-${this.icon_button_shape}` : '',
|
|
33
|
+
this.gap ? `dda-gap-${this.gap}` : '',
|
|
34
|
+
this.custom_class,
|
|
35
|
+
this.component_mode,
|
|
36
|
+
]
|
|
37
|
+
.filter(Boolean)
|
|
38
|
+
.join(' ');
|
|
39
|
+
return (h(Host, { key: '4fa9e3147d92b59ff992c70abe60cc4e6cff2d8c' }, h("div", { key: 'd2151cf6cfbfa221e179f99fe1ab8cd3d7176388', class: "split-btn-container" }, h("button", { key: 'cfa584ca0cb7518a42b025b50c0966eb848922af', id: this.button_id, type: this.button_type, class: buttonClass, disabled: this.disabled, "aria-label": this.aria_label || this.button_text, name: this.button_name, value: this.value, onClick: this.handleClick }, this.start_icon && (h("i", { key: 'ce0e7e51be1d34a8beb6e0433591c4686302fa5b', class: "material-icons material-symbols-outlined", "aria-hidden": "true" }, this.start_icon)), this.button_text), h("button", { key: 'deffec49b0b519f81bab94322ae834849dbdc65e', class: "split-btn-arrow" }))));
|
|
40
|
+
}
|
|
41
|
+
static get is() { return "dda-split-button"; }
|
|
42
|
+
static get originalStyleUrls() {
|
|
43
|
+
return {
|
|
44
|
+
"$": ["dda-split-button.css"]
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
static get styleUrls() {
|
|
48
|
+
return {
|
|
49
|
+
"$": ["dda-split-button.css"]
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
static get properties() {
|
|
53
|
+
return {
|
|
54
|
+
"button_type": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"mutable": false,
|
|
57
|
+
"complexType": {
|
|
58
|
+
"original": "string",
|
|
59
|
+
"resolved": "string",
|
|
60
|
+
"references": {}
|
|
61
|
+
},
|
|
62
|
+
"required": false,
|
|
63
|
+
"optional": false,
|
|
64
|
+
"docs": {
|
|
65
|
+
"tags": [],
|
|
66
|
+
"text": ""
|
|
67
|
+
},
|
|
68
|
+
"getter": false,
|
|
69
|
+
"setter": false,
|
|
70
|
+
"attribute": "button_type",
|
|
71
|
+
"reflect": false,
|
|
72
|
+
"defaultValue": "'button'"
|
|
73
|
+
},
|
|
74
|
+
"disabled": {
|
|
75
|
+
"type": "boolean",
|
|
76
|
+
"mutable": false,
|
|
77
|
+
"complexType": {
|
|
78
|
+
"original": "boolean",
|
|
79
|
+
"resolved": "boolean",
|
|
80
|
+
"references": {}
|
|
81
|
+
},
|
|
82
|
+
"required": false,
|
|
83
|
+
"optional": false,
|
|
84
|
+
"docs": {
|
|
85
|
+
"tags": [],
|
|
86
|
+
"text": ""
|
|
87
|
+
},
|
|
88
|
+
"getter": false,
|
|
89
|
+
"setter": false,
|
|
90
|
+
"attribute": "disabled",
|
|
91
|
+
"reflect": false,
|
|
92
|
+
"defaultValue": "false"
|
|
93
|
+
},
|
|
94
|
+
"start_icon_family": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"mutable": false,
|
|
97
|
+
"complexType": {
|
|
98
|
+
"original": "string",
|
|
99
|
+
"resolved": "string",
|
|
100
|
+
"references": {}
|
|
101
|
+
},
|
|
102
|
+
"required": false,
|
|
103
|
+
"optional": false,
|
|
104
|
+
"docs": {
|
|
105
|
+
"tags": [],
|
|
106
|
+
"text": ""
|
|
107
|
+
},
|
|
108
|
+
"getter": false,
|
|
109
|
+
"setter": false,
|
|
110
|
+
"attribute": "start_icon_family",
|
|
111
|
+
"reflect": false,
|
|
112
|
+
"defaultValue": "''"
|
|
113
|
+
},
|
|
114
|
+
"start_icon": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"mutable": false,
|
|
117
|
+
"complexType": {
|
|
118
|
+
"original": "string",
|
|
119
|
+
"resolved": "string",
|
|
120
|
+
"references": {}
|
|
121
|
+
},
|
|
122
|
+
"required": false,
|
|
123
|
+
"optional": false,
|
|
124
|
+
"docs": {
|
|
125
|
+
"tags": [],
|
|
126
|
+
"text": ""
|
|
127
|
+
},
|
|
128
|
+
"getter": false,
|
|
129
|
+
"setter": false,
|
|
130
|
+
"attribute": "start_icon",
|
|
131
|
+
"reflect": false,
|
|
132
|
+
"defaultValue": "''"
|
|
133
|
+
},
|
|
134
|
+
"button_text": {
|
|
135
|
+
"type": "string",
|
|
136
|
+
"mutable": false,
|
|
137
|
+
"complexType": {
|
|
138
|
+
"original": "string",
|
|
139
|
+
"resolved": "string",
|
|
140
|
+
"references": {}
|
|
141
|
+
},
|
|
142
|
+
"required": false,
|
|
143
|
+
"optional": false,
|
|
144
|
+
"docs": {
|
|
145
|
+
"tags": [],
|
|
146
|
+
"text": ""
|
|
147
|
+
},
|
|
148
|
+
"getter": false,
|
|
149
|
+
"setter": false,
|
|
150
|
+
"attribute": "button_text",
|
|
151
|
+
"reflect": false,
|
|
152
|
+
"defaultValue": "''"
|
|
153
|
+
},
|
|
154
|
+
"aria_label": {
|
|
155
|
+
"type": "string",
|
|
156
|
+
"mutable": false,
|
|
157
|
+
"complexType": {
|
|
158
|
+
"original": "string",
|
|
159
|
+
"resolved": "string",
|
|
160
|
+
"references": {}
|
|
161
|
+
},
|
|
162
|
+
"required": false,
|
|
163
|
+
"optional": true,
|
|
164
|
+
"docs": {
|
|
165
|
+
"tags": [],
|
|
166
|
+
"text": ""
|
|
167
|
+
},
|
|
168
|
+
"getter": false,
|
|
169
|
+
"setter": false,
|
|
170
|
+
"attribute": "aria_label",
|
|
171
|
+
"reflect": false,
|
|
172
|
+
"defaultValue": "''"
|
|
173
|
+
},
|
|
174
|
+
"button_color": {
|
|
175
|
+
"type": "string",
|
|
176
|
+
"mutable": false,
|
|
177
|
+
"complexType": {
|
|
178
|
+
"original": "string",
|
|
179
|
+
"resolved": "string",
|
|
180
|
+
"references": {}
|
|
181
|
+
},
|
|
182
|
+
"required": false,
|
|
183
|
+
"optional": false,
|
|
184
|
+
"docs": {
|
|
185
|
+
"tags": [],
|
|
186
|
+
"text": ""
|
|
187
|
+
},
|
|
188
|
+
"getter": false,
|
|
189
|
+
"setter": false,
|
|
190
|
+
"attribute": "button_color",
|
|
191
|
+
"reflect": false,
|
|
192
|
+
"defaultValue": "'primary'"
|
|
193
|
+
},
|
|
194
|
+
"size": {
|
|
195
|
+
"type": "string",
|
|
196
|
+
"mutable": false,
|
|
197
|
+
"complexType": {
|
|
198
|
+
"original": "string",
|
|
199
|
+
"resolved": "string",
|
|
200
|
+
"references": {}
|
|
201
|
+
},
|
|
202
|
+
"required": false,
|
|
203
|
+
"optional": true,
|
|
204
|
+
"docs": {
|
|
205
|
+
"tags": [],
|
|
206
|
+
"text": ""
|
|
207
|
+
},
|
|
208
|
+
"getter": false,
|
|
209
|
+
"setter": false,
|
|
210
|
+
"attribute": "size",
|
|
211
|
+
"reflect": false
|
|
212
|
+
},
|
|
213
|
+
"button_shape": {
|
|
214
|
+
"type": "string",
|
|
215
|
+
"mutable": false,
|
|
216
|
+
"complexType": {
|
|
217
|
+
"original": "string",
|
|
218
|
+
"resolved": "string",
|
|
219
|
+
"references": {}
|
|
220
|
+
},
|
|
221
|
+
"required": false,
|
|
222
|
+
"optional": true,
|
|
223
|
+
"docs": {
|
|
224
|
+
"tags": [],
|
|
225
|
+
"text": ""
|
|
226
|
+
},
|
|
227
|
+
"getter": false,
|
|
228
|
+
"setter": false,
|
|
229
|
+
"attribute": "button_shape",
|
|
230
|
+
"reflect": false,
|
|
231
|
+
"defaultValue": "''"
|
|
232
|
+
},
|
|
233
|
+
"icon_button_shape": {
|
|
234
|
+
"type": "string",
|
|
235
|
+
"mutable": false,
|
|
236
|
+
"complexType": {
|
|
237
|
+
"original": "string",
|
|
238
|
+
"resolved": "string",
|
|
239
|
+
"references": {}
|
|
240
|
+
},
|
|
241
|
+
"required": false,
|
|
242
|
+
"optional": true,
|
|
243
|
+
"docs": {
|
|
244
|
+
"tags": [],
|
|
245
|
+
"text": ""
|
|
246
|
+
},
|
|
247
|
+
"getter": false,
|
|
248
|
+
"setter": false,
|
|
249
|
+
"attribute": "icon_button_shape",
|
|
250
|
+
"reflect": false,
|
|
251
|
+
"defaultValue": "''"
|
|
252
|
+
},
|
|
253
|
+
"gap": {
|
|
254
|
+
"type": "number",
|
|
255
|
+
"mutable": false,
|
|
256
|
+
"complexType": {
|
|
257
|
+
"original": "number",
|
|
258
|
+
"resolved": "number",
|
|
259
|
+
"references": {}
|
|
260
|
+
},
|
|
261
|
+
"required": false,
|
|
262
|
+
"optional": true,
|
|
263
|
+
"docs": {
|
|
264
|
+
"tags": [],
|
|
265
|
+
"text": ""
|
|
266
|
+
},
|
|
267
|
+
"getter": false,
|
|
268
|
+
"setter": false,
|
|
269
|
+
"attribute": "gap",
|
|
270
|
+
"reflect": false
|
|
271
|
+
},
|
|
272
|
+
"custom_class": {
|
|
273
|
+
"type": "string",
|
|
274
|
+
"mutable": false,
|
|
275
|
+
"complexType": {
|
|
276
|
+
"original": "string",
|
|
277
|
+
"resolved": "string",
|
|
278
|
+
"references": {}
|
|
279
|
+
},
|
|
280
|
+
"required": false,
|
|
281
|
+
"optional": true,
|
|
282
|
+
"docs": {
|
|
283
|
+
"tags": [],
|
|
284
|
+
"text": ""
|
|
285
|
+
},
|
|
286
|
+
"getter": false,
|
|
287
|
+
"setter": false,
|
|
288
|
+
"attribute": "custom_class",
|
|
289
|
+
"reflect": false,
|
|
290
|
+
"defaultValue": "''"
|
|
291
|
+
},
|
|
292
|
+
"component_mode": {
|
|
293
|
+
"type": "string",
|
|
294
|
+
"mutable": false,
|
|
295
|
+
"complexType": {
|
|
296
|
+
"original": "string",
|
|
297
|
+
"resolved": "string",
|
|
298
|
+
"references": {}
|
|
299
|
+
},
|
|
300
|
+
"required": false,
|
|
301
|
+
"optional": true,
|
|
302
|
+
"docs": {
|
|
303
|
+
"tags": [],
|
|
304
|
+
"text": ""
|
|
305
|
+
},
|
|
306
|
+
"getter": false,
|
|
307
|
+
"setter": false,
|
|
308
|
+
"attribute": "component_mode",
|
|
309
|
+
"reflect": false
|
|
310
|
+
},
|
|
311
|
+
"button_id": {
|
|
312
|
+
"type": "string",
|
|
313
|
+
"mutable": false,
|
|
314
|
+
"complexType": {
|
|
315
|
+
"original": "string",
|
|
316
|
+
"resolved": "string",
|
|
317
|
+
"references": {}
|
|
318
|
+
},
|
|
319
|
+
"required": false,
|
|
320
|
+
"optional": false,
|
|
321
|
+
"docs": {
|
|
322
|
+
"tags": [],
|
|
323
|
+
"text": ""
|
|
324
|
+
},
|
|
325
|
+
"getter": false,
|
|
326
|
+
"setter": false,
|
|
327
|
+
"attribute": "button_id",
|
|
328
|
+
"reflect": false
|
|
329
|
+
},
|
|
330
|
+
"button_name": {
|
|
331
|
+
"type": "string",
|
|
332
|
+
"mutable": false,
|
|
333
|
+
"complexType": {
|
|
334
|
+
"original": "string",
|
|
335
|
+
"resolved": "string",
|
|
336
|
+
"references": {}
|
|
337
|
+
},
|
|
338
|
+
"required": false,
|
|
339
|
+
"optional": true,
|
|
340
|
+
"docs": {
|
|
341
|
+
"tags": [],
|
|
342
|
+
"text": ""
|
|
343
|
+
},
|
|
344
|
+
"getter": false,
|
|
345
|
+
"setter": false,
|
|
346
|
+
"attribute": "button_name",
|
|
347
|
+
"reflect": false,
|
|
348
|
+
"defaultValue": "''"
|
|
349
|
+
},
|
|
350
|
+
"value": {
|
|
351
|
+
"type": "string",
|
|
352
|
+
"mutable": false,
|
|
353
|
+
"complexType": {
|
|
354
|
+
"original": "string",
|
|
355
|
+
"resolved": "string",
|
|
356
|
+
"references": {}
|
|
357
|
+
},
|
|
358
|
+
"required": false,
|
|
359
|
+
"optional": true,
|
|
360
|
+
"docs": {
|
|
361
|
+
"tags": [],
|
|
362
|
+
"text": ""
|
|
363
|
+
},
|
|
364
|
+
"getter": false,
|
|
365
|
+
"setter": false,
|
|
366
|
+
"attribute": "value",
|
|
367
|
+
"reflect": false
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
static get events() {
|
|
372
|
+
return [{
|
|
373
|
+
"method": "buttonClick",
|
|
374
|
+
"name": "buttonClick",
|
|
375
|
+
"bubbles": true,
|
|
376
|
+
"cancelable": true,
|
|
377
|
+
"composed": true,
|
|
378
|
+
"docs": {
|
|
379
|
+
"tags": [],
|
|
380
|
+
"text": ""
|
|
381
|
+
},
|
|
382
|
+
"complexType": {
|
|
383
|
+
"original": "{ event: MouseEvent, id: string, value: string, name: string }",
|
|
384
|
+
"resolved": "{ event: MouseEvent; id: string; value: string; name: string; }",
|
|
385
|
+
"references": {
|
|
386
|
+
"MouseEvent": {
|
|
387
|
+
"location": "global",
|
|
388
|
+
"id": "global::MouseEvent"
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}];
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
//# sourceMappingURL=dda-split-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dda-split-button.js","sourceRoot":"","sources":["../../../src/components/dda-split-button/dda-split-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AAO9E,MAAM,OAAO,cAAc;IAL3B;QAMU,gBAAW,GAAW,QAAQ,CAAC;QAC/B,aAAQ,GAAY,KAAK,CAAC;QAC1B,sBAAiB,GAAW,EAAE,CAAC;QAC/B,eAAU,GAAW,EAAE,CA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AClB,IAAI,EAAE,IAAI,CAAC,WAAW,EACtB,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,IAAI,CAAC,QAAQ,gBACX,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,WAAW,EAC/C,IAAI,EAAE,IAAI,CAAC,WAAW,EACtB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,IAAI,CAAC,WAAW;oBAExB,IAAI,CAAC,UAAU,IAAI,CAChB,0DAAG,KAAK,EAAC,0CAA0C,iBAAa,MAAM,IACrE,IAAI,CAAC,UAAU,CACZ,CACP;oBACA,IAAI,CAAC,WAAW,CACR;gBACT,+DAAQ,KAAK,EAAC,iBAAiB,GAEtB,CACP,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Host, Component, Prop, h, Event, EventEmitter } from '@stencil/core';\r\n\r\n@Component({\r\n tag: 'dda-split-button',\r\n styleUrls: ['dda-split-button.css'],\r\n shadow: false,\r\n})\r\nexport class DdaSplitButton {\r\n @Prop() button_type: string = 'button';\r\n @Prop() disabled: boolean = false;\r\n @Prop() start_icon_family: string = '';\r\n @Prop() start_icon: string = '';\r\n @Prop() button_text: string = '';\r\n @Prop() aria_label?: string = '';\r\n @Prop() button_color: string = 'primary';\r\n @Prop() size?: string;\r\n @Prop() button_shape?: string = '';\r\n @Prop() icon_button_shape?: string = '';\r\n @Prop() gap?: number;\r\n @Prop() custom_class?: string = '';\r\n @Prop() component_mode?: string;\r\n @Prop() button_id: string;\r\n @Prop() button_name?: string = '';\r\n @Prop() value?: string;\r\n\r\n @Event() buttonClick: EventEmitter<{ event: MouseEvent, id: string, value: string, name: string }>;\r\n\r\n private handleClick = (event: MouseEvent) => {\r\n if (this.disabled) return;\r\n\r\n this.buttonClick.emit({\r\n event,\r\n id: this.button_id,\r\n value: this.value,\r\n name: this.button_name,\r\n });\r\n };\r\n \r\n\r\n render() {\r\n const buttonClass = [\r\n 'dda-split-btn',\r\n `btn-color-${this.button_color}`,\r\n this.size ? `btn-size-${this.size}` : '',\r\n this.button_shape ? `split-btn-shape-${this.button_shape}` : '',\r\n this.icon_button_shape ? `icon-btn-${this.icon_button_shape}` : '',\r\n this.gap ? `dda-gap-${this.gap}` : '',\r\n this.custom_class,\r\n this.component_mode,\r\n ]\r\n \r\n .filter(Boolean)\r\n .join(' ');\r\n\r\n return (\r\n <Host>\r\n <div class=\"split-btn-container\">\r\n <button\r\n id={this.button_id}\r\n type={this.button_type}\r\n class={buttonClass}\r\n disabled={this.disabled}\r\n aria-label={this.aria_label || this.button_text}\r\n name={this.button_name}\r\n value={this.value}\r\n onClick={this.handleClick}\r\n >\r\n {this.start_icon && (\r\n <i class=\"material-icons material-symbols-outlined\" aria-hidden=\"true\">\r\n {this.start_icon}\r\n </i>\r\n )}\r\n {this.button_text}\r\n </button>\r\n <button class=\"split-btn-arrow\">\r\n \r\n </button>\r\n </div>\r\n </Host>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
title: 'Components/DDA Split Button',
|
|
3
|
+
tags: ['autodocs'],
|
|
4
|
+
parameters: {
|
|
5
|
+
docs: {
|
|
6
|
+
description: {
|
|
7
|
+
component: `
|
|
8
|
+
To use the \`<dda-split-button>\` component, pass the following props:
|
|
9
|
+
|
|
10
|
+
\`\`\`html
|
|
11
|
+
<dda-split-button
|
|
12
|
+
button_color="default-primary"
|
|
13
|
+
start_icon="sentiment_satisfied"
|
|
14
|
+
button_text: "Button"
|
|
15
|
+
custom_class=""
|
|
16
|
+
component_mode=""
|
|
17
|
+
button_id="button"
|
|
18
|
+
aria_label="button"
|
|
19
|
+
button_name="button"
|
|
20
|
+
value="my-value"
|
|
21
|
+
>
|
|
22
|
+
</dda-split-button>
|
|
23
|
+
\`\`\`
|
|
24
|
+
|
|
25
|
+
To listen for click events:
|
|
26
|
+
|
|
27
|
+
\`\`\`javascript
|
|
28
|
+
document.querySelector('dda-split-button').addEventListener('buttonClick', (e) => {
|
|
29
|
+
const { event, id, value, name } = e.detail;
|
|
30
|
+
console.log('Button clicked:', { id, value, name });
|
|
31
|
+
});
|
|
32
|
+
\`\`\`
|
|
33
|
+
`,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
argTypes: {
|
|
38
|
+
button_color: {
|
|
39
|
+
control: { type: 'select' },
|
|
40
|
+
options: [
|
|
41
|
+
'default-primary', 'default-secondary', 'default-tertiary', 'default-link',
|
|
42
|
+
'error-primary', 'error-secondary', 'error-tertiary', 'error-link',
|
|
43
|
+
'onsurface-primary', 'onsurface-secondary', 'onsurface-tertiary', 'onsurface-link',
|
|
44
|
+
'secondary', 'success', 'warning', 'surface', 'surface-variant', 'disabled',
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
button_type: { control: 'select', options: ['button', 'submit', 'reset'] },
|
|
48
|
+
size: { control: 'select', options: ['sm', 'md', 'lg', 'xl'] },
|
|
49
|
+
button_shape: { control: 'select', options: ['default', 'circle'] },
|
|
50
|
+
icon_button_shape: { control: 'select', options: ['default', 'circle'] },
|
|
51
|
+
gap: { control: 'select', options: [1, 2] },
|
|
52
|
+
button_text: { control: 'text' },
|
|
53
|
+
custom_class: { control: 'text' },
|
|
54
|
+
component_mode: {
|
|
55
|
+
control: { type: 'select' },
|
|
56
|
+
options: ['', 'light-mode'],
|
|
57
|
+
description: 'Mode of the button component',
|
|
58
|
+
},
|
|
59
|
+
button_id: { control: 'text', description: 'ID of the button' },
|
|
60
|
+
aria_label: { control: 'text', description: 'Aria label for the button' },
|
|
61
|
+
button_name: { control: 'text', description: 'Name of the button' },
|
|
62
|
+
value: { control: 'text', description: 'Value of the button' },
|
|
63
|
+
disabled: { control: 'boolean', description: 'Disable the button' },
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
const Template = (args) => {
|
|
67
|
+
const attributes = Object.entries(args)
|
|
68
|
+
.filter(([key, value]) => value !== undefined && key !== 'text')
|
|
69
|
+
.map(([key, value]) => {
|
|
70
|
+
if (key === 'onClick') {
|
|
71
|
+
return `onclick="${value}"`; // inject raw JS string
|
|
72
|
+
}
|
|
73
|
+
return `${key}="${value}"`;
|
|
74
|
+
})
|
|
75
|
+
.join(' ');
|
|
76
|
+
// Manually add the onclick attribute with a placeholder JS snippet or text
|
|
77
|
+
const onclickAttr = 'onclick="console.log(\'native click\')"';
|
|
78
|
+
// Create the button element HTML string including onclick
|
|
79
|
+
const buttonHtml = `<dda-split-button ${attributes} ${onclickAttr}></dda-split-button>`;
|
|
80
|
+
// Add event listener after the element is created (unchanged)
|
|
81
|
+
setTimeout(() => {
|
|
82
|
+
const button = document.querySelector(`dda-split-button[button_id="${args.button_id}"]`);
|
|
83
|
+
if (button) {
|
|
84
|
+
button.removeEventListener('buttonClick', handleButtonClick);
|
|
85
|
+
button.addEventListener('buttonClick', handleButtonClick);
|
|
86
|
+
}
|
|
87
|
+
}, 0);
|
|
88
|
+
return buttonHtml;
|
|
89
|
+
};
|
|
90
|
+
const handleButtonClick = (e) => {
|
|
91
|
+
const { event, id, value, name } = e.detail;
|
|
92
|
+
console.log('Button clicked:', { id, value, name });
|
|
93
|
+
console.log('Mouse event:', event);
|
|
94
|
+
if (id === 'error-button') {
|
|
95
|
+
alert('Hello! I am an alert box!!');
|
|
96
|
+
}
|
|
97
|
+
else if (id === 'console-button') {
|
|
98
|
+
console.log('Button clicked via custom event');
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
export const DefaultPrimary = Template.bind({});
|
|
102
|
+
DefaultPrimary.args = {
|
|
103
|
+
button_type: "button",
|
|
104
|
+
button_color: 'default-primary',
|
|
105
|
+
start_icon: 'sentiment_satisfied',
|
|
106
|
+
button_text: 'Button',
|
|
107
|
+
button_id: 'default-primary-btn',
|
|
108
|
+
aria_label: 'default primary button',
|
|
109
|
+
button_name: 'defaultPrimaryButton',
|
|
110
|
+
value: 'default-primary-value',
|
|
111
|
+
button_shape: 'default',
|
|
112
|
+
size: 'md',
|
|
113
|
+
gap: 1,
|
|
114
|
+
disabled: false,
|
|
115
|
+
custom_class: '',
|
|
116
|
+
component_mode: '',
|
|
117
|
+
onclick: "console.log('native click')"
|
|
118
|
+
};
|
|
119
|
+
export const ErrorPrimary = Template.bind({});
|
|
120
|
+
ErrorPrimary.args = Object.assign(Object.assign({}, DefaultPrimary.args), { button_color: 'error-primary', start_icon: 'sentiment_satisfied', button_text: 'Button', button_id: 'default-primary-btn', aria_label: 'default primary button', button_name: 'defaultPrimaryButton', value: 'default-primary-value', button_shape: 'default', size: 'md', gap: '1', disabled: false, custom_class: '', component_mode: '', onclick: "console.log('native click')" });
|
|
121
|
+
export const SurfacePrimary = Template.bind({});
|
|
122
|
+
SurfacePrimary.args = Object.assign(Object.assign({}, DefaultPrimary.args), { button_color: 'onsurface-primary', start_icon: 'sentiment_satisfied', button_text: 'Button', button_id: 'default-primary-btn', aria_label: 'default primary button', button_name: 'defaultPrimaryButton', value: 'default-primary-value', button_shape: 'default', size: 'md', gap: '1', disabled: false, custom_class: '', component_mode: '', onclick: "console.log('native click')" });
|
|
123
|
+
export const Disabled = Template.bind({});
|
|
124
|
+
Disabled.args = Object.assign(Object.assign({}, DefaultPrimary.args), { button_color: 'disabled', button_id: 'disabled-button', disabled: true, custom_class: '', component_mode: '', onclick: "console.log('native click')" });
|
|
125
|
+
//# sourceMappingURL=dda-split-button.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dda-split-button.stories.js","sourceRoot":"","sources":["../../../src/components/dda-split-button/dda-split-button.stories.tsx"],"names":[],"mappings":"AAAA,eAAe;IACb,KAAK,EAAE,6BAA6B;IACpC,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,SAAS,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;SA0BV;aACF;SACF;KACF;IACD,QAAQ,EAAE;QACR,YAAY,EAAE;YACZ,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC3B,OAAO,EAAE;gBACP,iBAAiB,EAAC,mBAAmB,EAAC,kBAAkB,EAAC,cAAc;gBACvE,eAAe,EAAC,iBAAiB,EAAC,gBAAgB,EAAC,YAAY;gBAC/D,mBAAmB,EAAC,qBAAqB,EAAC,oBAAoB,EAAC,gBAAgB;gBAC/E,WAAW,EAAC,SAAS,EAAC,SAAS,EAAC,SAAS,EAAC,iBAAiB,EAAC,UAAU;aACvE;SACF;QACD,WAAW,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE;QAC1E,IAAI,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;QAC9D,YAAY,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE;QACnE,iBAAiB,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE;QACxE,GAAG,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CA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6B,GACvC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC1C,QAAQ,CAAC,IAAI,mCACR,cAAc,CAAC,IAAI,KACtB,YAAY,EAAE,UAAU,EACxB,SAAS,EAAE,iBAAiB,EAC5B,QAAQ,EAAE,IAAI,EACd,YAAY,EAAE,EAAE,EAChB,cAAc,EAAE,EAAE,EAClB,OAAO,EAAE,6BAA6B,GACvC,CAAC","sourcesContent":["export default {\r\n title: 'Components/DDA Split Button',\r\n tags: ['autodocs'],\r\n parameters: {\r\n docs: {\r\n description: {\r\n component: `\r\nTo use the \\`<dda-split-button>\\` component, pass the following props:\r\n\r\n\\`\\`\\`html\r\n<dda-split-button\r\n button_color=\"default-primary\"\r\n start_icon=\"sentiment_satisfied\"\r\n button_text: \"Button\"\r\n custom_class=\"\"\r\n component_mode=\"\"\r\n button_id=\"button\"\r\n aria_label=\"button\"\r\n button_name=\"button\"\r\n value=\"my-value\"\r\n >\r\n</dda-split-button>\r\n\\`\\`\\`\r\n\r\nTo listen for click events:\r\n\r\n\\`\\`\\`javascript\r\ndocument.querySelector('dda-split-button').addEventListener('buttonClick', (e) => {\r\n const { event, id, value, name } = e.detail;\r\n console.log('Button clicked:', { id, value, name });\r\n});\r\n\\`\\`\\`\r\n `,\r\n },\r\n },\r\n },\r\n argTypes: {\r\n button_color: {\r\n control: { type: 'select' },\r\n options: [\r\n 'default-primary','default-secondary','default-tertiary','default-link',\r\n 'error-primary','error-secondary','error-tertiary','error-link',\r\n 'onsurface-primary','onsurface-secondary','onsurface-tertiary','onsurface-link',\r\n 'secondary','success','warning','surface','surface-variant','disabled',\r\n ],\r\n },\r\n button_type: { control: 'select', options: ['button', 'submit', 'reset'] },\r\n size: { control: 'select', options: ['sm', 'md', 'lg', 'xl'] },\r\n button_shape: { control: 'select', options: ['default', 'circle'] },\r\n icon_button_shape: { control: 'select', options: ['default', 'circle'] },\r\n gap: { control: 'select', options: [1, 2] },\r\n button_text: { control: 'text' },\r\n custom_class: { control: 'text' },\r\n component_mode: {\r\n control: { type: 'select' },\r\n options: ['', 'light-mode'],\r\n description: 'Mode of the button component',\r\n },\r\n button_id: { control: 'text', description: 'ID of the button' },\r\n aria_label: { control: 'text', description: 'Aria label for the button' },\r\n button_name: { control: 'text', description: 'Name of the button' },\r\n value: { control: 'text', description: 'Value of the button' },\r\n disabled: { control: 'boolean', description: 'Disable the button' },\r\n },\r\n};\r\n\r\n\r\n\r\nconst Template = (args) => {\r\n const attributes = Object.entries(args)\r\n .filter(([key, value]) => value !== undefined && key !== 'text')\r\n .map(([key, value]) => {\r\n if (key === 'onClick') {\r\n return `onclick=\"${value}\"`; // inject raw JS string\r\n }\r\n return `${key}=\"${value}\"`;\r\n })\r\n .join(' ');\r\n\r\n // Manually add the onclick attribute with a placeholder JS snippet or text\r\n const onclickAttr = 'onclick=\"console.log(\\'native click\\')\"';\r\n\r\n // Create the button element HTML string including onclick\r\n const buttonHtml = `<dda-split-button ${attributes} ${onclickAttr}></dda-split-button>`;\r\n \r\n // Add event listener after the element is created (unchanged)\r\n setTimeout(() => {\r\n const button = document.querySelector(`dda-split-button[button_id=\"${args.button_id}\"]`);\r\n if (button) {\r\n button.removeEventListener('buttonClick', handleButtonClick);\r\n button.addEventListener('buttonClick', handleButtonClick);\r\n }\r\n }, 0);\r\n\r\n return buttonHtml;\r\n};\r\n\r\nconst handleButtonClick = (e) => {\r\n const { event, id, value, name } = e.detail;\r\n console.log('Button clicked:', { id, value, name });\r\n console.log('Mouse event:', event);\r\n\r\n if (id === 'error-button') {\r\n alert('Hello! I am an alert box!!');\r\n } else if (id === 'console-button') {\r\n console.log('Button clicked via custom event');\r\n }\r\n};\r\n\r\nexport const DefaultPrimary = Template.bind({});\r\nDefaultPrimary.args = {\r\n button_type: \"button\",\r\n button_color: 'default-primary',\r\n start_icon: 'sentiment_satisfied',\r\n button_text: 'Button',\r\n button_id: 'default-primary-btn',\r\n aria_label: 'default primary button',\r\n button_name: 'defaultPrimaryButton',\r\n value: 'default-primary-value',\r\n button_shape: 'default',\r\n size: 'md',\r\n gap: 1,\r\n disabled: false,\r\n custom_class: '',\r\n component_mode: '',\r\n onclick: \"console.log('native click')\"\r\n};\r\n\r\nexport const ErrorPrimary = Template.bind({});\r\nErrorPrimary.args = {\r\n ...DefaultPrimary.args,\r\n button_color: 'error-primary',\r\n start_icon: 'sentiment_satisfied',\r\n button_text: 'Button',\r\n button_id: 'default-primary-btn',\r\n aria_label: 'default primary button',\r\n button_name: 'defaultPrimaryButton',\r\n value: 'default-primary-value',\r\n button_shape: 'default',\r\n size: 'md',\r\n gap: '1',\r\n disabled: false,\r\n custom_class: '',\r\n component_mode: '',\r\n onclick: \"console.log('native click')\"\r\n};\r\n\r\nexport const SurfacePrimary = Template.bind({});\r\nSurfacePrimary.args = {\r\n ...DefaultPrimary.args,\r\n button_color: 'onsurface-primary',\r\n start_icon: 'sentiment_satisfied',\r\n button_text: 'Button',\r\n button_id: 'default-primary-btn',\r\n aria_label: 'default primary button',\r\n button_name: 'defaultPrimaryButton',\r\n value: 'default-primary-value',\r\n button_shape: 'default',\r\n size: 'md',\r\n gap: '1',\r\n disabled: false,\r\n custom_class: '',\r\n component_mode: '',\r\n onclick: \"console.log('native click')\"\r\n};\r\n\r\nexport const Disabled = Template.bind({});\r\nDisabled.args = {\r\n ...DefaultPrimary.args,\r\n button_color: 'disabled',\r\n button_id: 'disabled-button',\r\n disabled: true,\r\n custom_class: '',\r\n component_mode: '',\r\n onclick: \"console.log('native click')\"\r\n};\r\n\r\n\r\n"]}
|
|
@@ -75,7 +75,7 @@ export class DdaStickyFooter {
|
|
|
75
75
|
render() {
|
|
76
76
|
const footmiddlesection = this.parseJsonArray(this.middleLink);
|
|
77
77
|
const footrightsection = this.parseJsonArray(this.rightLink);
|
|
78
|
-
return (h("div", { key: '
|
|
78
|
+
return (h("div", { key: '95efee7973feff76b7a1ddfa9fba5fb1d45f1b3b', class: { 'dda-footer': true, 'hidden': this.isHidden } }, h("div", { key: '1e3ab5c919a033bf29e88ec4fb3b0a2876eee5d2', class: "footer-content" }, h("div", { key: '01f21c2537d9fe164a0f939fdeed2d277201d3d5', class: "dda-footer-item dda-footer-left" }, h("ul", { key: 'ecb8a26cf343c1bbc70746bff068eb94607ba0bc' }, this.happinessIconSrc && (h("li", { key: 'c278cf1dc53e641abc7cffbc8d1429cdea1a00f8', class: "foot-icon-btn" }, h("dda-tooltip", { key: '1360e509accc4c341d4ed0ae1483e4317094cde2', title_text: this.happinessIconTooltip, description: "", position: "top" }, h("a", { key: 'b1e2ed419289fd9a455d4a96338c94ba51272347', href: this.happinessIconHref, id: this.happinessIconId, onClick: this.happinessIconClick }, h("img", { key: '77348880a412126358c812b879a333545f264b10', src: this.colorTheme == 'light' ? this.happinessIconSrc : this.happinessIconSrcDark, alt: this.happinessIconAlt }), h("span", { key: '278a3aff163a7dde55b4ec91ff45a5d2cac71eed', class: "visually-hidden" }, this.happinessIconTooltip))))), this.accessibilityIconSrc && (h("li", { key: '7f6f00c3eae0fd0dcabdda947751e95f039114ff', class: "foot-icon-btn" }, h("dda-tooltip", { key: '381638253927a84291478679f3fc100a151c01c7', title_text: this.accessibilityIconTooltip, description: "", position: "top" }, h("a", { key: '8379824009617bcd41ca32486fc19e168fb0e10e', href: this.accessibilityIconHref, id: this.accessibilityIconId, onClick: this.accessibilityIconClick }, h("img", { key: 'f826744d391b0ebdb292fd54337e4e8fafbaa527', src: this.colorTheme == 'light' ? this.accessibilityIconSrc : this.accessibilityIconSrcDark, alt: this.accessibilityIconAlt }), h("span", { key: '5583a046cc7d4623dba6017f0d1d8af8b73e4a5f', class: "visually-hidden" }, this.accessibilityIconTooltip))))), this.servicesIconText && (h("li", { key: 'f1aa856dbef7ed95dfefb6e1896b6102ced3a50b', class: "foot-icon-btn" }, h("dda-tooltip", { key: 'b046c2c2ba429c9a2218633733c229f661dd38d9', title_text: this.servicesIconTooltip, description: "", position: "top" }, h("a", { key: 'a0e4b0aecd9d5903074b0f02709f9b273216d1ab', href: this.servicesIconHref, id: this.servicesIconId, onClick: this.servicesIconClick }, h("img", { key: '71835647960d328c004758b1619d7a1c5f12e8b1', src: this.colorTheme == 'light' ? this.servicesIconSrc : this.servicesIconSrcDark, alt: this.servicesIconAlt }), h("span", { key: '0fac4b409517fbab8df699f13558cfce95df3c8f' }, this.servicesIconText))))))), !this.hideMiddleSection && (h("div", { key: '9b468bf13c76270aaf4b2b82bcc3679aec07d25c', class: "dda-footer-item dda-footer-middle" }, h("ul", { key: '3e010b43efdcad46e7d167760e70b10866e4b023', class: "foot-logo" }, footmiddlesection.map((middleItem, index) => (h("li", { key: index }, h("dda-tooltip", { title_text: middleItem.LogoTooltip, description: "", position: "top" }, h("a", { href: middleItem.href, onClick: () => this.middleItemClick(middleItem) }, h("img", { src: this.colorTheme == 'light' ? middleItem.src : middleItem.srcDark, alt: middleItem.alt }), h("span", { class: "visually-hidden" }, middleItem.LogoTooltip))))))))), h("div", { key: '8c28f2d603519d5f7ce7d1f1aa9a78f296b9adaa', class: "dda-footer-item dda-footer-right" }, h("ul", { key: '496ee22e3a97227dffc430ab36b279819c148c14', class: "foot-right_links" }, footrightsection.map((rightItem, index) => (h("li", { class: "foot-icon-btn", key: index }, h("dda-tooltip", { title_text: rightItem.RightLinkTooltip, description: "", position: "top" }, h("a", { href: rightItem.href, title: rightItem.title, "aria-label": `${rightItem.IconName} ${rightItem.LinkText}`, id: rightItem.itemId, onClick: () => this.rightItemClick(rightItem) }, h("i", { class: rightItem.IconFamily }, rightItem.IconName), h("span", null, rightItem.LinkText)))))), this.dubaiaeIconSrc && this.dubaiaeIconSmallSrc && (h("li", { key: 'f378807753887b94eb013ef93f9a1375efbde5af', class: "foot-icon-btn" }, h("dda-tooltip", { key: '890275f2ee49904866139441574dfa921948be0f', title_text: this.dubaiaeIconTooltip, description: "", position: "top" }, h("a", { key: '734197129ea2af52682cc9ba9ada6849e3f8c9a2', href: this.dubaiaeIconHref, onClick: this.dubaiAEClick, id: this.dubaiaeIconId }, h("img", { key: 'bffab79724f39af1fa4f056adf10e125b0462d44', class: "dubaiae-text-icon", src: this.colorTheme == 'light' ? this.dubaiaeIconSrc : this.dubaiaeIconSrcDark, alt: `${this.dubaiaeIconAlt} icon desktop` }), h("img", { key: '6e32692826d4320dec0fb04649b17bdb4d4c6037', class: "dubaiae-small-icon", src: this.dubaiaeIconSmallSrc, alt: `${this.dubaiaeIconAlt} icon mobile` }), h("span", { key: '3e9e81f77f46b677d2ab60a5a93b5ff7be66b283', class: "visually-hidden" }, this.dubaiaeIconTooltip))))), this.aiIconSrc && (h("li", { key: '8e412a8bb72fe45cef1f0e86042270b54cb8e4b8', class: "foot-icon-btn" }, h("dda-tooltip", { key: '1f27e8afeda263e65fb7654aa8d6edca7097b13b', title_text: this.aiIconTooltip, description: "", position: "top" }, h("a", { key: '094c834441db0f0831fd2aebf4026f20ca2d6280', href: this.aiIconHref, onClick: this.aiIconClick, id: this.aiIconId }, h("img", { key: '99dd257e47f07f0ebc354322532973596d85978b', src: this.colorTheme == 'light' ? this.aiIconSrc : this.aiIconSrcDark, alt: this.aiIconAlt }), h("span", { key: 'a06b175a3f200cbfea89328131f0645dd140194f', class: "visually-hidden" }, this.aiIconTooltip))))), this.chatIconSrc && (h("li", { key: '1f8bf5ae84472736dcecebe6ba6fb0a0235960fe', class: "foot-icon-btn" }, h("dda-tooltip", { key: '72f7ffb30994b8c8ad33ce0e49ebecb1cfa7dcc1', title_text: this.chatIconTooltip, description: "", position: "top" }, h("a", { key: '638deff5a2e92880c6b2f6f13e1d8b186c23c1f7', href: this.chatIconHref, onClick: this.chatIconClick, id: this.chatIconId }, h("img", { key: 'd5b6a32405fd41fc2828a6f129784fe918b9cefd', src: this.colorTheme == 'light' ? this.chatIconSrc : this.chatIconSrcDark, alt: this.chatIconAlt }), h("span", { key: '56da55a3b07fa996695c177cca93b4ae846fce94', class: "visually-hidden" }, this.chatIconTooltip)))))), h("button", { key: '6ffa766e66debd928fb33db0e3ba6711db043aaa', type: "button", class: "show-right-icon", onClick: this.toggleFooterIcons }, h("i", { key: '217a991516b7d9a65db8b0f3e3bba231cc2b6c09', class: this.moreIconFamily }, this.moreIcon))))));
|
|
79
79
|
}
|
|
80
80
|
static get is() { return "dda-sticky-footer"; }
|
|
81
81
|
static get originalStyleUrls() {
|
|
@@ -62,7 +62,7 @@ export class DdaTabs {
|
|
|
62
62
|
this.tabClick.emit(index);
|
|
63
63
|
}
|
|
64
64
|
render() {
|
|
65
|
-
return (h(Host, { key: '
|
|
65
|
+
return (h(Host, { key: 'a63350c6f7e789932d37cf0385e493a80c1309d6' }, h("div", { key: '5f35f70fe945369d035e87f6221eaf5a48edbf9a', role: "tablist", "aria-label": "Tab Navigation", class: `dda-tabs-container ${this.hover_style} ${this.custom_class} ${this.component_mode} ${this.tab_type}` }, this.parsedTabs.map((title, index) => (h("button", { id: this.parsedButtonIds[index] || `tab-btn-${index + 1}`, name: this.button_name, "aria-label": title, type: "button", value: this.parsedButtonValues[index] || '', class: `dda-tab-item ${this.active_tab === index ? 'active' : ''}`, role: "tab", "aria-selected": this.active_tab === index ? 'true' : 'false', "aria-controls": `tab-btn-${index + 1}`, onClick: () => this.setActiveTab(index) }, this.type === 'text-icon' && (h("i", { class: `material-icons`, "aria-hidden": "true" }, this.parsedIcons[index] || '')), h("span", null, title)))))));
|
|
66
66
|
}
|
|
67
67
|
static get is() { return "dda-tabs"; }
|
|
68
68
|
static get originalStyleUrls() {
|
|
@@ -92,7 +92,7 @@ export class DdaTextarea {
|
|
|
92
92
|
]
|
|
93
93
|
.filter(Boolean)
|
|
94
94
|
.join(' ');
|
|
95
|
-
return (h(Host, { key: '
|
|
95
|
+
return (h(Host, { key: '3d95e60cae7eb7f6280e17e2a0d3076e408c9c98' }, h("div", { key: 'ae65d105dacf8287a675344756842901c3313fcd', class: textareaClass }, this.label && (h("label", { key: '4590c87e0f1201e001fe245e14b57fca4ba071e8', htmlFor: this.input_id, class: "dda-input-label" }, this.label)), this.enable_rich_editor ? (h("div", { id: "editor", class: "dda-richeditor-field" })) : (h("textarea", { id: this.input_id, name: this.textarea_name, "aria-label": this.aria_label, placeholder: this.placeholder, value: this.internalValue || this.value, "aria-invalid": this.validation_type === 'error' ? 'true' : 'false', class: "dda-input-field dda-input-textarea", maxLength: this.max_characters, onInput: event => this.handleInput(event), onBlur: event => this.handleBlur(event), onFocus: (event) => {
|
|
96
96
|
this.el.dispatchEvent(new FocusEvent('focus', {
|
|
97
97
|
bubbles: true,
|
|
98
98
|
composed: true,
|
|
@@ -7,10 +7,10 @@ export class DdaToggle {
|
|
|
7
7
|
const toggleClass = ['dda-toggle-btn', this.size ? `dda-toggle-${this.size}` : '', this.custom_class ? `${this.custom_class}` : '', this.component_mode]
|
|
8
8
|
.filter(Boolean)
|
|
9
9
|
.join(' ');
|
|
10
|
-
return (h(Host, { key: '
|
|
10
|
+
return (h(Host, { key: '9a7aedffff589a851cd8b224871e8be5f36e500b' }, h("label", { key: '5010658c3126f79aa73c51c96dd893a9816d5ca2', class: toggleClass, htmlFor: this.input_id }, h("input", { key: '5d116e7eb40788d4c63cde1104234b5e94d15d17', "aria-label": this.aria_label, type: "checkbox", id: this.input_id, name: this.group_name, checked: this.checked, onChange: event => {
|
|
11
11
|
this.toggleChanged.emit(event);
|
|
12
12
|
this.onChanged.emit(event);
|
|
13
|
-
} }), h("span", { key: '
|
|
13
|
+
} }), h("span", { key: '9996605f39a1f5eb437b519f0abec233244705c2', class: "toggle" }), h("p", { key: 'e50c9e6375cd7ecf40237648947af5e2b8b2b36c' }, h("span", { key: 'd2bbdc6edd9865df0263efb4020e2a49578df9c1', class: "toggle-title" }, "Radio Button Title"), h("span", { key: 'fc1f4cb6710c01aaf52aac79d847bdcf173923ec', class: "toggle-supporting" }, "Supporting Text")))));
|
|
14
14
|
}
|
|
15
15
|
static get is() { return "dda-toggle"; }
|
|
16
16
|
static get originalStyleUrls() {
|