lightning-base-components 1.16.4-alpha → 1.16.5-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/README.md CHANGED
@@ -76,6 +76,7 @@ The npm package includes these components, along with any utilities and librarie
76
76
 
77
77
  - lightning-accordion
78
78
  - lightning-accordion-section
79
+ - LightningAlert
79
80
  - lightning-avatar
80
81
  - lightning-badge
81
82
  - lightning-breadcrumb
@@ -91,6 +92,7 @@ The npm package includes these components, along with any utilities and librarie
91
92
  - lightning-carousel-image
92
93
  - lightning-checkbox-group
93
94
  - lightning-combobox
95
+ - LightningConfirm
94
96
  - lightning-datatable
95
97
  - lightning-dual-listbox
96
98
  - lightning-dynamic-icon
@@ -116,6 +118,10 @@ The npm package includes these components, along with any utilities and librarie
116
118
  - lightning-menu-divider
117
119
  - lightning-menu-item
118
120
  - lightning-menu-subheader
121
+ - LightningModal
122
+ - lightning-modal-header
123
+ - lightning-modal-body
124
+ - lightning-modal-footer
119
125
  - lightning-navigation
120
126
  - lightning-pill
121
127
  - lightning-pill-container
@@ -123,6 +129,7 @@ The npm package includes these components, along with any utilities and librarie
123
129
  - lightning-progress-indicator
124
130
  - lightning-progress-ring
125
131
  - lightning-progress-step
132
+ - LightningPrompt
126
133
  - lightning-radio-group
127
134
  - lightning-relative-date-time
128
135
  - lightning-slider
@@ -2376,6 +2376,9 @@
2376
2376
  ]
2377
2377
  },
2378
2378
  "marketingAssetcreationApi": {},
2379
+ "mediaUtils": {
2380
+ "minVersion": "0.0"
2381
+ },
2379
2382
  "menuDivider": {
2380
2383
  "minVersion": "0.0",
2381
2384
  "slotNames": [],
@@ -3147,6 +3150,7 @@
3147
3150
  },
3148
3151
  "routingService": {},
3149
3152
  "salesEnablementProgramApi": {},
3153
+ "salesPeopleApi": {},
3150
3154
  "select": {
3151
3155
  "slotNames": [],
3152
3156
  "properties": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lightning-base-components",
3
- "version": "1.16.4-alpha",
3
+ "version": "1.16.5-alpha",
4
4
  "engines": {
5
5
  "node": ">=14.18.2"
6
6
  },
@@ -1282,6 +1282,7 @@
1282
1282
  "lightning/layout",
1283
1283
  "lightning/layoutItem",
1284
1284
  "lightning/lookupAddress",
1285
+ "lightning/mediaUtils",
1285
1286
  "lightning/menuDivider",
1286
1287
  "lightning/menuItem",
1287
1288
  "lightning/menuSubheader",
@@ -1326,4 +1327,4 @@
1326
1327
  ]
1327
1328
  },
1328
1329
  "license": "MIT"
