Skip to content

Commit

Permalink
chore(mixin): import carbon-components mixin (carbon-design-system#…
Browse files Browse the repository at this point in the history
…10400)

* chore(mixin): import carbon-component into package

* chore(deps): bump package version to beta.2
  • Loading branch information
kennylam authored Apr 26, 2023
1 parent 0a29746 commit 8dccf53
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 12 deletions.
2 changes: 1 addition & 1 deletion web-components/packages/carbon-web-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@carbon/web-components",
"version": "2.0.0-beta.1",
"version": "2.0.0-beta.2",
"publishConfig": {
"access": "public"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import { Instance as FlatpickrInstance } from 'flatpickr/dist/types/instance';
import { Plugin } from 'flatpickr/dist/types/options';
import on from 'carbon-components/es/globals/js/misc/on';
import on from '../../globals/mixins/on';
import Handle from '../../globals/internal/handle';
import CDSDatePickerInput from './date-picker-input';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import { Instance as FlatpickrInstance } from 'flatpickr/dist/types/instance';
import { Plugin } from 'flatpickr/dist/types/options';
import on from 'carbon-components/es/globals/js/misc/on';
import on from '../../globals/mixins/on';
import Handle from '../../globals/internal/handle';
import CDSDatePickerInput from './date-picker-input';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import { Instance as FlatpickrInstance } from 'flatpickr/dist/types/instance';
import { Plugin } from 'flatpickr/dist/types/options';
import on from 'carbon-components/es/globals/js/misc/on';
import on from '../../globals/mixins/on';
import Handle from '../../globals/internal/handle';
import { find } from '../../globals/internal/collection-helpers';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import { LitElement, html } from 'lit';
import { property, customElement } from 'lit/decorators.js';
import on from 'carbon-components/es/globals/js/misc/on';
import on from '../../globals/mixins/on';
import { prefix } from '../../globals/settings';
import HostListenerMixin from '../../globals/mixins/host-listener';
import HostListener from '../../globals/decorators/host-listener';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* @license
*
* Copyright IBM Corp. 2019, 2022
* Copyright IBM Corp. 2019, 2023
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import on from 'carbon-components/es/globals/js/misc/on';
import on from './on';
import Handle from '../internal/handle';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* @license
*
* Copyright IBM Corp. 2019, 2022
* Copyright IBM Corp. 2019, 2023
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import on from 'carbon-components/es/globals/js/misc/on';
import on from './on';
import Handle from '../internal/handle';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* Copyright IBM Corp. 2016, 2023
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

export default function on(element: any, ...args: any) {
element.addEventListener(...args);
return {
release() {
element.removeEventListener(...args);
return null;
},
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import React, { Component, createElement, forwardRef } from 'react';
import on from 'carbon-components/es/globals/js/misc/on';
import on from '../mixins/on';
import Handle from '../internal/handle';

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* @license
*
* Copyright IBM Corp. 2019, 2022
* Copyright IBM Corp. 2019, 2023
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import on from 'carbon-components/es/globals/js/misc/on';
import on from '../../src/globals/mixins/on';
import Handle from '../../src/globals/internal/handle';

interface CustomEventListener {
Expand Down

0 comments on commit 8dccf53

Please sign in to comment.