@xapp/form-widget 1.108.0 → 1.109.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/README.md +36 -0
- package/dist/components/Form/Form.embedded.test.d.ts +1 -0
- package/dist/components/FormWidget/FormWidget.d.ts +0 -0
- package/dist/components/FormWidget/FormWidget.embedded.styles.test.d.ts +1 -0
- package/dist/components/ModalDialog/ModalDialog.d.ts +0 -0
- package/dist/components/ModalDialog/ModalDialog.test.d.ts +1 -0
- package/dist/index.es.js +56 -56
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +56 -56
- package/dist/utils/isEmbedded.d.ts +0 -0
- package/dist/utils/isEmbedded.test.d.ts +1 -0
- package/dist/xapp-form-widget.css +19 -0
- package/dist/xapp-form-widget.js +26 -26
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,6 +11,42 @@ A scheduling widget that supports multi-step forms and displays.
|
|
|
11
11
|
- Audio/voice input capabilities
|
|
12
12
|
- Address autocomplete and service area validation
|
|
13
13
|
- Session management and response caching
|
|
14
|
+
- Inline embedding into a container the host page controls
|
|
15
|
+
|
|
16
|
+
## Embedding
|
|
17
|
+
|
|
18
|
+
By default the widget appends its own `#xapp-form-widget` div to the page and opens as a
|
|
19
|
+
fixed, full-viewport modal over it.
|
|
20
|
+
|
|
21
|
+
To render the form **inline** instead — inside a box the host page positions and sizes —
|
|
22
|
+
create that div yourself and give it the `embedded` class:
|
|
23
|
+
|
|
24
|
+
```html
|
|
25
|
+
<div id="xapp-form-widget" class="embedded" style="
|
|
26
|
+
background-color: transparent;
|
|
27
|
+
width: 400px;
|
|
28
|
+
height: 600px;
|
|
29
|
+
overflow-y: auto;
|
|
30
|
+
overflow-x: hidden;
|
|
31
|
+
position: absolute;
|
|
32
|
+
top: 40px;
|
|
33
|
+
left: 100px;">
|
|
34
|
+
</div>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The widget script finds the existing div and renders into it rather than creating one. In
|
|
38
|
+
embedded mode it:
|
|
39
|
+
|
|
40
|
+
- fills the container instead of capping itself at the desktop breakpoint widths, and drops
|
|
41
|
+
the border, corner radius and drop shadow that make it read as a floating card;
|
|
42
|
+
- renders no backdrop, and does not lock the host page's scroll;
|
|
43
|
+
- hides the side button (a `position: fixed` page-edge tab that would escape the container).
|
|
44
|
+
|
|
45
|
+
Use `class="xapp-embedded"` instead if your own CSS already claims `.embedded`. Either class
|
|
46
|
+
works; the div must still carry `id="xapp-form-widget"`.
|
|
47
|
+
|
|
48
|
+
The div is inspected once, when the widget mounts, so it must carry the class before the
|
|
49
|
+
widget script runs — changing it later has no effect for that page view.
|
|
14
50
|
|
|
15
51
|
## Tracking & Analytics
|
|
16
52
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|