saasufy-components 3.16.1 → 3.16.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 +5 -5
- package/model-input.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -289,7 +289,7 @@ A form component for inserting data into collections.
|
|
|
289
289
|
**Attributes**
|
|
290
290
|
|
|
291
291
|
- `collection-type` (required): Specifies the type of collection to add the resource to when the form is submitted. This should match a `Model` available in your Saasufy service.
|
|
292
|
-
- `collection-fields`: A comma-separated list of fields from the `Model` to display as input elements inside the form for the user to fill in. Each field name in this list can optionally be followed by an input element type after a `:` character. For example `collection-fields="qty:number, size:select(small,medium,large)` will create one input element with `type="number"` and one with `type=select` with options `small`, `medium` or `large`. To make a select field optional, you can prefix the list of options with a comma; e.g. `size:select(,small,medium,large)`.
|
|
292
|
+
- `collection-fields`: A comma-separated list of fields from the `Model` to display as input elements inside the form for the user to fill in. Each field name in this list can optionally be followed by an input element type after a `:` character. For example `collection-fields="qty:number, size:select(small,medium,large)` will create one input element with `type="number"` and one with `type=select` with options `small`, `medium` or `large`. To make a select field optional, you can prefix the list of options with a comma; e.g. `size:select(,small,medium,large)`. Supported input types include: `text`, `select`, `number`, `checkbox`, `radio`, `textarea`, `file` and `text-select`.
|
|
293
293
|
- `model-values`: An optional list of key-value pairs in the format `field1=value1,field2=value2` to add to the newly created resource alongside the values collected from the user via the form. For non-string values, the type should be provided in the format `fieldName:type=value`; supported types are `string`, `number` and `boolean`. Unlike `collection-fields` which are rendered as input elements in the form, `model-values` are not shown to the user.
|
|
294
294
|
- `submit-button-label`: Text to display on the submit button. If not specified, defaults to `Submit`.
|
|
295
295
|
- `hide-submit-button`: Adding this attribute will hide the submit button from the form.
|
|
@@ -447,7 +447,7 @@ Used for displaying and editing a single field of a model instance in real time.
|
|
|
447
447
|
- `list`: If specified, this sets the list attribute of the inner `input` element to provide input suggestions (only works with standard input elements).
|
|
448
448
|
- `type`: The type of the input component; can be `text`, `number`, `select`, `textarea`, `checkbox` or `file`.
|
|
449
449
|
- `placeholder`: Can be used to set the placeholder text on the inner input element.
|
|
450
|
-
- `consumers`: This allows you to connect this `model-input` to other elements on your page. It takes a list of selectors with optional attributes to target
|
|
450
|
+
- `consumers`: This allows you to connect this `model-input` to other elements on your page. It takes a list of selectors with optional attributes to target in the format `element-selector:attribute-name`. For example `.my-input:value` will find all elements with a `my-input` class and update their `value` attributes with the value of the `model-input` component in real-time. You can specify multiple selectors separated by commas such as `.my-input,my-div` - In this case, because attribute names are not specified, values will be injected into the `value` attribute (for input elements) or into the `innerHTML` property (for other kinds of elements). The default attribute/property depends on the element type.
|
|
451
451
|
- `provider-template`: A template string within which the `{{value}}` can be injected before passing to consumers.
|
|
452
452
|
- `show-error-message`: If this attribute is present, an error message will be displayed above the input if it fails to update the value.
|
|
453
453
|
- `options`: A comma-separated list of options to provide - This only works if the input type is `select`.
|
|
@@ -556,7 +556,7 @@ This component can be configured to provide its data to multiple components (con
|
|
|
556
556
|
- `list`: If specified, this sets the list attribute of the inner `input` element to provide input suggestions (only works with standard input elements).
|
|
557
557
|
- `type`: The type of the input component; can be `text`, `number`, `select`, `textarea` or `checkbox`.
|
|
558
558
|
- `placeholder`: Can be used to set the placeholder text on the inner input element.
|
|
559
|
-
- `consumers`: This allows you to connect this `input-provider` to other elements on your page. It takes a list of selectors with optional attributes to target
|
|
559
|
+
- `consumers`: This allows you to connect this `input-provider` to other elements on your page. It takes a list of selectors with optional attributes to target in the format `element-selector:attribute-name`. For example `.my-input:value` will find all elements with a `my-input` class and update their `value` attributes with the value of the `input-provider` component in real-time. You can specify multiple selectors separated by commas such as `.my-input,my-div` - In this case, because attribute names are not specified, values will be injected into the `value` attribute (for input elements) or into the `innerHTML` property (for other kinds of elements). The default attribute/property depends on the element type.
|
|
560
560
|
- `provider-template`: A template string within which the `{{value}}` can be injected before passing to consumers.
|
|
561
561
|
- `debounce-delay`: The delay in milliseconds to wait before triggering a change event. This is useful to batch multiple updates together (as is common when user is typing). Default is 800ms.
|
|
562
562
|
- `options`: A comma-separated list of options to provide - This only works if the input type is `select`.
|
|
@@ -616,7 +616,7 @@ The `combineFilters` function produces a combined query string (joined with `%AN
|
|
|
616
616
|
|
|
617
617
|
**Attributes**
|
|
618
618
|
|
|
619
|
-
- `consumers`: This allows you to connect this `input-combiner` to other elements on your page. It takes a list of selectors with optional attributes to target
|
|
619
|
+
- `consumers`: This allows you to connect this `input-combiner` to other elements on your page. It takes a list of selectors with optional attributes to target in the format `element-selector:attribute-name`. For example `.my-input:value` will find all elements with a `my-input` class and update their `value` attributes with the value of the `input-provider` component in real-time. You can specify multiple selectors separated by commas such as `.my-input,my-div` - In this case, because attribute names are not specified, values will be injected into the `value` attribute (for input elements) or into the `innerHTML` property (for other kinds of elements). The default attribute/property depends on the element type.
|
|
620
620
|
- `provider-template`: A template string within which the `{{value}}` can be injected before passing to consumers. In the case of the `input-combiner`, the value is an object wherein each key represents the unique label associated with different `input-provider` components.
|
|
621
621
|
- `debounce-delay`: The delay in milliseconds to wait before triggering a change event. This is useful to batch multiple updates together. Default is 0ms.
|
|
622
622
|
|
|
@@ -656,7 +656,7 @@ The following example shows how to bind an `input-provider` component to an `inp
|
|
|
656
656
|
|
|
657
657
|
**Attributes**
|
|
658
658
|
|
|
659
|
-
- `consumers`: This allows you to connect this `input-transformer` to other elements on your page. It takes a list of selectors with optional attributes to target
|
|
659
|
+
- `consumers`: This allows you to connect this `input-transformer` to other elements on your page. It takes a list of selectors with optional attributes to target in the format `element-selector:attribute-name`. For example `.my-input:value` will find all elements with a `my-input` class and update their `value` attributes with the value of the `input-provider` component in real-time. You can specify multiple selectors separated by commas such as `.my-input,my-div` - In this case, because attribute names are not specified, values will be injected into the `value` attribute (for input elements) or into the `innerHTML` property (for other kinds of elements). The default attribute/property depends on the element type.
|
|
660
660
|
- `provider-template`: A template string within which the `{{value}}` can be injected before passing to consumers.
|
|
661
661
|
- `debounce-delay`: The delay in milliseconds to wait before triggering a change event. This is useful to batch multiple updates together. Default is 0ms.
|
|
662
662
|
|
package/model-input.js
CHANGED
|
@@ -188,7 +188,7 @@ class ModelInput extends SocketConsumer {
|
|
|
188
188
|
}
|
|
189
189
|
} else if (elementType === 'input') {
|
|
190
190
|
if (inputList) {
|
|
191
|
-
this.inputElement.setAttribute('list', inputList)
|
|
191
|
+
this.inputElement.setAttribute('list', inputList);
|
|
192
192
|
}
|
|
193
193
|
this.inputElement.type = type;
|
|
194
194
|
}
|