@knowark/componarkjs 1.10.1 → 1.10.3
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.
|
@@ -201,6 +201,32 @@ describe('Component', () => {
|
|
|
201
201
|
expect(component.data.value).toEqual('E')
|
|
202
202
|
})
|
|
203
203
|
|
|
204
|
+
it('binds multiple handlers to the same event', async () => {
|
|
205
|
+
container.innerHTML = `
|
|
206
|
+
<mock-component>
|
|
207
|
+
<input type="text"
|
|
208
|
+
listen
|
|
209
|
+
on-input="{{ data.value = data }}"
|
|
210
|
+
on-input-1="{{ data.value1 = data }}"
|
|
211
|
+
on-input-2="{{ data.value2 = data }}"
|
|
212
|
+
on-input-3="{{ data.value3 = data }}"
|
|
213
|
+
></input>
|
|
214
|
+
</mock-component>
|
|
215
|
+
`
|
|
216
|
+
|
|
217
|
+
const component = container.querySelector('mock-component')
|
|
218
|
+
const input = component.select('input')
|
|
219
|
+
|
|
220
|
+
input.dispatchEvent(
|
|
221
|
+
new globalThis.InputEvent('input', { bubbles: true, data: 'E' })
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
expect(component.data.value).toEqual('E')
|
|
225
|
+
expect(component.data.value1).toEqual('E')
|
|
226
|
+
expect(component.data.value2).toEqual('E')
|
|
227
|
+
expect(component.data.value3).toEqual('E')
|
|
228
|
+
})
|
|
229
|
+
|
|
204
230
|
it('binds to the target.value event property by default', async () => {
|
|
205
231
|
container.innerHTML = `
|
|
206
232
|
<mock-component>
|
|
@@ -127,6 +127,21 @@ ${actions.map(action => css`
|
|
|
127
127
|
[style*='--white-space:'] {
|
|
128
128
|
white-space: var(--white-space);
|
|
129
129
|
}
|
|
130
|
+
[style*='--first-letter:']::first-letter {
|
|
131
|
+
text-transform: var(--first-letter);
|
|
132
|
+
}
|
|
133
|
+
[style*='--first-letter-color:']::first-letter {
|
|
134
|
+
color: var(--first-letter-color);
|
|
135
|
+
}
|
|
136
|
+
[style*='--first-letter-background:']::first-letter {
|
|
137
|
+
background: var(--first-letter-background);
|
|
138
|
+
}
|
|
139
|
+
[style*='--first-letter-size:']::first-letter {
|
|
140
|
+
font-size: var(--first-letter-size);
|
|
141
|
+
}
|
|
142
|
+
[style*='--first-letter-weight:']::first-letter {
|
|
143
|
+
font-weight: var(--first-letter-weight);
|
|
144
|
+
}
|
|
130
145
|
|
|
131
146
|
/* SPACING */
|
|
132
147
|
|
|
@@ -50,7 +50,8 @@ export function listen (self) {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
const eventName =
|
|
53
|
+
const eventName = (
|
|
54
|
+
attribute.name.replace('on-', '').replace(/-\d+$/, '').trim())
|
|
54
55
|
element.addEventListener(eventName, catchingHandler.bind(self))
|
|
55
56
|
element.removeAttribute(binding)
|
|
56
57
|
}
|