chore: introduce a component src folder

This commit is contained in:
Thomas Allmer 2022-10-31 15:47:48 +01:00 committed by Thomas Allmer
parent 8114bae86f
commit d938e464b4
231 changed files with 160 additions and 245 deletions

View file

@ -11,3 +11,4 @@ patches/
/docs/_assets/scoped-custom-element-registry.min.js /docs/_assets/scoped-custom-element-registry.min.js
/docs/_assets/scoped-custom-element-registry.min.js.map /docs/_assets/scoped-custom-element-registry.min.js.map
/docs/_merged_assets/scoped-custom-element-registry.min.js

View file

@ -1,3 +0,0 @@
export { CalendarObject } from './test-helpers/CalendarObject.js';
export { DayObject } from './test-helpers/DayObject.js';
export { weekdayNames } from './test-helpers/weekdayNames.js';

View file

@ -5,7 +5,7 @@ import { expect, fixture as _fixture } from '@open-wc/testing';
import sinon from 'sinon'; import sinon from 'sinon';
import '@lion/ui/define/lion-calendar.js'; import '@lion/ui/define/lion-calendar.js';
import { isSameDate } from '@lion/ui/calendar.js'; import { isSameDate } from '@lion/ui/calendar.js';
import { CalendarObject, DayObject } from '../test-helpers.js'; import { CalendarObject, DayObject } from '@lion/ui/calendar-test-helpers.js';
/** /**
* @typedef {import('../src/LionCalendar').LionCalendar} LionCalendar * @typedef {import('../src/LionCalendar').LionCalendar} LionCalendar

View file

@ -1,6 +1,6 @@
import { expect } from '@open-wc/testing'; import { expect } from '@open-wc/testing';
import { createMonth } from '../../utils/createMonth.js'; import { createMonth } from '../../src/utils/createMonth.js';
import { createWeek } from '../../utils/createWeek.js'; import { createWeek } from '../../src/utils/createWeek.js';
/** /**
* @param {import('../../types/day').Month} obj * @param {import('../../types/day').Month} obj

View file

@ -1,6 +1,6 @@
import { expect } from '@open-wc/testing'; import { expect } from '@open-wc/testing';
import { createMultipleMonth } from '../../utils/createMultipleMonth.js'; import { createMultipleMonth } from '../../src/utils/createMultipleMonth.js';
import { createMonth } from '../../utils/createMonth.js'; import { createMonth } from '../../src/utils/createMonth.js';
/** /**
* @param {{ months: import('../../types/day').Month[]}} obj * @param {{ months: import('../../types/day').Month[]}} obj

View file

@ -1,6 +1,6 @@
import { expect } from '@open-wc/testing'; import { expect } from '@open-wc/testing';
import { createWeek } from '../../utils/createWeek.js'; import { createWeek } from '../../src/utils/createWeek.js';
import { createDay } from '../../utils/createDay.js'; import { createDay } from '../../src/utils/createDay.js';
/** /**
* @param {import('../../types/day').Week} obj * @param {import('../../types/day').Week} obj

View file

@ -1,9 +1,9 @@
/* eslint-disable no-unused-expressions */ /* eslint-disable no-unused-expressions */
import { expect, fixture } from '@open-wc/testing'; import { expect, fixture } from '@open-wc/testing';
import { createMultipleMonth } from '../../utils/createMultipleMonth.js'; import { weekdayNames } from '@lion/ui/calendar-test-helpers.js';
import { dataTemplate } from '../../utils/dataTemplate.js'; import { createMultipleMonth } from '../../src/utils/createMultipleMonth.js';
import { weekdayNames } from '../../test-helpers.js'; import { dataTemplate } from '../../src/utils/dataTemplate.js';
// eslint-disable-next-line camelcase // eslint-disable-next-line camelcase
import snapshot_enGB_Sunday_201812 from './snapshots/monthTemplate_en-GB_Sunday_2018-12.js'; import snapshot_enGB_Sunday_201812 from './snapshots/monthTemplate_en-GB_Sunday_2018-12.js';

View file

@ -1,7 +1,7 @@
/* eslint-disable no-unused-expressions */ /* eslint-disable no-unused-expressions */
import { expect, fixture } from '@open-wc/testing'; import { expect, fixture } from '@open-wc/testing';
import { createDay } from '../../utils/createDay.js'; import { createDay } from '../../src/utils/createDay.js';
import { dayTemplate } from '../../utils/dayTemplate.js'; import { dayTemplate } from '../../src/utils/dayTemplate.js';
const weekdays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; const weekdays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];

View file

