Skip to content

Commit

Permalink
style: bulk reformat with new imports orders
Browse files Browse the repository at this point in the history
That might need fine-tuning though
  • Loading branch information
JulianCataldo committed Dec 27, 2023
1 parent 27bf8e8 commit 7483287
Show file tree
Hide file tree
Showing 61 changed files with 121 additions and 108 deletions.
3 changes: 2 additions & 1 deletion packages/carbon/src/form.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Jsf } from '@jsfe/form';
import * as widgets from './widgets/index.js';

import { styles } from './styles.js';
import * as widgets from './widgets/index.js';

export class JsfCarbon extends Jsf {
public widgets = widgets;
Expand Down
1 change: 0 additions & 1 deletion packages/carbon/src/styles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* STUB */

import { css } from 'lit';

export const styles = css`
Expand Down
3 changes: 2 additions & 1 deletion packages/carbon/src/widgets/object.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { nothing, html } from 'lit';
import { html, nothing } from 'lit';

import type { Widgets } from '@jsfe/types';

import '@carbon/web-components/es/components/form-group/index.js';
Expand Down
32 changes: 16 additions & 16 deletions packages/form/src/json-schema-form.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
/* eslint-disable max-lines */

/* eslint-disable class-methods-use-this */

/* eslint-disable no-underscore-dangle */
// import deepmerge from 'deepmerge';
import set from 'lodash-es/set';

import {
type CSSResult,
LitElement,
html,
unsafeCSS,
type TemplateResult,
type CSSResult,
html,
nothing,
unsafeCSS,
} from 'lit';

import { property, state } from 'lit/decorators.js';
import { createRef, ref } from 'lit/directives/ref.js';

// import deepmerge from 'deepmerge';
import set from 'lodash-es/set';

// import { alternateField } from './triage/alternate.js';
import { fieldArray } from './triage/array.js';
import { fieldObject } from './triage/object.js';
import { fieldPrimitive } from './triage/primitive.js';
import { fieldArrayPrimitive } from './triage/array-primitive.js';

import type {
DataChangeCallback,
FeatureFlags,
JSONSchema7,
OnFormSubmit,
Path,
UiSchema,
Widgets,
JSONSchema7,
} from '@jsfe/types';

import { fieldArrayPrimitive } from './triage/array-primitive.js';
// import { alternateField } from './triage/alternate.js';
import { fieldArray } from './triage/array.js';
import { fieldObject } from './triage/object.js';
import { fieldPrimitive } from './triage/primitive.js';

export class Jsf extends LitElement {
@property({ type: Object }) public schema: JSONSchema7 = {};

Expand All @@ -52,7 +52,7 @@ export class Jsf extends LitElement {

@property({ type: Boolean }) public submitButton = true;

@property({ type: String }) public submitButtonText = 'Submit';
@property({ type: String }) public submitButtonLabel = 'Submit';

@state() private _uiState: unknown = {};

Expand Down Expand Up @@ -129,7 +129,7 @@ export class Jsf extends LitElement {
// return flag('allOf');
}

const nodeParsed = node;
let nodeParsed = node;

// if (currentNode.allOf) {
// node.allOf?.forEach((subSchema) => {
Expand Down
3 changes: 2 additions & 1 deletion packages/form/src/triage/array-primitive.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { html } from 'lit';

import type { JSONSchema7, Path, UiSchema, Widgets } from '@jsfe/types';

import type { Jsf } from '../json-schema-form.js';
import type { Widgets, Path, UiSchema, JSONSchema7 } from '@jsfe/types';

export const fieldArrayPrimitive = (
schema: JSONSchema7,
Expand Down
6 changes: 4 additions & 2 deletions packages/form/src/triage/array.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/* eslint-disable max-lines */

/* eslint-disable arrow-body-style */
import type { JSONSchema7 } from '@jsfe/types';
import { TemplateResult, html } from 'lit';

import type { JSONSchema7 } from '@jsfe/types';
import type { Path, UiSchema, Widgets } from '@jsfe/types';

import type { Jsf } from '../json-schema-form.js';
import type { Widgets, Path, UiSchema } from '@jsfe/types';

export const fieldArray = (
schema: JSONSchema7,
Expand Down
4 changes: 3 additions & 1 deletion packages/form/src/triage/object.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { html } from 'lit';

import type { JSONSchema7 } from '@jsfe/types';
import type { Widgets, Jsf, Path, UiSchema } from '../index.js';

import type { Jsf, Path, UiSchema, Widgets } from '../index.js';

export const fieldObject = (
schema: JSONSchema7,
Expand Down
8 changes: 5 additions & 3 deletions packages/form/src/triage/primitive.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
// import { JsfText } from './../facades/text';
// import { debuggerInline } from './utils.js';

/* eslint-disable arrow-body-style */

/* eslint-disable max-lines */
import { html } from 'lit';

import type { Jsf } from '../json-schema-form.js';
import type { JSONSchema7, Path, UiSchema, Widgets } from '@jsfe/types';

import type { Widgets, Path, UiSchema, JSONSchema7 } from '@jsfe/types';
import { html } from 'lit';
import type { Jsf } from '../json-schema-form.js';

export const fieldPrimitive = (
schema: JSONSchema7,
Expand Down
3 changes: 2 additions & 1 deletion packages/material/src/form.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Jsf } from '@jsfe/form';
import * as widgets from './widgets/index.js';

import { styles } from './styles.js';
import * as widgets from './widgets/index.js';

export class JsfMaterial extends Jsf {
public widgets = widgets;
Expand Down
1 change: 0 additions & 1 deletion packages/material/src/styles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* STUB */

import { css } from 'lit';

export const styles = css`
Expand Down
3 changes: 2 additions & 1 deletion packages/material/src/widgets/array.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { html, nothing } from 'lit';

import type { Widgets } from '@jsfe/types';
import { nothing, html } from 'lit';

import '@material/web/button/outlined-button';

Expand Down
4 changes: 3 additions & 1 deletion packages/material/src/widgets/object.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* eslint-disable arrow-body-style */
import { html, nothing } from 'lit';

import type { Widgets } from '@jsfe/types';
import { nothing, html } from 'lit';

import '@material/web/elevation/elevation.js';

export const object: Widgets['object'] = (options) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/material/src/widgets/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { html } from 'lit';
import type { Widgets } from '@jsfe/types';

import '@material/web/select/outlined-select.js';
import '@material/web/select/select-option.js';
import type { MdOutlinedSelect } from '@material/web/select/outlined-select.js';
import '@material/web/select/select-option.js';

export const select: Widgets['select'] = (options) => html`
<md-outlined-select
Expand Down
3 changes: 2 additions & 1 deletion packages/shoelace/src/form.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Jsf } from '@jsfe/form';
import * as widgets from './widgets/index.js';

import { styles } from './styles.js';
import * as widgets from './widgets/index.js';

export class JsfShoelace extends Jsf {
public widgets = widgets;
Expand Down
1 change: 0 additions & 1 deletion packages/shoelace/src/styles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* STUB */

import { css } from 'lit';

export const styles = css`
Expand Down
2 changes: 1 addition & 1 deletion packages/shoelace/src/widgets/array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
// import '@shoelace-style/shoelace/dist/components/divider/divider.js';
// import '@shoelace-style/shoelace/dist/components/button-group/button-group.js';
// import '@shoelace-style/shoelace/dist/components/tooltip/tooltip.js';
import { html, nothing } from 'lit';

import type { Widgets } from '@jsfe/types';
import { nothing, html } from 'lit';

import '@shoelace-style/shoelace/dist/components/card/card.js';
import '@shoelace-style/shoelace/dist/components/tag/tag.js';
Expand Down
6 changes: 3 additions & 3 deletions packages/shoelace/src/widgets/button-group-boolean.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { html } from 'lit';
// import { ifDefined } from 'lit/directives/if-defined.js';

// import { ifDefined } from 'lit/directives/if-defined.js';
import type { Widgets } from '@jsfe/types';

import '@shoelace-style/shoelace/dist/components/radio-group/radio-group.js';
import '@shoelace-style/shoelace/dist/components/radio-button/radio-button.js';
import type { SlRadioGroup } from '@shoelace-style/shoelace';
import '@shoelace-style/shoelace/dist/components/radio-button/radio-button.js';
import '@shoelace-style/shoelace/dist/components/radio-group/radio-group.js';

export const buttonGroupBoolean: Widgets['buttonGroupBoolean'] = (
options,
Expand Down
6 changes: 3 additions & 3 deletions packages/shoelace/src/widgets/button-group.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { html } from 'lit';
// import { ifDefined } from 'lit/directives/if-defined.js';

// import { ifDefined } from 'lit/directives/if-defined.js';
import type { Widgets } from '@jsfe/types';

import '@shoelace-style/shoelace/dist/components/radio-group/radio-group.js';
import '@shoelace-style/shoelace/dist/components/radio-button/radio-button.js';
import type { SlRadioGroup } from '@shoelace-style/shoelace';
import '@shoelace-style/shoelace/dist/components/radio-button/radio-button.js';
import '@shoelace-style/shoelace/dist/components/radio-group/radio-group.js';

export const buttonGroup: Widgets['buttonGroup'] = (options) => html`
<sl-radio-group
Expand Down
2 changes: 1 addition & 1 deletion packages/shoelace/src/widgets/checkbox-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { html, nothing } from 'lit';

import type { Widgets } from '@jsfe/types';

import '@shoelace-style/shoelace/dist/components/checkbox/checkbox.js';
import type { SlCheckbox } from '@shoelace-style/shoelace';
import '@shoelace-style/shoelace/dist/components/checkbox/checkbox.js';

export const checkboxGroup: Widgets['checkboxGroup'] = (options) => html`
<fieldset
Expand Down
2 changes: 1 addition & 1 deletion packages/shoelace/src/widgets/checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { ifDefined } from 'lit/directives/if-defined.js';

import type { Widgets } from '@jsfe/types';

import '@shoelace-style/shoelace/dist/components/input/input.js';
import type { SlCheckbox } from '@shoelace-style/shoelace';
import '@shoelace-style/shoelace/dist/components/input/input.js';

export const checkbox: Widgets['checkbox'] = (options) => html`
<div class="theme-shoelace widget-checkbox">
Expand Down
2 changes: 1 addition & 1 deletion packages/shoelace/src/widgets/color-picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { html } from 'lit';

import type { Widgets } from '@jsfe/types';

import '@shoelace-style/shoelace/dist/components/color-picker/color-picker.js';
import type { SlColorPicker } from '@shoelace-style/shoelace';
import '@shoelace-style/shoelace/dist/components/color-picker/color-picker.js';

export const colorPicker: Widgets['colorPicker'] = (options) => html`
<div class="theme-shoelace widget-color-picker">
Expand Down
4 changes: 2 additions & 2 deletions packages/shoelace/src/widgets/date.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { html } from 'lit';
// import { ifDefined } from 'lit/directives/if-defined.js';

// import { ifDefined } from 'lit/directives/if-defined.js';
import type { Widgets } from '@jsfe/types';

import '@shoelace-style/shoelace/dist/components/input/input.js';
import type { SlInput } from '@shoelace-style/shoelace';
import '@shoelace-style/shoelace/dist/components/input/input.js';

export const date: Widgets['date'] = (options) => html`
<sl-input
Expand Down
2 changes: 1 addition & 1 deletion packages/shoelace/src/widgets/number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { ifDefined } from 'lit/directives/if-defined.js';

import type { Widgets } from '@jsfe/types';

import '@shoelace-style/shoelace/dist/components/input/input.js';
import type { SlInput } from '@shoelace-style/shoelace';
import '@shoelace-style/shoelace/dist/components/input/input.js';

export const number: Widgets['number'] = (options) =>
html` <!-- -->
Expand Down
2 changes: 1 addition & 1 deletion packages/shoelace/src/widgets/object.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { nothing, html } from 'lit';
import { html, nothing } from 'lit';

import type { Widgets } from '@jsfe/types';

Expand Down
4 changes: 2 additions & 2 deletions packages/shoelace/src/widgets/radio-group-boolean.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { html } from 'lit';
// import { ifDefined } from 'lit/directives/if-defined.js';

// import { ifDefined } from 'lit/directives/if-defined.js';
import type { Widgets } from '@jsfe/types';

import type { SlRadioGroup } from '@shoelace-style/shoelace';
import '@shoelace-style/shoelace/dist/components/radio-group/radio-group.js';
import '@shoelace-style/shoelace/dist/components/radio/radio.js';
import type { SlRadioGroup } from '@shoelace-style/shoelace';

export const radioGroupBoolean: Widgets['radioGroupBoolean'] = (
options,
Expand Down
4 changes: 2 additions & 2 deletions packages/shoelace/src/widgets/radio-group.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { html } from 'lit';
// import { ifDefined } from 'lit/directives/if-defined.js';

// import { ifDefined } from 'lit/directives/if-defined.js';
import type { Widgets } from '@jsfe/types';

import type { SlRadioGroup } from '@shoelace-style/shoelace';
import '@shoelace-style/shoelace/dist/components/radio-group/radio-group.js';
import '@shoelace-style/shoelace/dist/components/radio/radio.js';
import type { SlRadioGroup } from '@shoelace-style/shoelace';

export const radioGroup: Widgets['radioGroup'] = (options) => html`
<sl-radio-group
Expand Down
2 changes: 1 addition & 1 deletion packages/shoelace/src/widgets/range.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { ifDefined } from 'lit/directives/if-defined.js';

import type { Widgets } from '@jsfe/types';

import '@shoelace-style/shoelace/dist/components/range/range.js';
import type { SlRange } from '@shoelace-style/shoelace';
import '@shoelace-style/shoelace/dist/components/range/range.js';

export const range: Widgets['number'] = (options) =>
html` <!-- -->
Expand Down
2 changes: 1 addition & 1 deletion packages/shoelace/src/widgets/rating.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { ifDefined } from 'lit/directives/if-defined.js';

import type { Widgets } from '@jsfe/types';

import '@shoelace-style/shoelace/dist/components/rating/rating.js';
import type { SlRating } from '@shoelace-style/shoelace';
import '@shoelace-style/shoelace/dist/components/rating/rating.js';

export const rating: Widgets['number'] = (options) =>
html`<!-- -->
Expand Down
2 changes: 1 addition & 1 deletion packages/shoelace/src/widgets/select-multiple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { html } from 'lit';

import type { Widgets } from '@jsfe/types';

import '@shoelace-style/shoelace/dist/components/select/select.js';
import type { SlSelect, SlSelectEvent } from '@shoelace-style/shoelace';
import '@shoelace-style/shoelace/dist/components/select/select.js';

export const selectMultiple: Widgets['selectMultiple'] = (options) => html`
<sl-select
Expand Down
4 changes: 2 additions & 2 deletions packages/shoelace/src/widgets/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { ifDefined } from 'lit/directives/if-defined.js';

import type { Widgets } from '@jsfe/types';

import '@shoelace-style/shoelace/dist/components/select/select.js';
import '@shoelace-style/shoelace/dist/components/option/option.js';
import type { SlSelect } from '@shoelace-style/shoelace';
import '@shoelace-style/shoelace/dist/components/option/option.js';
import '@shoelace-style/shoelace/dist/components/select/select.js';

export const select: Widgets['select'] = (options) => html`
<sl-select
Expand Down
4 changes: 2 additions & 2 deletions packages/shoelace/src/widgets/switch.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { html, nothing } from 'lit';
// import { ifDefined } from 'lit/directives/if-defined.js';

// import { ifDefined } from 'lit/directives/if-defined.js';
import type { Widgets } from '@jsfe/types';

import '@shoelace-style/shoelace/dist/components/switch/switch.js';
import type { SlSwitch } from '@shoelace-style/shoelace';
import '@shoelace-style/shoelace/dist/components/switch/switch.js';

export const switchh: Widgets['switch'] = (options) => html`
<sl-switch
Expand Down
2 changes: 1 addition & 1 deletion packages/shoelace/src/widgets/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { ifDefined } from 'lit/directives/if-defined.js';

import type { Widgets } from '@jsfe/types';

import '@shoelace-style/shoelace/dist/components/input/input.js';
import type { SlInput } from '@shoelace-style/shoelace';
import '@shoelace-style/shoelace/dist/components/input/input.js';

export const text: Widgets['text'] = (options) => html`
<!-- ${options.pattern} -->
Expand Down
Loading

0 comments on commit 7483287

Please sign in to comment.