Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
tree-shakable customElement replaced by flowElement
Browse files Browse the repository at this point in the history
  • Loading branch information
vikas-cldcvr committed Apr 26, 2024
1 parent af439c9 commit 0fa5443
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { html, unsafeCSS } from "lit";
import { customElement, property } from "lit/decorators.js";
import { property } from "lit/decorators.js";
import type { CheckboxOption, CheckboxOptions } from "../../types";
import eleStyle from "./f-checkbox-group.scss?inline";
import globalStyle from "./f-checkbox-group-global.scss?inline";
Expand All @@ -12,9 +12,10 @@ import { FDiv } from "@ollion/flow-core/src/components/f-div/f-div";
import { FText } from "@ollion/flow-core/src/components/f-text/f-text";
import { FCheckbox } from "@ollion/flow-core/src/components/f-checkbox/f-checkbox";
import { ifDefined } from "lit/directives/if-defined.js";
import { flowElement } from "@ollion/flow-core/src/utils";

injectCss("f-checkbox-group", globalStyle);
@customElement("f-checkbox-group")
@flowElement("f-checkbox-group")
export class FCheckboxGroup extends FRoot {
/**
* css loaded from scss file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { html, nothing, unsafeCSS } from "lit";
import { customElement, property } from "lit/decorators.js";
import { property } from "lit/decorators.js";
import eleStyle from "./f-field-separator.scss?inline";
import globalStyle from "./f-field-separator-global.scss?inline";
import { injectCss } from "@ollion/flow-core-config";
Expand All @@ -8,11 +8,13 @@ import { FDiv } from "@ollion/flow-core/src/components/f-div/f-div";
import { FText } from "@ollion/flow-core/src/components/f-text/f-text";
import { FDivider } from "@ollion/flow-core/src/components/f-divider/f-divider";
import type { FDividerState } from "@ollion/flow-core/src/components/f-divider/f-divider";
import { flowElement } from "@ollion/flow-core/src/utils";

injectCss("f-field-separator", globalStyle);

export type FFieldSeparatorState = FDividerState;

@customElement("f-field-separator")
@flowElement("f-field-separator")
export class FFieldSeparator extends FRoot {
/**
* css loaded from scss file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { html, nothing, PropertyValueMap, unsafeCSS } from "lit";
import { customElement, property, queryAll } from "lit/decorators.js";
import { property, queryAll } from "lit/decorators.js";
import { injectCss } from "@ollion/flow-core-config";
import eleStyle from "./f-form-array.scss?inline";
import type {
Expand All @@ -23,6 +23,7 @@ import globalStyle from "./f-form-array-global.scss?inline";
import { FRoot } from "@ollion/flow-core/src/mixins/components/f-root/f-root";
import { FDiv } from "@ollion/flow-core/src/components/f-div/f-div";
import { FIconButton } from "@ollion/flow-core/src/components/f-icon-button/f-icon-button";
import { flowElement } from "@ollion/flow-core/src/utils";

injectCss("f-form-array", globalStyle);
export type ArrayValueType = (
Expand All @@ -35,7 +36,7 @@ export type ArrayValueType = (
| unknown[]
| undefined
)[];
@customElement("f-form-array")
@flowElement("f-form-array")
export class FFormArray extends FRoot {
/**
* css loaded from scss file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { html, nothing, PropertyValueMap, unsafeCSS } from "lit";
import { customElement, property } from "lit/decorators.js";
import { property } from "lit/decorators.js";
import type {
FormBuilderField,
FFormInputElements,
Expand Down Expand Up @@ -30,10 +30,11 @@ import { cloneDeep, isEqual } from "lodash-es";
import { injectCss } from "@ollion/flow-core-config";
import { ifDefined } from "lit/directives/if-defined.js";
import formArrayGlobalStyles from "./../f-form-array/f-form-array-global.scss?inline";
import { flowElement } from "@ollion/flow-core/src/utils";

injectCss("f-form-builder", globalStyle);

@customElement("f-form-builder")
@flowElement("f-form-builder")
export class FFormBuilder extends FRoot {
/**
* css loaded from scss file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { html, nothing, PropertyValueMap, TemplateResult, unsafeCSS } from "lit";
import { customElement, property, query } from "lit/decorators.js";
import { property, query } from "lit/decorators.js";
import { FRoot } from "@ollion/flow-core/src/mixins/components/f-root/f-root";
import { FDiv } from "@ollion/flow-core/src/components/f-div/f-div";
import eleStyle from "./f-form-object.scss?inline";
Expand All @@ -23,13 +23,14 @@ import { FFieldSeparator } from "../f-field-separator/f-field-separator";
import { radioGroupStyles } from "../f-radio-group/f-radio-group";
import { checkboxGroupStyles } from "../f-checkbox-group/f-checkbox-group";
import { ifDefined } from "lit/directives/if-defined.js";
import { flowElement } from "@ollion/flow-core/src/utils";

export type ObjectValueType = Record<
string,
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
string | string[] | number | number[] | unknown | unknown[] | undefined
>;
@customElement("f-form-object")
@flowElement("f-form-object")
export class FFormObject extends FRoot {
/**
* css loaded from scss file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { html, PropertyValueMap, unsafeCSS } from "lit";
import { customElement, property } from "lit/decorators.js";
import { property } from "lit/decorators.js";
import { RadioOption, RadioOptions } from "../../types";
import eleStyle from "./f-radio-group.scss?inline";
import globalStyle from "./f-radio-group-global.scss?inline";
Expand All @@ -10,14 +10,15 @@ import { FDiv } from "@ollion/flow-core/src/components/f-div/f-div";
import { FText } from "@ollion/flow-core/src/components/f-text/f-text";
import { FRadio } from "@ollion/flow-core/src/components/f-radio/f-radio";
import { ifDefined } from "lit/directives/if-defined.js";
import { flowElement } from "@ollion/flow-core/src/utils";

injectCss("f-checkbox-group", globalStyle);

export const radioGroupStyles = eleStyle;
/**
* @summary Text component includes Headings, titles, body texts and links.
*/
@customElement("f-radio-group")
@flowElement("f-radio-group")
export class FRadioGroup extends FRoot {
/**
* css loaded from scss file
Expand Down
5 changes: 3 additions & 2 deletions packages/flow-lineage/src/components/f-lineage/f-lineage.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { html, PropertyValues, render, unsafeCSS } from "lit";
import { customElement, property, query, queryAssignedElements } from "lit/decorators.js";
import { property, query, queryAssignedElements } from "lit/decorators.js";
import eleStyle from "./f-lineage.scss?inline";
import globalStyle from "./f-lineage-global.scss?inline";
import * as d3 from "d3";
Expand Down Expand Up @@ -29,11 +29,12 @@ import { FText } from "@ollion/flow-core/src/components/f-text/f-text";
import { FIcon } from "@ollion/flow-core/src/components/f-icon/f-icon";
import { FIconButton } from "@ollion/flow-core/src/components/f-icon-button/f-icon-button";
import type { FPopover } from "@ollion/flow-core/src/components/f-popover/f-popover";
import { flowElement } from "@ollion/flow-core/src/utils";

injectCss("f-lineage", globalStyle);
// Renders attribute names of parent element to textContent

@customElement("f-lineage")
@flowElement("f-lineage")
export class FLineage extends FRoot {
/**
* css loaded from scss file
Expand Down

0 comments on commit 0fa5443

Please sign in to comment.