@ -1,6 +1,6 @@
import { expect } from '@open-wc/testing'; import { expect } from '@open-wc/testing';
import { isSameDate } from '@lion/ui/calendar.js'; import { isSameDate } from '@lion/ui/calendar.js';
import { getFirstDayNextMonth } from '../../utils/getFirstDayNextMonth.js'; import { getFirstDayNextMonth } from '../../src/utils/getFirstDayNextMonth.js';
describe('getFirstDayNextMonth', () => { describe('getFirstDayNextMonth', () => {
it('returns the first day of the next month', () => { it('returns the first day of the next month', () => {

View file

@ -1,6 +1,6 @@
import { expect } from '@open-wc/testing'; import { expect } from '@open-wc/testing';
import { isSameDate } from '@lion/ui/calendar.js'; import { isSameDate } from '@lion/ui/calendar.js';
import { getLastDayPreviousMonth } from '../../utils/getLastDayPreviousMonth.js'; import { getLastDayPreviousMonth } from '../../src/utils/getLastDayPreviousMonth.js';
describe('getLastDayPreviousMonth', () => { describe('getLastDayPreviousMonth', () => {
it('returns the last day of the previous month', () => { it('returns the last day of the previous month', () => {

View file

@ -1 +0,0 @@
export { LionCollapsible } from "./src/LionCollapsible.js";

View file

@ -1,86 +0,0 @@
export {
html,
CSSResult,
adoptStyles,
css,
getCompatibleStyle,
supportsAdoptingStyleSheets,
unsafeCSS,
UpdatingElement,
notEqual,
ReactiveElement,
svg,
noChange,
nothing,
render,
RenderOptions,
LitElement,
defaultConverter,
CSSResultArray,
PropertyValues,
TemplateResult,
} from 'lit';
export {
customElement,
property,
state,
eventOptions,
query,
queryAll,
queryAsync,
queryAssignedNodes,
} from 'lit/decorators.js';
export {
AttributePart,
BooleanAttributePart,
ChildPart,
ElementPart,
EventPart,
Part,
PartType,
directive,
Directive,
DirectiveResult,
} from 'lit/directive.js';
export { AsyncDirective } from 'lit/async-directive.js';
export {
isPrimitive,
TemplateResultType,
isTemplateResult,
isDirectiveResult,
getDirectiveClass,
isSingleExpression,
insertPart,
setChildPartValue,
setCommittedValue,
getCommittedValue,
removePart,
clearPart,
} from 'lit/directive-helpers.js';
export { asyncAppend } from 'lit/directives/async-append.js';
export { asyncReplace } from 'lit/directives/async-replace.js';
export { cache } from 'lit/directives/cache.js';
export { classMap } from 'lit/directives/class-map.js';
export { guard } from 'lit/directives/guard.js';
export { ifDefined } from 'lit/directives/if-defined.js';
export { repeat } from 'lit/directives/repeat.js';
export { styleMap } from 'lit/directives/style-map.js';
export { unsafeHTML } from 'lit/directives/unsafe-html.js';
export { until } from 'lit/directives/until.js';
// open-wc
export { ScopedElementsMixin } from '@open-wc/scoped-elements';
export { dedupeMixin } from '@open-wc/dedupe-mixin';
// ours
export { DisabledMixin } from './src/DisabledMixin.js';
export { DisabledWithTabIndexMixin } from './src/DisabledWithTabIndexMixin.js';
export { ScopedStylesController } from './src/ScopedStylesController.js';
export { SlotMixin } from './src/SlotMixin.js';
export { browserDetection } from './src/browserDetection.js';
export { EventTargetShim } from './src/EventTargetShim.js';
export { uuid } from './src/uuid.js';

View file

@ -4,7 +4,7 @@ import '@lion/ui/define/lion-dialog.js';
/** /**
* @typedef {import('../LionDialog').LionDialog} LionDialog * @typedef {import('../src/LionDialog').LionDialog} LionDialog
* @typedef {import('@lion/core').TemplateResult} TemplateResult * @typedef {import('@lion/core').TemplateResult} TemplateResult
*/ */
const fixture = /** @type {(arg: TemplateResult) => Promise<LionDialog>} */ (_fixture); const fixture = /** @type {(arg: TemplateResult) => Promise<LionDialog>} */ (_fixture);

View file

@ -1,7 +1,7 @@
import { LitElement } from 'lit'; import { LitElement } from 'lit';
import { defineCE, expect, fixture, fixtureSync, html, unsafeStatic } from '@open-wc/testing'; import { defineCE, expect, fixture, fixtureSync, html, unsafeStatic } from '@open-wc/testing';
import sinon from 'sinon'; import sinon from 'sinon';
import { SyncUpdatableMixin } from '../../utils/SyncUpdatableMixin.js'; import { SyncUpdatableMixin } from '../../src/utils/SyncUpdatableMixin.js';
describe('SyncUpdatableMixin', () => { describe('SyncUpdatableMixin', () => {
describe('Until firstUpdated', () => { describe('Until firstUpdated', () => {

View file

@ -2,7 +2,7 @@ import { expect, fixture } from '@open-wc/testing';
import { html } from 'lit/static-html.js'; import { html } from 'lit/static-html.js';
import sinon from 'sinon'; import sinon from 'sinon';
import { browserDetection } from '@lion/ui/core.js'; import { browserDetection } from '@lion/ui/core.js';
import { getAriaElementsInRightDomOrder } from '../../utils/getAriaElementsInRightDomOrder.js'; import { getAriaElementsInRightDomOrder } from '../../src/utils/getAriaElementsInRightDomOrder.js';
describe('getAriaElementsInRightDomOrder', () => { describe('getAriaElementsInRightDomOrder', () => {
it('orders by putting preceding siblings and local parents first', async () => { it('orders by putting preceding siblings and local parents first', async () => {

View file

@ -1,6 +1,6 @@
import { expect } from '@open-wc/testing'; import { expect } from '@open-wc/testing';
import { html } from 'lit'; import { html } from 'lit';
import { renderLitAsNode } from '../renderLitAsNode.js'; import { renderLitAsNode } from '../src/renderLitAsNode.js';
describe('renderLitAsNode', () => { describe('renderLitAsNode', () => {
it('should return a matching HTMLElement (Node)', () => { it('should return a matching HTMLElement (Node)', () => {

Some files were not shown because too many files have changed in this diff Show more