@aurodesignsystem-dev/auro-formkit 0.0.0-pr1413.2 → 0.0.0-pr1419.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/package.json +32 -31
- package/components/bibtemplate/dist/auro-bibtemplate.d.ts +0 -66
- package/components/bibtemplate/dist/buttonVersion.d.ts +0 -2
- package/components/bibtemplate/dist/headerVersion.d.ts +0 -2
- package/components/bibtemplate/dist/iconVersion.d.ts +0 -2
- package/components/bibtemplate/dist/index.d.ts +0 -2
- package/components/bibtemplate/dist/index.js +0 -395
- package/components/bibtemplate/dist/registered.js +0 -395
- package/components/bibtemplate/dist/styles/color-css.d.ts +0 -2
- package/components/bibtemplate/dist/styles/style-css.d.ts +0 -2
- package/components/bibtemplate/dist/styles/tokens-css.d.ts +0 -2
- package/components/checkbox/demo/api.md +0 -489
- package/components/checkbox/demo/api.min.js +0 -2133
- package/components/checkbox/demo/index.md +0 -55
- package/components/checkbox/demo/index.min.js +0 -2108
- package/components/checkbox/demo/keyboardBehavior.md +0 -0
- package/components/checkbox/demo/readme.md +0 -142
- package/components/checkbox/dist/auro-checkbox-group.d.ts +0 -176
- package/components/checkbox/dist/auro-checkbox.d.ts +0 -209
- package/components/checkbox/dist/index.d.ts +0 -3
- package/components/checkbox/dist/index.js +0 -2057
- package/components/checkbox/dist/registered.js +0 -2058
- package/components/checkbox/dist/styles/auro-checkbox-css.d.ts +0 -2
- package/components/checkbox/dist/styles/auro-checkbox-group-css.d.ts +0 -2
- package/components/checkbox/dist/styles/color-css.d.ts +0 -2
- package/components/checkbox/dist/styles/colorGroup-css.d.ts +0 -2
- package/components/checkbox/dist/styles/tokens-css.d.ts +0 -2
- package/components/combobox/demo/api.md +0 -2287
- package/components/combobox/demo/api.min.js +0 -17800
- package/components/combobox/demo/index.md +0 -196
- package/components/combobox/demo/index.min.js +0 -17705
- package/components/combobox/demo/keyboardBehavior.md +0 -281
- package/components/combobox/demo/readme.md +0 -158
- package/components/combobox/dist/auro-combobox.d.ts +0 -566
- package/components/combobox/dist/comboboxKeyboardStrategy.d.ts +0 -8
- package/components/combobox/dist/index.d.ts +0 -2
- package/components/combobox/dist/index.js +0 -15604
- package/components/combobox/dist/registered.js +0 -15606
- package/components/combobox/dist/styles/emphasized/style-css.d.ts +0 -2
- package/components/combobox/dist/styles/snowflake/style-css.d.ts +0 -2
- package/components/combobox/dist/styles/style-css.d.ts +0 -2
- package/components/counter/demo/api.md +0 -1285
- package/components/counter/demo/api.min.js +0 -8112
- package/components/counter/demo/index.md +0 -92
- package/components/counter/demo/index.min.js +0 -8093
- package/components/counter/demo/keyboardBehavior.md +0 -127
- package/components/counter/demo/readme.md +0 -161
- package/components/counter/dist/auro-counter-button.d.ts +0 -14
- package/components/counter/dist/auro-counter-group.d.ts +0 -390
- package/components/counter/dist/auro-counter-wrapper.d.ts +0 -17
- package/components/counter/dist/auro-counter.d.ts +0 -136
- package/components/counter/dist/buttonVersion.d.ts +0 -2
- package/components/counter/dist/iconVersion.d.ts +0 -2
- package/components/counter/dist/index.d.ts +0 -3
- package/components/counter/dist/index.js +0 -8015
- package/components/counter/dist/keyboardStrategy.d.ts +0 -4
- package/components/counter/dist/registered.js +0 -8016
- package/components/counter/dist/styles/color-css.d.ts +0 -2
- package/components/counter/dist/styles/counter-button-color-css.d.ts +0 -2
- package/components/counter/dist/styles/counter-button-css.d.ts +0 -2
- package/components/counter/dist/styles/counter-group-css.d.ts +0 -2
- package/components/counter/dist/styles/counter-wrapper-color-css.d.ts +0 -2
- package/components/counter/dist/styles/counter-wrapper-css.d.ts +0 -2
- package/components/counter/dist/styles/shapeSize-css.d.ts +0 -2
- package/components/counter/dist/styles/style-css.d.ts +0 -2
- package/components/counter/dist/styles/tokens-css.d.ts +0 -2
- package/components/datepicker/demo/api.md +0 -1824
- package/components/datepicker/demo/api.min.js +0 -24510
- package/components/datepicker/demo/index.md +0 -158
- package/components/datepicker/demo/index.min.js +0 -24231
- package/components/datepicker/demo/keyboardBehavior.md +0 -24
- package/components/datepicker/demo/readme.md +0 -137
- package/components/datepicker/dist/auro-calendar-cell.d.ts +0 -169
- package/components/datepicker/dist/auro-calendar-month.d.ts +0 -20
- package/components/datepicker/dist/auro-calendar.d.ts +0 -173
- package/components/datepicker/dist/auro-datepicker.d.ts +0 -715
- package/components/datepicker/dist/buttonVersion.d.ts +0 -2
- package/components/datepicker/dist/datepickerKeyboardStrategy.d.ts +0 -1
- package/components/datepicker/dist/iconVersion.d.ts +0 -2
- package/components/datepicker/dist/index.d.ts +0 -2
- package/components/datepicker/dist/index.js +0 -24146
- package/components/datepicker/dist/popoverVersion.d.ts +0 -2
- package/components/datepicker/dist/registered.js +0 -24146
- package/components/datepicker/dist/styles/classic/color-css.d.ts +0 -2
- package/components/datepicker/dist/styles/classic/style-css.d.ts +0 -2
- package/components/datepicker/dist/styles/color-calendar-css.d.ts +0 -2
- package/components/datepicker/dist/styles/color-cell-css.d.ts +0 -2
- package/components/datepicker/dist/styles/color-css.d.ts +0 -2
- package/components/datepicker/dist/styles/color-month-css.d.ts +0 -2
- package/components/datepicker/dist/styles/shapeSize-css.d.ts +0 -2
- package/components/datepicker/dist/styles/snowflake/color-css.d.ts +0 -2
- package/components/datepicker/dist/styles/snowflake/style-css.d.ts +0 -2
- package/components/datepicker/dist/styles/style-auro-calendar-cell-css.d.ts +0 -2
- package/components/datepicker/dist/styles/style-auro-calendar-css.d.ts +0 -2
- package/components/datepicker/dist/styles/style-auro-calendar-month-css.d.ts +0 -2
- package/components/datepicker/dist/styles/style-css.d.ts +0 -2
- package/components/datepicker/dist/styles/tokens-css.d.ts +0 -2
- package/components/datepicker/dist/utilities.d.ts +0 -78
- package/components/datepicker/dist/utilitiesCalendar.d.ts +0 -38
- package/components/datepicker/dist/utilitiesCalendarRender.d.ts +0 -50
- package/components/datepicker/dist/vendor/wc-range-datepicker/day.d.ts +0 -5
- package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker-calendar.d.ts +0 -60
- package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker-cell.d.ts +0 -1
- package/components/datepicker/dist/vendor/wc-range-datepicker/range-datepicker.d.ts +0 -57
- package/components/dropdown/demo/api.md +0 -1358
- package/components/dropdown/demo/api.min.js +0 -4894
- package/components/dropdown/demo/index.md +0 -283
- package/components/dropdown/demo/index.min.js +0 -4829
- package/components/dropdown/demo/keyboardBehavior.md +0 -77
- package/components/dropdown/demo/readme.md +0 -160
- package/components/dropdown/dist/auro-dropdown.d.ts +0 -482
- package/components/dropdown/dist/auro-dropdownBib.d.ts +0 -128
- package/components/dropdown/dist/dropdownBibKeyboardStrategy.d.ts +0 -7
- package/components/dropdown/dist/iconVersion.d.ts +0 -2
- package/components/dropdown/dist/index.d.ts +0 -2
- package/components/dropdown/dist/index.js +0 -4722
- package/components/dropdown/dist/registered.js +0 -4722
- package/components/dropdown/dist/styles/classic/bibColors-css.d.ts +0 -2
- package/components/dropdown/dist/styles/classic/bibStyles-css.d.ts +0 -2
- package/components/dropdown/dist/styles/classic/color-css.d.ts +0 -2
- package/components/dropdown/dist/styles/classic/style-css.d.ts +0 -2
- package/components/dropdown/dist/styles/color-css.d.ts +0 -2
- package/components/dropdown/dist/styles/emphasized/style-css.d.ts +0 -2
- package/components/dropdown/dist/styles/shapeSize-css.d.ts +0 -2
- package/components/dropdown/dist/styles/snowflake/style-css.d.ts +0 -2
- package/components/dropdown/dist/styles/style-css.d.ts +0 -2
- package/components/dropdown/dist/styles/tokens-css.d.ts +0 -2
- package/components/form/demo/api.md +0 -319
- package/components/form/demo/api.min.js +0 -70505
- package/components/form/demo/index.md +0 -128
- package/components/form/demo/index.min.js +0 -70505
- package/components/form/demo/keyboardBehavior.md +0 -0
- package/components/form/demo/readme.md +0 -145
- package/components/form/dist/auro-form.d.ts +0 -280
- package/components/form/dist/index.d.ts +0 -2
- package/components/form/dist/index.js +0 -718
- package/components/form/dist/registered.d.ts +0 -1
- package/components/form/dist/registered.js +0 -718
- package/components/form/dist/styles/style-css.d.ts +0 -2
- package/components/helptext/dist/auro-helptext.d.ts +0 -69
- package/components/helptext/dist/index.d.ts +0 -2
- package/components/helptext/dist/index.js +0 -231
- package/components/helptext/dist/registered.js +0 -231
- package/components/helptext/dist/styles/color-css.d.ts +0 -2
- package/components/helptext/dist/styles/style-css.d.ts +0 -2
- package/components/helptext/dist/styles/tokens-css.d.ts +0 -2
- package/components/input/demo/api.md +0 -1397
- package/components/input/demo/api.min.js +0 -7460
- package/components/input/demo/index.md +0 -161
- package/components/input/demo/index.min.js +0 -7380
- package/components/input/demo/keyboardBehavior.md +0 -0
- package/components/input/demo/readme.md +0 -134
- package/components/input/dist/auro-input.d.ts +0 -206
- package/components/input/dist/base-input.d.ts +0 -629
- package/components/input/dist/buttonVersion.d.ts +0 -2
- package/components/input/dist/i18n.d.ts +0 -18
- package/components/input/dist/iconVersion.d.ts +0 -2
- package/components/input/dist/index.d.ts +0 -2
- package/components/input/dist/index.js +0 -7292
- package/components/input/dist/registered.js +0 -7292
- package/components/input/dist/styles/classic/color-css.d.ts +0 -2
- package/components/input/dist/styles/classic/style-css.d.ts +0 -2
- package/components/input/dist/styles/color-css.d.ts +0 -2
- package/components/input/dist/styles/default/borders-css.d.ts +0 -2
- package/components/input/dist/styles/default/color-css.d.ts +0 -2
- package/components/input/dist/styles/default/mixins-css.d.ts +0 -2
- package/components/input/dist/styles/default/notificationIcons-css.d.ts +0 -2
- package/components/input/dist/styles/default/style-css.d.ts +0 -2
- package/components/input/dist/styles/emphasized/color-css.d.ts +0 -2
- package/components/input/dist/styles/emphasized/style-css.d.ts +0 -2
- package/components/input/dist/styles/mixins-css.d.ts +0 -2
- package/components/input/dist/styles/shapeSize-css.d.ts +0 -2
- package/components/input/dist/styles/snowflake/style-css.d.ts +0 -2
- package/components/input/dist/styles/style-css.d.ts +0 -2
- package/components/input/dist/styles/tokens-css.d.ts +0 -2
- package/components/input/dist/utilities.d.ts +0 -25
- package/components/layoutElement/dist/auroElement.d.ts +0 -40
- package/components/layoutElement/dist/index.d.ts +0 -2
- package/components/layoutElement/dist/index.js +0 -107
- package/components/layoutElement/dist/registered.js +0 -107
- package/components/menu/demo/api.md +0 -1200
- package/components/menu/demo/api.min.js +0 -2413
- package/components/menu/demo/index.md +0 -72
- package/components/menu/demo/index.min.js +0 -2306
- package/components/menu/demo/keyboardBehavior.md +0 -0
- package/components/menu/demo/readme.md +0 -145
- package/components/menu/dist/auro-menu-utils.d.ts +0 -34
- package/components/menu/dist/auro-menu.context.d.ts +0 -239
- package/components/menu/dist/auro-menu.d.ts +0 -316
- package/components/menu/dist/auro-menuoption.d.ts +0 -210
- package/components/menu/dist/iconVersion.d.ts +0 -2
- package/components/menu/dist/index.d.ts +0 -4
- package/components/menu/dist/index.js +0 -2269
- package/components/menu/dist/registered.js +0 -2217
- package/components/menu/dist/styles/default/color-menu-css.d.ts +0 -2
- package/components/menu/dist/styles/default/color-menuoption-css.d.ts +0 -2
- package/components/menu/dist/styles/default/style-menu-css.d.ts +0 -2
- package/components/menu/dist/styles/default/style-menuoption-css.d.ts +0 -2
- package/components/menu/dist/styles/default/tokens-css.d.ts +0 -2
- package/components/radio/demo/api.md +0 -675
- package/components/radio/demo/api.min.js +0 -2210
- package/components/radio/demo/index.md +0 -73
- package/components/radio/demo/index.min.js +0 -2167
- package/components/radio/demo/keyboardBehavior.md +0 -0
- package/components/radio/demo/readme.md +0 -141
- package/components/radio/dist/auro-radio-group.d.ts +0 -250
- package/components/radio/dist/auro-radio.d.ts +0 -180
- package/components/radio/dist/index.d.ts +0 -3
- package/components/radio/dist/index.js +0 -2116
- package/components/radio/dist/registered.js +0 -2117
- package/components/radio/dist/styles/auro-radio-group-css.d.ts +0 -2
- package/components/radio/dist/styles/color-css.d.ts +0 -2
- package/components/radio/dist/styles/groupColor-css.d.ts +0 -2
- package/components/radio/dist/styles/style-css.d.ts +0 -2
- package/components/radio/dist/styles/tokens-css.d.ts +0 -2
- package/components/select/demo/api.md +0 -2378
- package/components/select/demo/api.min.js +0 -10400
- package/components/select/demo/index.md +0 -355
- package/components/select/demo/index.min.js +0 -10307
- package/components/select/demo/keyboardBehavior.md +0 -246
- package/components/select/demo/readme.md +0 -148
- package/components/select/dist/auro-select.d.ts +0 -545
- package/components/select/dist/index.d.ts +0 -2
- package/components/select/dist/index.js +0 -8218
- package/components/select/dist/registered.js +0 -8218
- package/components/select/dist/selectKeyboardStrategy.d.ts +0 -11
- package/components/select/dist/styles/emphasized/color-css.d.ts +0 -2
- package/components/select/dist/styles/shapeSize-css.d.ts +0 -2
- package/components/select/dist/styles/style-css.d.ts +0 -2
- package/components/select/dist/styles/tokens-css.d.ts +0 -2
- package/custom-elements.json +0 -18768
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
The index.md file is a compiled document. No edits should be made directly to this file.
|
|
3
|
-
|
|
4
|
-
index.md is created by running `npm run build:markdownDocs`.
|
|
5
|
-
|
|
6
|
-
This file is generated based on a template fetched from `./docs/partials/index.md`
|
|
7
|
-
-->
|
|
8
|
-
|
|
9
|
-
# Form
|
|
10
|
-
|
|
11
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/description.md) -->
|
|
12
|
-
<!-- The below content is automatically added from ./../docs/partials/description.md -->
|
|
13
|
-
`<auro-form>` is a [HTML custom element](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) designed to
|
|
14
|
-
serve as the base logic for all auro-constructed forms.
|
|
15
|
-
|
|
16
|
-
It automatically "scrapes" its inner content for any auro form elements, and surfaces
|
|
17
|
-
them (along with events) to the parent form element as a JSON object.
|
|
18
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
19
|
-
|
|
20
|
-
## Form Value Generation
|
|
21
|
-
|
|
22
|
-
Auro form exists to make a developer's life easier through surfacing all Auro form elements in a given form as a single
|
|
23
|
-
JSON object.
|
|
24
|
-
The most common use case the Auro team identified when building Form was the need to collect form data in
|
|
25
|
-
a structured way.
|
|
26
|
-
|
|
27
|
-
The following is required on each Auro form element in a form for it to be collected automatically:
|
|
28
|
-
|
|
29
|
-
1. It **must** have a `name` attribute. This is required if vanilla HTML forms, and we follow the same pattern.
|
|
30
|
-
2. It **must** be an Auro form element. See the section on custom elements for more information.
|
|
31
|
-
|
|
32
|
-
That being said, we do _not_ require form elements to be direct children of `auro-form`.
|
|
33
|
-
They can be nested within other elements for styling, such as a `div`, `span` or `fieldset`.
|
|
34
|
-
|
|
35
|
-
### Form Data Structure
|
|
36
|
-
|
|
37
|
-
In a correctly registered scenario, `auro-form`
|
|
38
|
-
will automatically recognize the auro form elements and collect data from each on the form's `value` key as a JSON object.
|
|
39
|
-
|
|
40
|
-
Each element will be added using the element's `name` attribute as the key, and the element's `value` as the value.
|
|
41
|
-
|
|
42
|
-
A real-world example of this might be:
|
|
43
|
-
|
|
44
|
-
```json
|
|
45
|
-
{
|
|
46
|
-
"hotelCity": "New York",
|
|
47
|
-
"dates": ["2022-01-01", "2022-01-15"],
|
|
48
|
-
"numberOfGuests": 2
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
If your project uses TypeScript, consider using a type like this to represent the form data:
|
|
53
|
-
|
|
54
|
-
```typescript
|
|
55
|
-
// Generic type for form values
|
|
56
|
-
type AuroFormValue<T> = T | null;
|
|
57
|
-
|
|
58
|
-
// Example types
|
|
59
|
-
type AuroInputValue = AuroFormValue<string | number>;
|
|
60
|
-
type AuroDatePickerValue = AuroFormValue<string[]>;
|
|
61
|
-
|
|
62
|
-
// This is the type returned from the `AuroForm.value` getter
|
|
63
|
-
interface AuroFormState {
|
|
64
|
-
// value varies based on form element
|
|
65
|
-
hotelCity: AuroInputValue;
|
|
66
|
-
dates: AuroDatePickerValue;
|
|
67
|
-
numberOfGuests: AuroInputValue;
|
|
68
|
-
}
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Accessing Form Data
|
|
72
|
-
|
|
73
|
-
As Auro components are designed to be framework-agnostic, data can be retrieved using simple vanilla JavaScript patterns.
|
|
74
|
-
If you have ever worked with a standard HTML5 form, you are already equipped to work with Auro forms!
|
|
75
|
-
|
|
76
|
-
Once you have a reference to the form element (React ref, querySelector, etc.),
|
|
77
|
-
you can access the form data using the following methods:
|
|
78
|
-
|
|
79
|
-
**Data Keys + Get Methods**:
|
|
80
|
-
- `.value` - Getter which returns the current form data as a JSON object.
|
|
81
|
-
- `.validity` - Returns the current validity state of the form (`valid` or `invalid`).
|
|
82
|
-
|
|
83
|
-
**Extra Information**:
|
|
84
|
-
- `.isInitialState` - Returns a boolean indicating if the form is in its initial state.
|
|
85
|
-
|
|
86
|
-
**Events**
|
|
87
|
-
- `input` - Fires when the form state changes.
|
|
88
|
-
- `reset` - Fires when the form is reset.
|
|
89
|
-
- `submit` - Fires when the form is submitted.
|
|
90
|
-
|
|
91
|
-
**Advanced Features**:
|
|
92
|
-
- `.formState` - This is the internal form state. It includes extra `required` and `validity` information for each form element.
|
|
93
|
-
This key is not required for normal form usage, but can add additional context for more complex forms.
|
|
94
|
-
|
|
95
|
-
### Basic Form Example
|
|
96
|
-
|
|
97
|
-
The most basic form implementation requires an `auro-input` and an optional auro button with `type="submit"`.
|
|
98
|
-
|
|
99
|
-
By default, Auro Form connects a `submit` event to all `type="submit"` buttons within the form.
|
|
100
|
-
|
|
101
|
-
<div class="exampleWrapper">
|
|
102
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
|
|
103
|
-
<!-- The below content is automatically added from ./../apiExamples/basic.html -->
|
|
104
|
-
<auro-form>
|
|
105
|
-
<auro-input id="search-box" name="searchBox" required>
|
|
106
|
-
<span slot="label">Search flights</span>
|
|
107
|
-
</auro-input>
|
|
108
|
-
<br />
|
|
109
|
-
<auro-button type="submit">Submit</auro-button>
|
|
110
|
-
</auro-form>
|
|
111
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
112
|
-
</div>
|
|
113
|
-
<auro-accordion alignRight>
|
|
114
|
-
<span slot="trigger">See code</span>
|
|
115
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.html) -->
|
|
116
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
|
|
117
|
-
|
|
118
|
-
```html
|
|
119
|
-
<auro-form>
|
|
120
|
-
<auro-input id="search-box" name="searchBox" required>
|
|
121
|
-
<span slot="label">Search flights</span>
|
|
122
|
-
</auro-input>
|
|
123
|
-
<br />
|
|
124
|
-
<auro-button type="submit">Submit</auro-button>
|
|
125
|
-
</auro-form>
|
|
126
|
-
```
|
|
127
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
128
|
-
</auro-accordion>
|