Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Summer 21 major updates #96

Merged
merged 8 commits into from
Jun 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34,635 changes: 31,209 additions & 3,426 deletions package-lock.json

Large diffs are not rendered by default.

23 changes: 16 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lwc-utils",
"version": "1.5.4",
"version": "1.7.0",
"scripts": {
"eslint:validate": "eslint **/lwc/**/*.js",
"prettier:validate": "prettier --check '**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}'",
Expand All @@ -26,12 +26,21 @@
},
"homepage": "https://github.com/tsalb/lwc-utils#readme",
"devDependencies": {
"@salesforce/eslint-config-lwc": "^0.9.0",
"@salesforce/eslint-plugin-aura": "^1.4.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.11.0",
"prettier": "^2.2.1",
"prettier-plugin-apex": "^1.7.0",
"@lwc/eslint-plugin-lwc": "^1.0.1",
"@prettier/plugin-xml": "^0.13.1",
"@sa11y/jest": "^0.3.1",
"@salesforce/eslint-config-lwc": "^2.0.0",
"@salesforce/eslint-plugin-aura": "^2.0.0",
"@salesforce/eslint-plugin-lightning": "^0.1.1",
"@salesforce/sfdx-lwc-jest": "^0.10.4",
"eslint": "^7.25.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^23.8.2",
"husky": "^5.2.0",
"jest-canvas-mock": "^2.3.1",
"prettier": "^2.3.0",
"prettier-plugin-apex": "^1.9.1",
"rimraf": "^3.0.2"
}
}
20 changes: 10 additions & 10 deletions sfdx-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,35 @@
"path": "utils-core",
"default": true,
"package": "LWC Utils",
"versionName": "ver 1.6.0",
"versionNumber": "1.6.0.NEXT",
"versionName": "ver 1.7.0",
"versionNumber": "1.7.0.NEXT",
"postInstallUrl": "https://github.com/tsalb/lwc-utils/releases",
"releaseNotesUrl": "https://github.com/tsalb/lwc-utils/releases"
},
{
"path": "utils-recipes",
"default": false,
"package": "LWC Utils Recipes",
"versionName": "ver 1.6.0",
"versionNumber": "1.6.0.NEXT",
"versionName": "ver 1.7.0",
"versionNumber": "1.7.0.NEXT",
"postInstallUrl": "https://github.com/tsalb/lwc-utils/releases",
"releaseNotesUrl": "https://github.com/tsalb/lwc-utils/releases",
"dependencies": [
{
"package": "LWC Utils",
"versionNumber": "1.6.0.LATEST"
"versionNumber": "1.7.0.LATEST"
}
]
}
],
"namespace": "",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "51.0",
"sourceApiVersion": "52.0",
"packageAliases": {
"LWC Utils Recipes": "0Ho1Q000000blJnSAI",
"LWC Utils Recipes@1.6.0-1": "04t1Q000001MRpjQAG",
"LWC Utils": "0Ho1Q000000blJiSAI",
"LWC Utils@1.5.4-1": "04t1Q000001Qi2eQAC",
"LWC Utils@1.6.0-2": "04t1Q000001MRpeQAG"
"LWC Utils Recipes": "0Ho1Q000000blJnSAI",
"LWC Utils@1.6.0-2": "04t1Q000001MRpeQAG",
"LWC Utils@1.7.0-1": "04t1Q000001MRsYQAW",
"LWC Utils Recipes@1.7.0-1": "04t1Q000001MRsdQAG"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>51.0</apiVersion>
<apiVersion>52.0</apiVersion>
<description>For creating modals and popovers</description>
</AuraDefinitionBundle>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>51.0</apiVersion>
<apiVersion>52.0</apiVersion>
<description>A Lightning Component Bundle</description>
</AuraDefinitionBundle>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>51.0</apiVersion>
<apiVersion>52.0</apiVersion>
<description>Send an event via MessageService when this local flow action is used</description>
</AuraDefinitionBundle>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>51.0</apiVersion>
<apiVersion>52.0</apiVersion>
<description>Generic Flow launcher. The flow base component is only aura in Summer 19</description>
</AuraDefinitionBundle>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>51.0</apiVersion>
<apiVersion>52.0</apiVersion>
<description>Handles and delegates LMS events via messageService</description>
</AuraDefinitionBundle>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>51.0</apiVersion>
<apiVersion>52.0</apiVersion>
<description>Utility component for dynamic modals (overlays)</description>
</AuraDefinitionBundle>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<AuraDefinitionBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>51.0</apiVersion>
<apiVersion>52.0</apiVersion>
<description>A Lightning Component Bundle</description>
</AuraDefinitionBundle>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>51.0</apiVersion>
<apiVersion>52.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>51.0</apiVersion>
<apiVersion>52.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>51.0</apiVersion>
<apiVersion>52.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="urn:metadata.tooling.soap.sforce.com">
<apiVersion>51.0</apiVersion>
<apiVersion>52.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="urn:metadata.tooling.soap.sforce.com">
<apiVersion>51.0</apiVersion>
<apiVersion>52.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="urn:metadata.tooling.soap.sforce.com">
<apiVersion>51.0</apiVersion>
<apiVersion>52.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<template if:true={showSpinner}>
<lightning-spinner alternative-text="Loading"></lightning-spinner>
</template>
<c-datatable-extension
<c-base-datatable-extension
class={extensionBoundaryClass}
key-field={keyField}
show-row-number-column={isShowRowNumber}
Expand All @@ -65,7 +65,7 @@
oncancel={handleCancel}
onsave={handleSave}
errors={saveErrors}
></c-datatable-extension>
></c-base-datatable-extension>
</div>
<div slot="actions">
<lightning-layout horizontal-align="end" vertical-align="end" pull-to-boundary="small">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import getLookupConfig from '@salesforce/apex/DataTableService.getLookupConfig';

// Toast and Errors
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { reduceErrors, createFlattenedSetFromDelimitedString } from 'c/utils';
import { reduceErrors, createFlattenedSetFromDelimitedString } from 'c/baseUtils';

// Global Search
import Fuse from 'c/fuseBasic';
Expand All @@ -48,8 +48,10 @@ const COLUMN_LABEL_DELIMITER = '=>';
const MAX_ROW_SELECTION = 200;
const OBJECTS_WITH_COMPOUND_NAMES = ['Contact'];

// Lower is less fuzzy / better hit result
const SEARCH_THRESHOLD = 0.1;
// Fuse Config
const INCLUDE_SCORE = true;
const IGNORE_LOCATION = true;
const SEARCH_THRESHOLD = 0.2; // Lower is less fuzzy

// Datatable_Action_Config__mdt
const LEGACY_TABLE_ACTION_ONE_STRING = 'Primary';
Expand All @@ -64,7 +66,7 @@ const DATATABLE_LOOKUP_CONFIG_DEFAULT = 'Default_Lookup_Config';
// API props are controlled by soqlDatatable and collectionDatatable
/* eslint @lwc/lwc/no-api-reassignments: 0 */

export default class Datatable extends LightningElement {
export default class BaseDatatable extends LightningElement {
@api recordId;
@api
get keyField() {
Expand Down Expand Up @@ -578,9 +580,9 @@ export default class Datatable extends LightningElement {
const dialogPayload = {
method: 'bodyModal',
config: {
auraId: 'datatable-delete-row',
auraId: 'base-datatable-delete-row',
headerLabel: 'Delete ' + this._objectInfo.label,
component: 'c:datatableDeleteRowForm',
component: 'c:baseDatatableDeleteRowForm',
componentParams: {
row: row,
uniqueBoundary: this.uniqueBoundary
Expand All @@ -594,9 +596,9 @@ export default class Datatable extends LightningElement {
const dialogPayload = {
method: 'bodyModalLarge',
config: {
auraId: 'datatable-edit-row',
auraId: 'base-datatable-edit-row',
headerLabel: `Edit ${this._objectInfo.label} Record`,
component: 'c:datatableEditRowForm',
component: 'c:baseDatatableEditRowForm',
componentParams: {
row: row,
objectApiName: this._objectInfo.apiName,
Expand Down Expand Up @@ -902,8 +904,8 @@ export default class Datatable extends LightningElement {
!fieldName.toLowerCase().includes('id')
);
const options = {
includeScore: true,
ignoreLocation: true,
includeScore: INCLUDE_SCORE,
ignoreLocation: IGNORE_LOCATION,
threshold: SEARCH_THRESHOLD, // default is 0.6, this makes it less fuzzy
keys: searchKeys
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>51.0</apiVersion>
<apiVersion>52.0</apiVersion>
<isExposed>false</isExposed>
</LightningComponentBundle>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import { LightningElement, api } from 'lwc';
import { deleteRecord } from 'lightning/uiRecordApi';

export default class DatatableDeleteRowForm extends LightningElement {
export default class BaseDatatableDeleteRowForm extends LightningElement {
@api uniqueBoundary;
@api row;
showSpinner = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>51.0</apiVersion>
<apiVersion>52.0</apiVersion>
<isExposed>false</isExposed>
</LightningComponentBundle>
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

import { LightningElement, api } from 'lwc';

export default class DatatableEditRowForm extends LightningElement {
export default class BaseDatatableEditRowForm extends LightningElement {
@api row;
@api objectApiName;
@api uniqueBoundary;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>51.0</apiVersion>
<apiVersion>52.0</apiVersion>
<isExposed>false</isExposed>
</LightningComponentBundle>
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@

import { LightningElement, api } from 'lwc';

const LOOKUP_DISPLAY_NAME = 'lookup-display';
const LOOKUP_EDIT_NAME = 'lookup-edit';
const PICKLIST_DISPLAY_NAME = 'picklist-display';
const PICKLIST_EDIT_NAME = 'picklist-edit';
const LOOKUP_DISPLAY_NAME = 'base-lookup-display';
const LOOKUP_EDIT_NAME = 'base-lookup-edit';
const PICKLIST_DISPLAY_NAME = 'base-picklist-display';
const PICKLIST_EDIT_NAME = 'base-picklist-edit';
const CUSTOM_CELL_DISPLAY_NAMES = [LOOKUP_DISPLAY_NAME, PICKLIST_DISPLAY_NAME];

export default class DatatableEditableCell extends LightningElement {
export default class BaseDatatableEditableCell extends LightningElement {
@api tableBoundary;
@api originalValue;
@api displayCellValueProp;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>51.0</apiVersion>
<apiVersion>52.0</apiVersion>
<isExposed>false</isExposed>
</LightningComponentBundle>
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import customPicklist from './customPicklist.html';
import customLookup from './customLookup.html';
import customFormula from './customFormula.html';

export default class datatableExtension extends LightningDatatable {
export default class BaseDatatableExtension extends LightningDatatable {
static customTypes = {
customName: {
template: customName,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>52.0</apiVersion>
<isExposed>false</isExposed>
</LightningComponentBundle>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
-->

<template>
<c-datatable-formula-cell
<c-base-datatable-formula-cell
is-html-formula={typeAttributes.isHtmlFormula}
value={value}
table-boundary={typeAttributes.tableBoundary}
Expand All @@ -42,5 +42,5 @@
object-api-name={typeAttributes.objectApiName}
column-name={typeAttributes.columnName}
field-api-name={typeAttributes.fieldApiName}
></c-datatable-formula-cell>
></c-base-datatable-formula-cell>
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
-->

<template>
<c-datatable-lookup-cell
<c-base-datatable-lookup-cell
href={typeAttributes.href}
target={typeAttributes.target}
display-value={typeAttributes.displayValue}
Expand All @@ -46,5 +46,5 @@
object-api-name={typeAttributes.objectApiName}
column-name={typeAttributes.columnName}
field-api-name={typeAttributes.fieldApiName}
></c-datatable-lookup-cell>
></c-base-datatable-lookup-cell>
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
-->

<template>
<c-datatable-name-cell
<c-base-datatable-name-cell
href={typeAttributes.href}
target={typeAttributes.target}
value={value}
Expand All @@ -45,5 +45,5 @@
column-name={typeAttributes.columnName}
field-api-name={typeAttributes.fieldApiName}
is-compound-name={typeAttributes.isCompoundName}
></c-datatable-name-cell>
></c-base-datatable-name-cell>
</template>
Loading