1329
- }
1330
+ }
@@ -0,0 +1,87 @@
1
+ The `mediaUtils` library contains utility functions that can be used by an LWC developer to process media files. The following functions are contained in the `mediaUtils` library:
2
+
3
+ ## processImage
4
+
5
+ You can use `processImage` function to resize and compress image files. To use this function, simply import it in your LWC first:
6
+ ```
7
+ import { processImage } from 'lightning/mediaUtils';
8
+ ```
9
+
10
+ You can then call this function by passing in an input image and a set of options to be used to process the input image, as further described below. It will return a promise that will resolve to a `Blob` object containing the output image data.
11
+
12
+ #### Parameters
13
+
14
+ * `input`: Defines the input image, which can either be a `File` or `Blob` object
15
+ * `options`: An object that defines the options to be used when processing the input image. It is an optional parameter containing a number of flags. If this parameter or any of its flags are omitted, default values will be used as further described below.
16
+ * `resizeMode`: A string that determines how the image will be resized. It can contain one of the below values
17
+ * `fill`: This is default. The image will be resized to fill the target dimension. If necessary, the image will be stretched or squished to fit.
18
+ * `contain`: The image keeps its aspect ratio but will be resized to fit within the target dimension.
19
+ * `none`: The image will not be resized and will retain its original dimension.
20
+ * `resizeStrategy`: A string that determines how to resize the image. If `resizeMode` is set to `none` this flag will be ignored.
21
+ * `reduce`: Only resize if the image is larger than the target size (smaller images won't be resized).
22
+ * `enlarge`: Only resize if the image is smaller than the target size (larger images won't be resized).
23
+ * `always`: This is default. Always resize the image to the target size regardless of the original image dimensions.
24
+ * `targetWidth`: The target width when resizing an image. If omitted, defaults to the original image width. If `resizeMode` is set to `none` this flag will be ignored.
25
+ * `targetHeight`: The target height when resizing an image. If omitted, defaults to the original image height. If `resizeMode` is set to `none` this flag will be ignored.
26
+ * `compressionQuality`: A number between 0-1 that determines the compression quality. If omitted then the browser/webview picks a default value as it sees fit. Note that this parameter will be considered as a suggested compression quality, however the browser/webview may choose to override this value if it deems it necessary. For example if the value is larger than 1 or if it is considered to be too small by the browser/webview, then it will override the value to something that it deems more appropriate.
27
+ * `imageSmoothingEnabled`: A boolean that determines whether scaled images are smoothed or not. Defaults to `true`.
28
+ * `preserveTransparency`: A boolean that determines whether the transparency info of the input image (if any) should be preserved or not. Defaults to `true`. If the input image is a GIF/PNG and this flag is set to `true` the output image will be a PNG. For all other cases the output will be a JPEG.
29
+ * `backgroundColor`: A string that defines a CSS color as described [here](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). Defaults to `white`. When `preserveTransparency` is set to `false`, the output image will have its background set to this color before the input image is resized and drawn on top.
30
+
31
+ #### Example
32
+
33
+ As an example, consider the scenario where you would like to upload files to a Salesforce org using a [`lightning-input`](bundle/lightning-input/documentation) component. In your HTML code, you may have:
34
+ ```
35
+ .
36
+ .
37
+ .
38
+ <lightning-input
39
+ type="file"
40
+ label="Select Files to Upload"
41
+ accept="image/*"
42
+ multiple
43
+ onchange={handleFilesSelected}>
44
+ </lightning-input>
45
+ .
46
+ .
47
+ .
48
+ ```
49
+
50
+ In your Javascript file, you can now use `processImage` from `mediaUtils`, for example to reduce image sizes and hence reduce the bandwidth used to upload the images, as illustrated below:
51
+ ```
52
+ import { processImage } from 'lightning/mediaUtils';
53
+ .
54
+ .
55
+ .
56
+ async handleFilesSelected(event) {
57
+ try {
58
+ // Using the below options we resize images to a maximum of 2048x2048 pixels
59
+ // while containing their aspect ratio. By setting 'resizeStrategy' to 'reduce'
60
+ // we ensure that only images that have either width or height larger than
61
+ // 2048 pixels will be resized. Moreover, we've chosen not to preserve transparency
62
+ // in the input images and instead convert transparent pixels to white. Lastly,
63
+ // the images will be compressed with a 75% compression quality to reduce their byte size.
64
+ let options = {
65
+ resizeMode: 'contain',
66
+ resizeStrategy: 'reduce',
67
+ targetWidth: 2048,
68
+ targetHeight: 2048,
69
+ compressionQuality: 0.75,
70
+ imageSmoothingEnabled: true,
71
+ preserveTransparency: false,
72
+ backgroundColor: 'white'
73
+ };
74
+
75
+ for (const file of event.target.files) {
76
+ let blob = await processImage(file, options);
77
+ // here we can upload the data contained in the blob that is returned by processImage
78
+ }
79
+ }
80
+ catch (error) {
81
+ console.error("ERROR: ", error)
82
+ }
83
+ }
84
+ .
85
+ .
86
+ .
87
+ ```
@@ -0,0 +1,321 @@
1
+ /**
2
+ * Given an input image (as a file handle or a blob) this method will resize
3
+ * and compress the image according to the specified options, and return a Blob
4
+ * object containing the resulting image data.
5
+ *
6
+ * @param {(File|Blob)} input the input image
7
+ * @param {Object} [options] the options to be used when processing the image.
8
+ * It is an optional parameter containing a number of flags. If this
9
+ * parameter or any of its flags are omitted, default values will be
10
+ * used as described below.
11
+ *
12
+ * resizeMode: A string that determines how the image will be resized.
13
+ * fill: This is default. The image will be resized to fill the target dimension.
14
+ * If necessary, the image will be stretched or squished to fit.
15
+ * contain: The image keeps its aspect ratio but will be resized to fit within the target dimension.
16
+ * none: The image will not be resized and will retain its original dimension.
17
+ *
18
+ * resizeStrategy: A string that determines how to resize the image. If resizeMode is set to 'none' this flag will be ignored.
19
+ * reduce: Only resize if the image is larger than the target size (smaller images won't be resized)
20
+ * enlarge: Only resize if the image is smaller than the target size (larger images won't be resized)
21
+ * always: This is default. Always resize the image to the target size regardless of the original image dimensions.
22
+ *
23
+ * targetWidth: The target width when resizing an image. If omitted, defaults to the original image width.
24
+ * If resizeMode is set to 'none' this flag will be ignored.
25
+ *
26
+ * targetHeight: The target height when resizing an image. If omitted, defaults to the original image height.
27
+ * If resizeMode is set to 'none' this flag will be ignored.
28
+ *
29
+ * compressionQuality: A number between 0-1 that determines the compression quality. If omitted then the browser/webview picks
30
+ * a default value as it sees fit. Note that this parameter will be considered as a suggested/desired
31
+ * compression quality however the browser/webview may choose to override this value if it deems it necessary.
32
+ * For example if the value is larger than 1 or if it is considered to be too small by the browser/webview,
33
+ * then it will override the value to something that it deems more appropriate.
34
+ *
35
+ * imageSmoothingEnabled: A boolean that determines whether scaled images are smoothed or not. Defaults to true.
36
+ *
37
+ * preserveTransparency: A boolean that determines whether the transparency info of the input image (if any) should
38
+ * be preserved or not. Defaults to true. If the input image is a GIF/PNG and this flag is set to true
39
+ * the output image will be a PNG. For all other cases the output will be a JPEG.
40
+ *
41
+ * backgroundColor: A string that defines a CSS color as described here: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
42
+ * Defaults to white. When preserveTransparency is set to false, the output image will have its background set to
43
+ * this color before the input image is resized and drawn on top.
44
+ *
45
+ * @returns {Promise} a promise that resolves to a Blob object containing the output image data.
46
+ */
47
+ export function processImage(input, options = null) {
48
+ return readInputData(input)
49
+ .then((dataURL) => loadInputDataIntoImage(dataURL))
50
+ .then((image) => resizeAndCompressImage(image, input.type, options));
51
+ }
52
+
53
+ function readInputData(input) {
54
+ return new Promise((resolve, reject) => {
55
+ const reader = new FileReader();
56
+ reader.onloadend = (event) => {
57
+ resolve(event.target.result);
58
+ };
59
+
60
+ reader.onerror = () => {
61
+ reject(new Error('Unable to read the input data.'));
62
+ };
63
+
64
+ try {
65
+ reader.readAsDataURL(input);
66
+ } catch (err) {
67
+ reject(new Error('Unable to read the input data.'));
68
+ }
69
+ });
70
+ }
71
+
72
+ function loadInputDataIntoImage(dataUrl) {
73
+ return new Promise((resolve, reject) => {
74
+ let image = new Image();
75
+
76
+ image.onload = function () {
77
+ resolve(image);
78
+ };
79
+
80
+ image.onerror = function () {
81
+ reject(new Error('Unable to load the input as an image.'));
82
+ };
83
+
84
+ image.src = dataUrl;
85
+ });
86
+ }
87
+
88
+ function getResizeMode(defaultValue, options) {
89
+ let resizeMode = defaultValue;
90
+ if (options && options.resizeMode) {
91
+ resizeMode = `${options.resizeMode}`.toLowerCase().trim();
92
+ }
93
+
94
+ if (
95
+ resizeMode === 'fill' ||
96
+ resizeMode === 'contain' ||
97
+ resizeMode === 'none'
98
+ ) {
99
+ return resizeMode;
100
+ }
101
+
102
+ throw new Error('Invalid parameter value for resizeMode.');
103
+ }
104
+
105
+ function getResizeStrategy(defaultValue, options) {
106
+ let resizeStrategy = defaultValue;
107
+ if (options && options.resizeStrategy) {
108
+ resizeStrategy = `${options.resizeStrategy}`.toLowerCase().trim();
109
+ }
110
+
111
+ if (
112
+ resizeStrategy === 'reduce' ||
113
+ resizeStrategy === 'enlarge' ||
114
+ resizeStrategy === 'always'
115
+ ) {
116
+ return resizeStrategy;
117
+ }
118
+
119
+ throw new Error('Invalid parameter value for resizeStrategy.');
120
+ }
121
+
122
+ function getTargetWidth(defaultValue, options) {
123
+ let targetWidth = defaultValue;
124
+
125
+ if (options && options.targetWidth) {
126
+ targetWidth = parseFloat(options.targetWidth);
127
+ if (isNaN(targetWidth)) {
128
+ throw new Error('Invalid parameter value for targetWidth.');
129
+ }
130
+ }
131
+
132
+ return Math.round(targetWidth);
133
+ }
134
+
135
+ function getTargetHeight(defaultValue, options) {
136
+ let targetHeight = defaultValue;
137
+
138
+ if (options && options.targetHeight) {
139
+ targetHeight = parseFloat(options.targetHeight);
140
+ if (isNaN(targetHeight)) {
141
+ throw new Error('Invalid parameter value for targetHeight.');
142
+ }
143
+ }
144
+
145
+ return Math.round(targetHeight);
146
+ }
147
+
148
+ function getCompressionQuality(defaultValue, options) {
149
+ let compressionQuality = defaultValue;
150
+
151
+ if (options && options.compressionQuality) {
152
+ compressionQuality = parseFloat(options.compressionQuality);
153
+ if (isNaN(compressionQuality)) {
154
+ throw new Error('Invalid parameter value for compressionQuality.');
155
+ }
156
+ }
157
+
158
+ return compressionQuality;
159
+ }
160
+
161
+ function getPreserveTransparency(defaultValue, options) {
162
+ if (
163
+ options &&
164
+ options.preserveTransparency !== undefined &&
165
+ options.preserveTransparency !== null
166
+ ) {
167
+ let strVal = `${options.preserveTransparency}`.toLowerCase().trim();
168
+
169
+ if (strVal === `true`) {
170
+ return true;
171
+ } else if (strVal === `false`) {
172
+ return false;
173
+ }
174
+
175
+ throw new Error('Invalid parameter value for preserveTransparency.');
176
+ }
177
+
178
+ return defaultValue;
179
+ }
180
+
181
+ function getImageSmoothingEnabled(defaultValue, options) {
182
+ if (
183
+ options &&
184
+ options.imageSmoothingEnabled !== undefined &&
185
+ options.imageSmoothingEnabled !== null
186
+ ) {
187
+ let strVal = `${options.imageSmoothingEnabled}`.toLowerCase().trim();
188
+
189
+ if (strVal === `true`) {
190
+ return true;
191
+ } else if (strVal === `false`) {
192
+ return false;
193
+ }
194
+
195
+ throw new Error('Invalid parameter value for imageSmoothingEnabled.');
196
+ }
197
+
198
+ return defaultValue;
199
+ }
200
+
201
+ function getBackgroundColor(defaultValue, options) {
202
+ if (options && options.backgroundColor) {
203
+ let strVal = `${options.backgroundColor}`;
204
+ if (CSS.supports('color', strVal)) {
205
+ return strVal;
206
+ }
207
+
208
+ throw new Error('Invalid parameter value for backgroundColor.');
209
+ }
210
+
211
+ return defaultValue;
212
+ }
213
+
214
+ function computeFinalDimensions(
215
+ originalWidth,
216
+ originalHeight,
217
+ targetWidth,
218
+ targetHeight,
219
+ resizeMode,
220
+ resizeStrategy
221
+ ) {
222
+ let finalWidth = originalWidth;
223
+ let finalHeight = originalHeight;
224
+
225
+ // first check to see if we even need to resize at all
226
+ if (
227
+ resizeMode !== 'none' &&
228
+ (resizeStrategy === 'always' ||
229
+ (resizeStrategy === 'reduce' &&
230
+ (originalWidth > targetWidth ||
231
+ originalHeight > targetHeight)) ||
232
+ (resizeStrategy === 'enlarge' &&
233
+ (originalWidth < targetWidth || originalHeight < targetHeight)))
234
+ ) {
235
+ // if resizing is needed then compute the final size
236
+ if (resizeMode === 'fill') {
237
+ finalWidth = targetWidth;
238
+ finalHeight = targetHeight;
239
+ } else if (resizeMode === 'contain') {
240
+ let ratio = Math.min(
241
+ targetWidth / originalWidth,
242
+ targetHeight / originalHeight
243
+ );
244
+ finalWidth = Math.round(originalWidth * ratio);
245
+ finalHeight = Math.round(originalHeight * ratio);
246
+ }
247
+ }
248
+
249
+ return { finalWidth, finalHeight };
250
+ }
251
+
252
+ function resizeAndCompressImage(image, mimeType, options) {
253
+ return new Promise((resolve, reject) => {
254
+ let resizeMode;
255
+ let resizeStrategy;
256
+ let targetWidth;
257
+ let targetHeight;
258
+ let compressionQuality;
259
+ let imageSmoothingEnabled;
260
+ let preserveTransparency;
261
+ let backgroundColor;
262
+
263
+ // parse the options
264
+ try {
265
+ resizeMode = getResizeMode('fill', options);
266
+ resizeStrategy = getResizeStrategy('always', options);
267
+ targetWidth = getTargetWidth(image.width, options);
268
+ targetHeight = getTargetHeight(image.height, options);
269
+ compressionQuality = getCompressionQuality(null, options);
270
+ imageSmoothingEnabled = getImageSmoothingEnabled(true, options);
271
+ preserveTransparency = getPreserveTransparency(true, options);
272
+ backgroundColor = getBackgroundColor('white', options);
273
+ } catch (error) {
274
+ reject(error);
275
+ return;
276
+ }
277
+
278
+ let { finalWidth, finalHeight } = computeFinalDimensions(
279
+ image.width,
280
+ image.height,
281
+ targetWidth,
282
+ targetHeight,
283
+ resizeMode,
284
+ resizeStrategy
285
+ );
286
+
287
+ // Render the image into a canvas at the calculated final size
288
+ let canvas = document.createElement('canvas');
289
+ canvas.width = finalWidth;
290
+ canvas.height = finalHeight;
291
+ canvas.imageSmoothingEnabled = imageSmoothingEnabled;
292
+
293
+ let ctx = canvas.getContext('2d');
294
+
295
+ if (!preserveTransparency) {
296
+ ctx.fillStyle = backgroundColor;
297
+ ctx.fillRect(0, 0, finalWidth, finalHeight);
298
+ }
299
+
300
+ ctx.drawImage(image, 0, 0, finalWidth, finalHeight);
301
+
302
+ let targetType = 'image/jpeg';
303
+ if (
304
+ preserveTransparency &&
305
+ (mimeType === 'image/gif' || mimeType === 'image/png')
306
+ ) {
307
+ targetType = 'image/png';
308
+ }
309
+
310
+ let resultFunc = function (blob) {
311
+ resolve(blob);
312
+ };
313
+
314
+ // Compress at the specified compression quality and return the final result
315
+ if (compressionQuality) {
316
+ canvas.toBlob(resultFunc, targetType, compressionQuality);
317
+ } else {
318
+ canvas.toBlob(resultFunc, targetType);
319
+ }
320
+ });
321
+ }
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <LightningComponentBundle xmlns="xmlns=http://soap.sforce.com/2006/04/metadata">
3
+ <isExposed>true</isExposed>
4
+ <minApiVersion>0.0</minApiVersion>
5
+ <support>BETA</support>
6
+ </LightningComponentBundle>
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <button class={computedButtonClass}
3
3
  title={label}
4
+ data-label={label}
4
5
  type="button"
5
6
  onmouseenter={handleMouseEnter}
6
7
  onmouseleave={handleMouseLeave}
@@ -14,6 +14,6 @@
14
14
  variant="inverse"></lightning-primitive-icon>
15
15
  <span if:true={assistiveText} class="slds-assistive-text">{assistiveText}</span>
16
16
  </span>
17
- <span class="slds-path__title">{label}</span>
17
+ <span data-label={label} class="slds-path__title">{label}</span>
18
18
  </a>
19
19
  </template>
@@ -4,7 +4,7 @@ export const urlRegexString =
4
4
  "((?:(?:https?|ftp):\\/\\/(?:[\\w\\-\\|=%~#\\/+*@\\.,;:\\?!']|&){0,2047}(?:[\\(\\)\\.\\w=\\/+#-]*)[^\\s()\\.<>,;\\[\\]`'\"])|(?:\\b(?:[a-z0-9](?:[-a-z0-9]{0,62}[a-z0-9])?\\.)+(?:AC|AD|AE|AERO|AF|AG|AI|AL|AM|AN|AO|AQ|AR|ARPA|AS|ASIA|AT|AU|AW|AX|AZ|BA|BB|BD|BE|BF|BG|BH|BI|BIZ|BJ|BM|BN|BO|BR|BS|BT|BV|BW|BY|BZ|CA|CAT|CC|CD|CF|CG|CH|CI|CK|CL|CM|CN|CO|COM|COOP|CR|CU|CV|CX|CY|CZ|DE|DJ|DK|DM|DO|DZ|EC|EDU|EE|EG|ER|ES|ET|EU|FI|FJ|FK|FM|FO|FR|GA|GB|GD|G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