saasufy-components 5.0.0 → 5.0.2
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/README.md +6 -8
- package/collection-adder.js +10 -0
- package/input-provider.js +7 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -280,11 +280,9 @@ Can also perform basic CRUD operations such as deleting or creating records by l
|
|
|
280
280
|
>
|
|
281
281
|
<template slot="item">
|
|
282
282
|
<div>
|
|
283
|
-
<div
|
|
284
|
-
|
|
285
|
-
</div>
|
|
286
|
-
<div class="chat-message">{{Chat.message}}</div>
|
|
287
|
-
<div class="chat-created-at">{{date(Chat.createdAt)}}</div>
|
|
283
|
+
<div>{{Chat.username}}</div>
|
|
284
|
+
<div>{{Chat.message}}</div>
|
|
285
|
+
<div>{{date(Chat.createdAt)}}</div>
|
|
288
286
|
</div>
|
|
289
287
|
</template>
|
|
290
288
|
|
|
@@ -430,7 +428,7 @@ If `confirmDeleteItem()` is used, then the parent `collection-viewer` must have
|
|
|
430
428
|
>
|
|
431
429
|
<template slot="item">
|
|
432
430
|
<div>
|
|
433
|
-
<div
|
|
431
|
+
<div>{{Product.name}}</div>
|
|
434
432
|
<collection-deleter model-id="{{Product.id}}" confirm-message="Are you sure you want to delete the {{Product.name}} product?" onclick="confirmDeleteItem()">✕</collection-deleter>
|
|
435
433
|
</div>
|
|
436
434
|
</template>
|
|
@@ -1028,12 +1026,12 @@ A modal component to prompt the user for confirmation before performing sensitiv
|
|
|
1028
1026
|
>
|
|
1029
1027
|
<template slot="item">
|
|
1030
1028
|
<div>
|
|
1031
|
-
<div
|
|
1029
|
+
<div>{{Product.name}}</div>
|
|
1032
1030
|
<collection-deleter model-id="{{Product.id}}" confirm-message="Are you sure you want to delete the {{Product.name}} product?" onclick="confirmDeleteItem()">✕</collection-deleter>
|
|
1033
1031
|
</div>
|
|
1034
1032
|
</template>
|
|
1035
1033
|
|
|
1036
|
-
<div slot="viewport"
|
|
1034
|
+
<div slot="viewport"></div>
|
|
1037
1035
|
|
|
1038
1036
|
<!-- The confirm-modal element must be specified here with slot="modal" to prompt the user for confirmation -->
|
|
1039
1037
|
<confirm-modal slot="modal" title="Delete confirmation" message="" confirm-button-label="Delete"></confirm-modal>
|
package/collection-adder.js
CHANGED
|
@@ -289,6 +289,16 @@ class CollectionAdder extends SocketConsumer {
|
|
|
289
289
|
field
|
|
290
290
|
}"${extraAttributesString} />`
|
|
291
291
|
);
|
|
292
|
+
} else if (inputType === 'number') {
|
|
293
|
+
items.push(
|
|
294
|
+
`<input class="collection-adder-input" type="${
|
|
295
|
+
inputType
|
|
296
|
+
}" name="${
|
|
297
|
+
field
|
|
298
|
+
}" placeholder="${
|
|
299
|
+
inputLabel
|
|
300
|
+
}" step="any"${extraAttributesString} />`
|
|
301
|
+
);
|
|
292
302
|
} else {
|
|
293
303
|
items.push(
|
|
294
304
|
`<input class="collection-adder-input" type="${
|
package/input-provider.js
CHANGED
|
@@ -87,7 +87,8 @@ class InputProvider extends HTMLElement {
|
|
|
87
87
|
}
|
|
88
88
|
oldValue = this.inputElement.value;
|
|
89
89
|
this.inputElement.value = newValue;
|
|
90
|
-
if (oldValue !== newValue) {
|
|
90
|
+
if (oldValue !== newValue || this.forceTriggerChange) {
|
|
91
|
+
delete this.forceTriggerChange;
|
|
91
92
|
this.triggerChange();
|
|
92
93
|
}
|
|
93
94
|
}
|
|
@@ -169,6 +170,11 @@ class InputProvider extends HTMLElement {
|
|
|
169
170
|
}
|
|
170
171
|
}
|
|
171
172
|
|
|
173
|
+
if (type === 'select') {
|
|
174
|
+
this.forceTriggerChange = true;
|
|
175
|
+
value = this.inputElement.value;
|
|
176
|
+
}
|
|
177
|
+
|
|
172
178
|
this.updateInputClassList(value);
|
|
173
179
|
this.appendChild(this.inputElement);
|
|
174
180
|
|