Skip to content

Instantly share code, notes, and snippets.

View lukaszhanusik's full-sized avatar
✨👁️🖤👁️✨ ⚡️

Lukasz Hanusik lukaszhanusik

✨👁️🖤👁️✨ ⚡️
View GitHub Profile
@lukaszhanusik
lukaszhanusik / group-objects-by-property.md
Created September 22, 2021 05:17 — forked from mikaello/group-objects-by-property.md
Group Array of JavaScript Objects by Key or Property Value

Group array of JavaScript objects by keys

This fork of JamieMason's implementation changes the key parameter to be an array of keys instead of just a single key. This makes it possible to group by multiple properties instead of just one.

Implementation

const groupBy = keys => array =>
  array.reduce((objectsByKeyValue, obj) => {
    const value = keys.map(key => obj[key]).join('-');
@lukaszhanusik
lukaszhanusik / README.md
Created September 1, 2021 07:43 — forked from nolanlawson/README.md
Repro Chrome style recalc issue

repro-recalc

Minimal repro for the Chrome style recalc issue.

@lukaszhanusik
lukaszhanusik / auraStyleTokenVariables.md
Last active August 30, 2021 04:10
Aura Design Style Tokens and Variables

Component.cmp

<aura:attribute name="width" type="Integer" default="50" />
<aura:html tag="style">
    :host {
        --width: {!v.width}%;
    }
</aura:html>
@lukaszhanusik
lukaszhanusik / auraWorkspaceApiMethods.js
Last active August 18, 2021 12:33
AURA Workspace API Methods
({ /*
JWaggoner:
This was merely to understand the idea of adding a background utility.
I may keep using this to try and probe how to reach different objects or figure out how to do things.
*/
onTabCreated: function (component) {
var workspaceAPI = component.find("workspace");
workspaceAPI.getAllTabInfo().then(function (tabInfo) {
@lukaszhanusik
lukaszhanusik / lwcBaseHelptext.md
Last active August 17, 2021 17:20
LWC Custom Helptext Popover Component

Base Helptext

<div class="slds-form-element__icon">
    <button class="slds-button slds-button_icon">
        <lightning-icon size="xx-small" icon-name="utility:info" alternative-text="Tooltip" 
            data-popover-id="tooltipSc1" onmouseover={handleOpenPopover}>
        </lightning-icon>
    </button>
 
@lukaszhanusik
lukaszhanusik / lwcPopoverDoc.md
Last active January 25, 2024 21:06
LWC Popover Docs

Popover Component

Configuration

The list of SLDS components exceeds the LWC component library by a long distance. There are many awesome component blueprints defined in SLDS which are not available in LWC library. This comes in as a challenge during implementation. SLDS only provides the plain HTML without working implementation whereas LWC components are fully functional and can be used readily.

One such component in SLDS is Popover. This does not have a corresponding component in LWC library. As an attempt to create a working SLDS Popover, I have created this utility. The Popover would comprise of three sections i.e. header, body and footer. The component is built on LWC .

To keep the configuration about the component, it takes following parameters:

@lukaszhanusik
lukaszhanusik / lwcBaseScopedNotifications
Last active August 11, 2021 21:48
LWC Scope Notifications Receipies
‎‎​
@lukaszhanusik
lukaszhanusik / lwcPopover
Last active August 11, 2021 21:34
Base Popover
Snippets on Popover
@lukaszhanusik
lukaszhanusik / lwcLwcDomManualInnerHtml.md
Last active August 11, 2021 03:55
LWC LWD:DOM MANUAL set inner html

LWC DOM Manual

Render HTML markup dynamically

Html Template

<!-- LWC:DOM MANUAL -->
<div lwc:dom="manual" class="slds-var-p-around_x-small slds-scrollable_y templatePreviewMarkup">
 
@lukaszhanusik
lukaszhanusik / auraShowCustomModalCreateComponents.js
Created August 10, 2021 07:09
Overlay showCustomModal CreateComponents
handleCreateModal: function (component, event, helper) {
let modalHeader;
let modalBody;
let modalFooter;
$A.createComponents([
["c:UWB_modalHeader", { 'label': 'Approve' }],
["c:UWB_utilityModal", { 'modalName': 'approve', 'approvalId': data.proccessInstanceToPiwi[data.approvalHistory[0].ProcessInstanceId], 'relatedObject': recordData }],
["c:UWB_modalFooter", { 'cancelLabel': 'Cancel', 'submitLabel': 'Approve' }]
],
function (components, status) {