lightning-base-components 1.14.6-alpha → 1.15.1-alpha
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/metadata/raptor.json +5 -3
- package/package.json +8 -1
- package/scopedImports/@salesforce-internal-core.appVersion.js +1 -1
- package/scopedImports/@salesforce-label-LightningProgressBar.progressBar.js +1 -0
- package/src/lightning/alert/__docs__/alert.md +101 -0
- package/src/lightning/alert/__examples__disabled/basic/basic.css +7 -0
- package/src/lightning/alert/__examples__disabled/basic/basic.html +8 -0
- package/src/lightning/alert/__examples__disabled/basic/basic.js +14 -0
- package/src/lightning/alert/alert.html +3 -0
- package/src/lightning/alert/alert.js +78 -0
- package/src/lightning/alert/alert.js-meta.xml +6 -0
- package/src/lightning/button/__wdio__/utam/utam.html +3 -0
- package/src/lightning/button/__wdio__/utam/utam.js +3 -0
- package/src/lightning/button/__wdio__/utam/utam.spec.js +20 -0
- package/src/lightning/buttonMenu/buttonMenu.js +12 -0
- package/src/lightning/confirm/__docs__/confirm.md +100 -0
- package/src/lightning/confirm/__examples__disabled/basic/basic.css +7 -0
- package/src/lightning/confirm/__examples__disabled/basic/basic.html +8 -0
- package/src/lightning/confirm/__examples__disabled/basic/basic.js +14 -0
- package/src/lightning/confirm/confirm.html +3 -0
- package/src/lightning/confirm/confirm.js +80 -0
- package/src/lightning/confirm/confirm.js-meta.xml +6 -0
- package/src/lightning/datatable/__wdio__/utam/utam.html +17 -0
- package/src/lightning/datatable/__wdio__/utam/utam.js +91 -0
- package/src/lightning/datatable/__wdio__/utam/utam.spec.js +189 -0
- package/src/lightning/datatable/columns.js +166 -71
- package/src/lightning/datatable/datatable.js +98 -20
- package/src/lightning/datatable/headerActions.js +2 -2
- package/src/lightning/datatable/keyboard.js +10 -10
- package/src/lightning/datatable/renderManager.js +45 -13
- package/src/lightning/datatable/resizeSensor.js +11 -3
- package/src/lightning/datatable/rowSelection.js +1 -1
- package/src/lightning/datatable/rowSelectionShared.js +33 -20
- package/src/lightning/datatable/rows.js +3 -2
- package/src/lightning/datatable/sort.js +8 -8
- package/src/lightning/datatable/state.js +8 -1
- package/src/lightning/datatable/templates/div/div.html +6 -2
- package/src/lightning/datatable/templates/table/table.html +5 -2
- package/src/lightning/datatable/tree.js +25 -0
- package/src/lightning/datatable/types.js +77 -9
- package/src/lightning/datatable/utils.js +51 -24
- package/src/lightning/datatable/virtualization.js +319 -0
- package/src/lightning/datatable/wrapText.js +53 -16
- package/src/lightning/datepicker/__perf__DISABLED/datepickerWithCalendarOpen.perf.js +55 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/dashboard_component.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/slack.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/tableau.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/standard/travel_mode.html +2 -2
- package/src/lightning/iconSvgTemplates/buildTemplates/templates.js +8 -1
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/data_model.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/serialized_product.html +1 -1
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/serialized_product_transaction.html +2 -1
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/slack.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/tableau.html +7 -0
- package/src/lightning/iconSvgTemplates/buildTemplates/utility/video_off.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/dashboard_component.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/slack.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/tableau.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/standard/travel_mode.html +2 -2
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/templates.js +8 -1
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/data_model.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/serialized_product.html +1 -1
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/serialized_product_transaction.html +2 -1
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/slack.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/tableau.html +7 -0
- package/src/lightning/iconSvgTemplatesRtl/buildTemplates/utility/video_off.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/dashboard_component.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/slack.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/tableau.html +7 -0
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/standard/travel_mode.html +2 -2
- package/src/lightning/iconSvgTemplatesStandard/buildTemplates/templates.js +4 -1
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/dashboard_component.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/slack.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/tableau.html +7 -0
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/standard/travel_mode.html +2 -2
- package/src/lightning/iconSvgTemplatesStandardRtl/buildTemplates/templates.js +4 -1
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/templates.js +5 -1
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/data_model.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/serialized_product.html +1 -1
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/serialized_product_transaction.html +2 -1
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/slack.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/tableau.html +7 -0
- package/src/lightning/iconSvgTemplatesUtility/buildTemplates/utility/video_off.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/templates.js +5 -1
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/data_model.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/serialized_product.html +1 -1
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/serialized_product_transaction.html +2 -1
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/slack.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/tableau.html +7 -0
- package/src/lightning/iconSvgTemplatesUtilityRtl/buildTemplates/utility/video_off.html +7 -0
- package/src/lightning/input/__docs__/input.md +2 -0
- package/src/lightning/interactiveDialogBase/interactiveDialogBase.css +494 -0
- package/src/lightning/interactiveDialogBase/interactiveDialogBase.html +63 -0
- package/src/lightning/interactiveDialogBase/interactiveDialogBase.js +200 -0
- package/src/lightning/menuItem/menuItem.js +4 -1
- package/src/lightning/modalBase/modalBase.css +20 -0
- package/src/lightning/modalBase/modalBase.html +54 -0
- package/src/lightning/modalBase/modalBase.js +1039 -0
- package/src/lightning/overlay/__docs__/overlay.md +90 -0
- package/src/lightning/overlay/__examples__/alert/alert.html +27 -0
- package/src/lightning/overlay/__examples__/alert/alert.js +33 -0
- package/src/lightning/overlay/__examples__/basic/basic.css +7 -0
- package/src/lightning/overlay/__examples__/basic/basic.html +18 -0
- package/src/lightning/overlay/__examples__/basic/basic.js +61 -0
- package/src/lightning/overlay/__examples__/demo/demo.html +29 -0
- package/src/lightning/overlay/__examples__/demo/demo.js +40 -0
- package/src/lightning/overlay/__examples__/panel/panel.html +17 -0
- package/src/lightning/overlay/__examples__/panel/panel.js +21 -0
- package/src/lightning/overlay/overlay.html +3 -0
- package/src/lightning/overlay/overlay.js +45 -0
- package/src/lightning/overlayContainer/__docs__/overlayContainer.md +0 -0
- package/src/lightning/overlayContainer/overlayContainer.html +3 -0
- package/src/lightning/overlayContainer/overlayContainer.js +138 -0
- package/src/lightning/overlayManager/overlayManager.js +54 -0
- package/src/lightning/overlayUtils/overlayUtils.js +17 -0
- package/src/lightning/progressBar/progressBar.html +2 -1
- package/src/lightning/progressBar/progressBar.js +18 -1
- package/src/lightning/prompt/__docs__/prompt.md +102 -0
- package/src/lightning/prompt/__examples__disabled/basic/basic.css +7 -0
- package/src/lightning/prompt/__examples__disabled/basic/basic.html +8 -0
- package/src/lightning/prompt/__examples__disabled/basic/basic.js +15 -0
- package/src/lightning/prompt/prompt.css +81 -0
- package/src/lightning/prompt/prompt.html +8 -0
- package/src/lightning/prompt/prompt.js +92 -0
- package/src/lightning/prompt/prompt.js-meta.xml +6 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
The `lightning/prompt` module lets you create an prompt modal within your component. Use `LightningPrompt` on your components to ask the user to provide information before they continue.
|
|
2
|
+
|
|
3
|
+
`lightning/prompt` is not supported on mobile devices.
|
|
4
|
+
|
|
5
|
+
Use `LightningPrompt.open()` instead of the native `window.prompt()` for a more consistent user experience. They have similar functions, but `LightningPrompt.open()` works in cross-origin iframes, where the `.prompt()` method is no longer supported in Chrome and Safari. Unlike `window.prompt()`, `LightningPrompt.open()` doesn't halt execution on the page, it returns a Promise. Use `async`/`await` or `.then()` for any code you want to execute after the prompt has closed.
|
|
6
|
+
|
|
7
|
+
Import `LightningPrompt` from the `lightning/prompt` module in the component that will launch the prompt modal, and call `LightningPrompt.open()` with your desired attributes.
|
|
8
|
+
|
|
9
|
+
This example creates a prompt modal with a header, message, and two buttons. If you enter text and click **OK** in the prompt, the `.open()` function returns a promise that resolves to the input value. If you click **Cancel**, the function returns a promise that resolves to `null`.
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<!-- c/myApp.html -->
|
|
13
|
+
<template>
|
|
14
|
+
<lightning-button onclick="{handlePromptClick}" label="Open Prompt Modal">
|
|
15
|
+
</lightning-button>
|
|
16
|
+
</template>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```javascript
|
|
20
|
+
import { LightningElement } from 'lwc';
|
|
21
|
+
import LightningPrompt from 'lightning/prompt';
|
|
22
|
+
|
|
23
|
+
export default class MyApp extends LightningElement {
|
|
24
|
+
handlePromptClick() {
|
|
25
|
+
LightningPrompt.open({
|
|
26
|
+
message: 'this is the prompt message',
|
|
27
|
+
//theme defaults to "default"
|
|
28
|
+
label: 'Please Respond', // this is the header text
|
|
29
|
+
defaultValue: 'initial input value', //this is optional
|
|
30
|
+
}).then((result) => {
|
|
31
|
+
//Prompt has been closed
|
|
32
|
+
//result is input text if OK clicked
|
|
33
|
+
//and null if cancel was clicked
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
#### Component Styling
|
|
40
|
+
|
|
41
|
+
This component uses the Salesforce Lightning Design System (SLDS) [`prompt` blueprint](https://www.lightningdesignsystem.com/components/prompt/#site-main-content).
|
|
42
|
+
|
|
43
|
+
`LightningPrompt` supports the following attributes:
|
|
44
|
+
|
|
45
|
+
- `message`: Message text that displays in the prompt.
|
|
46
|
+
- `defaultValue`: Optional. Initial leading text for the input text box.
|
|
47
|
+
- `label`: Header text, also used as the `aria-label`. Default string is `Prompt`.
|
|
48
|
+
- `variant`: Two values, `header` and `headerless`. Default value is `header`.
|
|
49
|
+
- `theme`: Color theme for the header. The `theme` attribute supports the following [options](https://www.lightningdesignsystem.com/utilities/themes/#site-main-content) from SLDS:
|
|
50
|
+
- `default`: white
|
|
51
|
+
- `shade`: gray
|
|
52
|
+
- `inverse`: dark blue
|
|
53
|
+
- `alt-inverse`: darker blue
|
|
54
|
+
- `success`: green
|
|
55
|
+
- `info`: gray-ish blue
|
|
56
|
+
- `warning`: yellow
|
|
57
|
+
- `error`: red
|
|
58
|
+
- `offline`: black
|
|
59
|
+
|
|
60
|
+
If an invalid value is provided, `LightningPrompt` uses the `default` theme.
|
|
61
|
+
|
|
62
|
+
#### Testing Your Component's Prompt
|
|
63
|
+
|
|
64
|
+
Code using `LightningPrompt` can be tested by mocking the `LightningPrompt.open()` method.
|
|
65
|
+
|
|
66
|
+
The example below uses a button to open a prompt dialog and sets the result in a template.
|
|
67
|
+
|
|
68
|
+
```html
|
|
69
|
+
<button data-button onclick="{handleClick}">Open Prompt</button>
|
|
70
|
+
<div data-result>{result}</div>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
```js
|
|
74
|
+
import LightningPrompt from 'lightning/prompt';
|
|
75
|
+
jest.mock('lightning/prompt');
|
|
76
|
+
|
|
77
|
+
test(() => {
|
|
78
|
+
// Create and appendChild(element)
|
|
79
|
+
|
|
80
|
+
const buttonEle = element.shadowRoot.querySelector('[data-button]');
|
|
81
|
+
const resultEle = element.shadowRoot.querySelector('[data-result]');
|
|
82
|
+
|
|
83
|
+
// Mock .open()
|
|
84
|
+
// Pass string representing input text if testing when user clicks "OK"
|
|
85
|
+
// Pass null if testing when user clicks "Cancel"
|
|
86
|
+
LightningPrompt.open = jest.fn().mockResolvedValue('test value');
|
|
87
|
+
// Initial value
|
|
88
|
+
expect(resultEle.textContent).toBe('unknown');
|
|
89
|
+
// Click modal open button
|
|
90
|
+
buttonEle.click();
|
|
91
|
+
|
|
92
|
+
// Click handler render cycle
|
|
93
|
+
await Promise.resolve();
|
|
94
|
+
// Render cycle triggered by tracked value {result}
|
|
95
|
+
await Promise.resolve();
|
|
96
|
+
|
|
97
|
+
// Verify result is set in the template
|
|
98
|
+
expect(resultEle.textContent).toBe('test value');
|
|
99
|
+
// Open triggered once
|
|
100
|
+
expect(LightningPrompt.open.mock.calls).toHaveLength(1);
|
|
101
|
+
})
|
|
102
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LightningElement } from 'lwc';
|
|
2
|
+
import LightningPrompt from 'lightning/prompt';
|
|
3
|
+
|
|
4
|
+
export default class PromptBasic extends LightningElement {
|
|
5
|
+
handlePromptModal() {
|
|
6
|
+
LightningPrompt.open({
|
|
7
|
+
message: 'this is the prompt message',
|
|
8
|
+
defaultValue: 'test',
|
|
9
|
+
label: 'Please Respond',
|
|
10
|
+
// use default theme
|
|
11
|
+
}).then((result) => {
|
|
12
|
+
console.log('prompt result', result);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
.slds-form-element__label {
|
|
2
|
+
overflow-wrap: break-word;
|
|
3
|
+
word-wrap: break-word;
|
|
4
|
+
-webkit-hyphens: auto;
|
|
5
|
+
-ms-hyphens: auto;
|
|
6
|
+
hyphens: auto;
|
|
7
|
+
display: inline-block;
|
|
8
|
+
color: #444444;
|
|
9
|
+
font-size: 0.75rem;
|
|
10
|
+
padding-right: 0.5rem;
|
|
11
|
+
padding-top: 0.25rem;
|
|
12
|
+
margin-bottom: 0.125rem;
|
|
13
|
+
}
|
|
14
|
+
.slds-form-element__label:empty {
|
|
15
|
+
margin: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.slds-no-flex {
|
|
19
|
+
-webkit-box-flex: 0;
|
|
20
|
+
-ms-flex: none;
|
|
21
|
+
flex: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.slds-form-element__control {
|
|
25
|
+
clear: left;
|
|
26
|
+
position: relative;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.slds-grow {
|
|
30
|
+
-webkit-box-flex: 1;
|
|
31
|
+
-ms-flex-positive: 1;
|
|
32
|
+
flex-grow: 1;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.slds-input {
|
|
36
|
+
padding-top: 0;
|
|
37
|
+
padding-right: var(--slds-c-input-spacing-horizontal-end, var(--sds-c-input-spacing-horizontal-end, 1rem));
|
|
38
|
+
padding-bottom: 0;
|
|
39
|
+
padding-left: var(--slds-c-input-spacing-horizontal-start, var(--sds-c-input-spacing-horizontal-start, 0.75rem));
|
|
40
|
+
width: 100%;
|
|
41
|
+
min-height: calc(1.875rem + (1px * 2));
|
|
42
|
+
line-height: 1.875rem;
|
|
43
|
+
border: 1px solid var(--slds-c-input-color-border, var(--sds-c-input-color-border, #c9c9c9));
|
|
44
|
+
border-radius: var(--slds-c-input-radius-border, var(--sds-c-input-radius-border, 0.25rem));
|
|
45
|
+
background-color: var(--slds-c-input-color-background, var(--sds-c-input-color-background, white));
|
|
46
|
+
color: var(--slds-c-input-text-color, var(--sds-c-input-text-color));
|
|
47
|
+
-webkit-box-shadow: var(--slds-c-input-shadow, var(--sds-c-input-shadow));
|
|
48
|
+
box-shadow: var(--slds-c-input-shadow, var(--sds-c-input-shadow));
|
|
49
|
+
-webkit-transition: border 0.1s linear, background-color 0.1s linear;
|
|
50
|
+
transition: border 0.1s linear, background-color 0.1s linear;
|
|
51
|
+
display: inline-block;
|
|
52
|
+
}
|
|
53
|
+
.slds-input:focus,
|
|
54
|
+
.slds-input:active {
|
|
55
|
+
/*! @css-var-fallback border-color */
|
|
56
|
+
border-color: var(--sds-c-input-color-border-focus, #1b96ff);
|
|
57
|
+
/*! @css-var-fallback background-color */
|
|
58
|
+
background-color: var(
|
|
59
|
+
--sds-c-input-color-background-focus,
|
|
60
|
+
var(--sds-c-input-color-background, white)
|
|
61
|
+
);
|
|
62
|
+
color: var(--sds-c-input-text-color-focus);
|
|
63
|
+
/*! @css-var-fallback box-shadow */
|
|
64
|
+
-webkit-box-shadow: var(--sds-c-input-shadow-focus, 0 0 3px #0176d3);
|
|
65
|
+
box-shadow: var(--sds-c-input-shadow-focus, 0 0 3px #0176d3);
|
|
66
|
+
outline: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
input {
|
|
70
|
+
line-height: normal;
|
|
71
|
+
color: inherit;
|
|
72
|
+
font: inherit;
|
|
73
|
+
margin: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
*,
|
|
77
|
+
*:before,
|
|
78
|
+
*:after {
|
|
79
|
+
-webkit-box-sizing: border-box;
|
|
80
|
+
box-sizing: border-box;
|
|
81
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { api } from 'lwc';
|
|
2
|
+
import LightningInteractiveDialogBase from 'lightning/interactiveDialogBase';
|
|
3
|
+
import { parent, instanceName, secure } from 'lightning/overlayUtils';
|
|
4
|
+
import LightningOverlay from 'lightning/overlay';
|
|
5
|
+
import labelDefault from '@salesforce/label/LightningPrompt.defaultLabel';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Create a prompt modal within your component that asks the
|
|
9
|
+
* user to provide information before they continue.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export default class LightningPrompt extends LightningOverlay {
|
|
13
|
+
static [instanceName] = 'lightning-prompt';
|
|
14
|
+
static [parent] = LightningInteractiveDialogBase;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* value to use for header text in "header" variant
|
|
18
|
+
* or aria-label in "headerless" variant
|
|
19
|
+
* @type {string}
|
|
20
|
+
* @default "Prompt" (translated accordingly)
|
|
21
|
+
*/
|
|
22
|
+
@api label = labelDefault;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* text to display in modal
|
|
26
|
+
*/
|
|
27
|
+
@api message = '';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* default value for input
|
|
31
|
+
*/
|
|
32
|
+
@api defaultValue = '';
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* variant to use for alert; may be
|
|
36
|
+
* set to "header" or "headerless"
|
|
37
|
+
*/
|
|
38
|
+
@api variant = 'header';
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* theme to use when variant is "header"
|
|
42
|
+
* valid values are based on SLDS themes and are
|
|
43
|
+
* listed in "themeOptions" of interactiveDialogBase.js
|
|
44
|
+
*/
|
|
45
|
+
@api theme = 'default';
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Dispatches privateclose event
|
|
49
|
+
* and closes dialog
|
|
50
|
+
*/
|
|
51
|
+
close(result) {
|
|
52
|
+
const promise = new Promise((resolve) => {
|
|
53
|
+
this.dispatchEvent(
|
|
54
|
+
new CustomEvent('privateclose', {
|
|
55
|
+
detail: {
|
|
56
|
+
resolve,
|
|
57
|
+
[secure]: true,
|
|
58
|
+
},
|
|
59
|
+
bubbles: true,
|
|
60
|
+
})
|
|
61
|
+
);
|
|
62
|
+
});
|
|
63
|
+
super.close(result, promise);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Dispatches privatechildrender event
|
|
68
|
+
* with data parent needs to correctly render
|
|
69
|
+
*/
|
|
70
|
+
renderedCallback() {
|
|
71
|
+
const evt = new CustomEvent('privatechildrender', {
|
|
72
|
+
bubbles: true,
|
|
73
|
+
detail: {
|
|
74
|
+
message: this.message,
|
|
75
|
+
label: this.label,
|
|
76
|
+
hideCancel: false,
|
|
77
|
+
showDescription: false,
|
|
78
|
+
getOkValue: this.getOkValue.bind(this),
|
|
79
|
+
getCancelValue: () => null,
|
|
80
|
+
role: 'dialog',
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
this.dispatchEvent(evt);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
getOkValue() {
|
|
87
|
+
if (this.template.querySelector('input')) {
|
|
88
|
+
return this.template.querySelector('input').value;
|
|
89
|
+
}
|
|
90
|
+
return this.defaultValue;
|
|
91
|
+
}
|
|
92
|
+
}
|