Skip to content

Commit

Permalink
fix gts
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Pircher <[email protected]>
  • Loading branch information
patricklx committed Mar 15, 2024
1 parent edc200a commit e70e7b5
Show file tree
Hide file tree
Showing 23 changed files with 350 additions and 277 deletions.
2 changes: 1 addition & 1 deletion carbon-components-ember/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module.exports = {
root: true,
parser: '@babel/eslint-parser',
parser: 'ember-eslint-parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
Expand Down
1 change: 1 addition & 0 deletions carbon-components-ember/.prettierrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
module.exports = {
plugins: ['prettier-plugin-ember-template-tag'],
singleQuote: true,
endOfLine: "lf"
};
116 changes: 58 additions & 58 deletions carbon-components-ember/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-qunit": "^7.3.4",
"loader.js": "^4.7.0",
"prettier": "^3.0.3",
"prettier-plugin-ember-template-tag": "^1.1.0",
"prettier": "^3.2.5",
"prettier-plugin-ember-template-tag": "^2.0.0",
"qunit": "^2.19.4",
"qunit-dom": "^2.0.0",
"release-it": "^15.10.3",
Expand All @@ -195,66 +195,66 @@
"type": "addon",
"main": "addon-main.cjs",
"app-js": {
"./components/accordion/index.js": "./dist/_app_/components/accordion/index.js",
"./components/breadcrumbs/index.js": "./dist/_app_/components/breadcrumbs/index.js",
"./components/button/index.js": "./dist/_app_/components/button/index.js",
"./components/charts/-components/axis/index.js": "./dist/_app_/components/charts/-components/axis/index.js",
"./components/charts/-components/chart/index.js": "./dist/_app_/components/charts/-components/chart/index.js",
"./components/charts/-components/color/pairing/index.js": "./dist/_app_/components/charts/-components/color/pairing/index.js",
"./components/charts/-components/color/scale/index.js": "./dist/_app_/components/charts/-components/color/scale/index.js",
"./components/charts/-components/tabular-data/index.js": "./dist/_app_/components/charts/-components/tabular-data/index.js",
"./components/accordion.js": "./dist/_app_/components/accordion.js",
"./components/breadcrumbs.js": "./dist/_app_/components/breadcrumbs.js",
"./components/button.js": "./dist/_app_/components/button.js",
"./components/charts/-components/axis.js": "./dist/_app_/components/charts/-components/axis.js",
"./components/charts/-components/chart.js": "./dist/_app_/components/charts/-components/chart.js",
"./components/charts/-components/color/pairing.js": "./dist/_app_/components/charts/-components/color/pairing.js",
"./components/charts/-components/color/scale.js": "./dist/_app_/components/charts/-components/color/scale.js",
"./components/charts/-components/tabular-data.js": "./dist/_app_/components/charts/-components/tabular-data.js",
"./components/charts/-helpers/on-update.js": "./dist/_app_/components/charts/-helpers/on-update.js",
"./components/charts/-helpers/to-bool.js": "./dist/_app_/components/charts/-helpers/to-bool.js",
"./components/charts/bar/index.js": "./dist/_app_/components/charts/bar/index.js",
"./components/charts/line/index.js": "./dist/_app_/components/charts/line/index.js",
"./components/charts/pie/index.js": "./dist/_app_/components/charts/pie/index.js",
"./components/checkbox/index.js": "./dist/_app_/components/checkbox/index.js",
"./components/code-snippet/index.js": "./dist/_app_/components/code-snippet/index.js",
"./components/copy-button/index.js": "./dist/_app_/components/copy-button/index.js",
"./components/data-table/-body/index.js": "./dist/_app_/components/data-table/-body/index.js",
"./components/data-table/-column/index.js": "./dist/_app_/components/data-table/-column/index.js",
"./components/data-table/-header/index.js": "./dist/_app_/components/data-table/-header/index.js",
"./components/data-table/-menu/index.js": "./dist/_app_/components/data-table/-menu/index.js",
"./components/data-table/-row/index.js": "./dist/_app_/components/data-table/-row/index.js",
"./components/data-table/-search-input/index.js": "./dist/_app_/components/data-table/-search-input/index.js",
"./components/data-table/-skeleton/index.js": "./dist/_app_/components/data-table/-skeleton/index.js",
"./components/data-table/-table/index.js": "./dist/_app_/components/data-table/-table/index.js",
"./components/data-table/-toolbar/-actions/index.js": "./dist/_app_/components/data-table/-toolbar/-actions/index.js",
"./components/data-table/-toolbar/-content/index.js": "./dist/_app_/components/data-table/-toolbar/-content/index.js",
"./components/data-table/-toolbar/index.js": "./dist/_app_/components/data-table/-toolbar/index.js",
"./components/data-table/index.js": "./dist/_app_/components/data-table/index.js",
"./components/dialogs/confirm/index.js": "./dist/_app_/components/dialogs/confirm/index.js",
"./components/form-input/index.js": "./dist/_app_/components/form-input/index.js",
"./components/icon/index.js": "./dist/_app_/components/icon/index.js",
"./components/charts/bar.js": "./dist/_app_/components/charts/bar.js",
"./components/charts/line.js": "./dist/_app_/components/charts/line.js",
"./components/charts/pie.js": "./dist/_app_/components/charts/pie.js",
"./components/checkbox.js": "./dist/_app_/components/checkbox.js",
"./components/code-snippet.js": "./dist/_app_/components/code-snippet.js",
"./components/copy-button.js": "./dist/_app_/components/copy-button.js",
"./components/data-table.js": "./dist/_app_/components/data-table.js",
"./components/data-table/-body.js": "./dist/_app_/components/data-table/-body.js",
"./components/data-table/-column.js": "./dist/_app_/components/data-table/-column.js",
"./components/data-table/-header.js": "./dist/_app_/components/data-table/-header.js",
"./components/data-table/-menu.js": "./dist/_app_/components/data-table/-menu.js",
"./components/data-table/-row.js": "./dist/_app_/components/data-table/-row.js",
"./components/data-table/-search-input.js": "./dist/_app_/components/data-table/-search-input.js",
"./components/data-table/-skeleton.js": "./dist/_app_/components/data-table/-skeleton.js",
"./components/data-table/-table.js": "./dist/_app_/components/data-table/-table.js",
"./components/data-table/-toolbar.js": "./dist/_app_/components/data-table/-toolbar.js",
"./components/data-table/-toolbar/-actions.js": "./dist/_app_/components/data-table/-toolbar/-actions.js",
"./components/data-table/-toolbar/-content.js": "./dist/_app_/components/data-table/-toolbar/-content.js",
"./components/dialogs/confirm.js": "./dist/_app_/components/dialogs/confirm.js",
"./components/form-input.js": "./dist/_app_/components/form-input.js",
"./components/icon.js": "./dist/_app_/components/icon.js",
"./components/icon/render-svg-part.js": "./dist/_app_/components/icon/render-svg-part.js",
"./components/list/-body/index.js": "./dist/_app_/components/list/-body/index.js",
"./components/list/-column/index.js": "./dist/_app_/components/list/-column/index.js",
"./components/list/-header/index.js": "./dist/_app_/components/list/-header/index.js",
"./components/list/-row/index.js": "./dist/_app_/components/list/-row/index.js",
"./components/list/-skeleton/index.js": "./dist/_app_/components/list/-skeleton/index.js",
"./components/list/index.js": "./dist/_app_/components/list/index.js",
"./components/loading/index.js": "./dist/_app_/components/loading/index.js",
"./components/menu/-item/index.js": "./dist/_app_/components/menu/-item/index.js",
"./components/menu/index.js": "./dist/_app_/components/menu/index.js",
"./components/modal/index.js": "./dist/_app_/components/modal/index.js",
"./components/notification/index.js": "./dist/_app_/components/notification/index.js",
"./components/pagination/index.js": "./dist/_app_/components/pagination/index.js",
"./components/progress-bar/index.js": "./dist/_app_/components/progress-bar/index.js",
"./components/list.js": "./dist/_app_/components/list.js",
"./components/list/-body.js": "./dist/_app_/components/list/-body.js",
"./components/list/-column.js": "./dist/_app_/components/list/-column.js",
"./components/list/-header.js": "./dist/_app_/components/list/-header.js",
"./components/list/-row.js": "./dist/_app_/components/list/-row.js",
"./components/list/-skeleton.js": "./dist/_app_/components/list/-skeleton.js",
"./components/loading.js": "./dist/_app_/components/loading.js",
"./components/menu.js": "./dist/_app_/components/menu.js",
"./components/menu/-item.js": "./dist/_app_/components/menu/-item.js",
"./components/modal.js": "./dist/_app_/components/modal.js",
"./components/notification.js": "./dist/_app_/components/notification.js",
"./components/pagination.js": "./dist/_app_/components/pagination.js",
"./components/progress-bar.js": "./dist/_app_/components/progress-bar.js",
"./components/radio.js": "./dist/_app_/components/radio.js",
"./components/radio/group.js": "./dist/_app_/components/radio/group.js",
"./components/radio/index.js": "./dist/_app_/components/radio/index.js",
"./components/search-input/index.js": "./dist/_app_/components/search-input/index.js",
"./components/select/index.js": "./dist/_app_/components/select/index.js",
"./components/tabs/index.js": "./dist/_app_/components/tabs/index.js",
"./components/tag/index.js": "./dist/_app_/components/tag/index.js",
"./components/tile/index.js": "./dist/_app_/components/tile/index.js",
"./components/toggle/index.js": "./dist/_app_/components/toggle/index.js",
"./components/ui-shell/-header/index.js": "./dist/_app_/components/ui-shell/-header/index.js",
"./components/ui-shell/-nav/-item/index.js": "./dist/_app_/components/ui-shell/-nav/-item/index.js",
"./components/ui-shell/-nav/index.js": "./dist/_app_/components/ui-shell/-nav/index.js",
"./components/ui-shell/-sidenav/-menu/index.js": "./dist/_app_/components/ui-shell/-sidenav/-menu/index.js",
"./components/ui-shell/-sidenav/-sub-menu/index.js": "./dist/_app_/components/ui-shell/-sidenav/-sub-menu/index.js",
"./components/ui-shell/-sidenav/index.js": "./dist/_app_/components/ui-shell/-sidenav/index.js",
"./components/ui-shell/index.js": "./dist/_app_/components/ui-shell/index.js",
"./components/search-input.js": "./dist/_app_/components/search-input.js",
"./components/select.js": "./dist/_app_/components/select.js",
"./components/tabs.js": "./dist/_app_/components/tabs.js",
"./components/tag.js": "./dist/_app_/components/tag.js",
"./components/tile.js": "./dist/_app_/components/tile.js",
"./components/toggle.js": "./dist/_app_/components/toggle.js",
"./components/ui-shell.js": "./dist/_app_/components/ui-shell.js",
"./components/ui-shell/-header.js": "./dist/_app_/components/ui-shell/-header.js",
"./components/ui-shell/-nav.js": "./dist/_app_/components/ui-shell/-nav.js",
"./components/ui-shell/-nav/-item.js": "./dist/_app_/components/ui-shell/-nav/-item.js",
"./components/ui-shell/-sidenav.js": "./dist/_app_/components/ui-shell/-sidenav.js",
"./components/ui-shell/-sidenav/-menu.js": "./dist/_app_/components/ui-shell/-sidenav/-menu.js",
"./components/ui-shell/-sidenav/-sub-menu.js": "./dist/_app_/components/ui-shell/-sidenav/-sub-menu.js",
"./helpers/default-to.js": "./dist/_app_/helpers/default-to.js",
"./helpers/generic.js": "./dist/_app_/helpers/generic.js",
"./helpers/get-fn.js": "./dist/_app_/helpers/get-fn.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { default as newObj } from '#∼/helpers/new-obj.ts';
import Component from '@glimmer/component';
import CarbonChart from '../../charts/-components/chart.gts';
import { ScaleTypes } from '@carbon/charts';
import { fn } from '@ember/helper';

type Args = {
/**
Expand Down
5 changes: 2 additions & 3 deletions carbon-components-ember/src/components/charts/line.gts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { default as Chart } from '../-components/chart';
import { default as set } from '#∼/helpers/set.ts';
import { default as Chart } from './-components/chart.gts';
import { LineChart } from '@carbon/charts';
import Component from '@glimmer/component';
import { CarbonChartSignature } from '#∼/components/charts/-components/chart/index.gts'
import { CarbonChartSignature } from './-components/chart.gts';

type Args = {
resizable?: boolean;
Expand Down
38 changes: 16 additions & 22 deletions carbon-components-ember/src/components/data-table.gts
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
import { default as ListColumn } from './-column';
import { default as ListHeader } from './-header';
import { default as ListBody } from './-body';
import { default as Skeleton } from './-skeleton';
import { default as Toolbar } from './-toolbar';
import { default as Table } from './-table';
import { default as Pagination } from '../pagination';
import { default as SearchInput } from './-search-input';
import { default as Menu } from './-menu';
import { fn } from '@ember/helper';
import { default as call } from 'ember-composable-helpers/helpers/call';
import { default as getFn } from '#∼/helpers/get-fn.ts';
import { default as generic } from '#∼/helpers/generic.ts';
import { default as newObj } from '#∼/helpers/new-obj.ts';
import { default as ListColumn } from './data-table/-column.gts';
import { default as ListHeader } from './data-table/-header.gts';
import { default as ListBody } from './data-table/-body.gts';
import { default as Toolbar } from './data-table/-toolbar.gts';
import { default as Table } from './data-table/-table.gts';
import { default as Pagination } from './pagination.gts';
import { default as SearchInput } from './data-table/-search-input.gts';
import { default as Menu } from './data-table/-menu.gts';
import { default as didInsert } from '@ember/render-modifiers/modifiers/did-insert';
import Component from '@glimmer/component';
import { action } from '@ember/object';
Expand All @@ -21,17 +15,17 @@ import { A } from '@ember/array';
import MutableArray from '@ember/array/mutable';
import { task } from 'ember-concurrency';
import { next } from '@ember/runloop';
import TableToolbarComponent from '#∼/components/data-table/-toolbar.gts'
import TableSearchComponent from '#∼/components/data-table/-search-input.gts'
import CarbonPagination from '#∼/components/pagination.gts'
import TableComponent from '#∼/components/data-table/-table.gts'
import DataTableBody from '#∼/components/data-table/-body.gts'
import TableMenuComponent from '#∼/components/data-table/-menu.gts'
import TableColumn from '#∼/components/data-table/-column.gts'
import TableToolbarComponent from '#∼/components/data-table/-toolbar.gts';
import TableSearchComponent from '#∼/components/data-table/-search-input.gts';
import CarbonPagination from '#∼/components/pagination.gts';
import TableComponent from '#∼/components/data-table/-table.gts';
import DataTableBody from '#∼/components/data-table/-body.gts';
import TableMenuComponent from '#∼/components/data-table/-menu.gts';
import TableColumn from '#∼/components/data-table/-column.gts';
import { WithBoundArgs } from '@glint/template';
import ListHeaderComponent, {
Header,
} from '#∼/components/data-table/-header.gts'
} from '#∼/components/data-table/-header.gts';

class TrackedSet {
@tracked counter = 0;
Expand Down
7 changes: 4 additions & 3 deletions carbon-components-ember/src/components/data-table/-body.gts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { default as ListRow } from '../-row';
import { default as ListRow } from './-row.gts';
import Component from '@glimmer/component';
import DataTableComponent from '#∼/components/data-table.gts'
import DataTableComponent from '#∼/components/data-table.gts';
import { WithBoundArgs } from '@glint/template';
import DataTableRow from '#∼/components/data-table/-row.gts'
import DataTableRow from '#∼/components/data-table/-row.gts';
import { hash } from '@ember/helper';

type Args<T> = {
isExpandable: boolean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { default as SearchInput } from '#∼/components/search-input.gts'
import { default as Loading } from '#∼/components/loading.gts'
import { default as styles } from './styles.scoped.scss';
import { fn } from '@ember/helper';
import { default as SearchInput } from '#∼/components/search-input.gts';
import { default as Loading } from '#∼/components/loading.gts';
import Component from '@glimmer/component';
import { action } from '@ember/object';
import { tracked } from '@glimmer/tracking';
import { task } from 'ember-concurrency';
import { TaskInstance } from 'ember-concurrency';
import { stylesheet } from 'astroturf';

type Args = {
onChange: (value: string) => TaskInstance<any> | undefined;
Expand Down Expand Up @@ -38,13 +37,21 @@ export default class TableSearchComponent extends Component<Args> {
return this.runSearch.perform(term);
}

styles = stylesheet`
.is-searching {
.cds--search-magnifier {
display: none;
}
}
` as { 'is-searching': string };

<template>
<SearchInput
@isLoading={{@isLoading}}
@value={{@value}}
@expandable={{@expandable}}
@onChange={{this.doSearch}}
class='{{if this.isSearching styles.is-searching}}'
class='{{if this.isSearching this.styles.is-searching}}'
/>
<Loading
style='position: relative; top: -41px; right: 7px'
Expand Down
46 changes: 43 additions & 3 deletions carbon-components-ember/src/components/icon.gts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import or from '#∼/helpers/or.ts';
import renderSvgPart from '#∼/components/icon/render-svg-part.ts';
import { array } from '@ember/helper';
import htmlSafe from '#∼/helpers/html-safe.ts';
import { stylesheet } from 'astroturf';

const IconMap = {};
Object.values(icons).forEach((i: any) => {
Expand Down Expand Up @@ -1406,11 +1407,50 @@ class CarbonIcon extends Component<Args> {
run();
}
}

styles = stylesheet`
//@import "@carbon/styles/scss/theme";
.icon {
margin: 5px;
.cds--icon-- {
&disabled {
cursor: initial;
opacity: 0.5;
}
&info {
fill: $background;
&:hover {
fill: $background-hover;
}
}
&danger {
fill: $support-error;
&:hover {
filter: brightness(0.85);
}
}
}
.loader {
width: 12px;
height: 16px;
display: inline-block;
.cds--loading {
display: inline-block;
width: 1rem;
height: 1rem;
}
}
}
`;

<template>
{{#if (or @loading this.loading)}}
<span style='display: inline-block;'>
<Loading
@classNames='{{styles.icon}} {{this.bxClassNames}} loader'
@classNames='{{this.styles.icon}} {{this.bxClassNames}} loader'
@small={{true}}
@inline={{true}}
/>
Expand All @@ -1425,14 +1465,14 @@ class CarbonIcon extends Component<Args> {
>
{{renderSvgPart
this.svg
class=(array (or @svgClass styles.icon) this.bxClassNames)
class=(array (or @svgClass this.styles.icon) this.bxClassNames)
fill=@fill
}}
</button>
{{else}}
{{renderSvgPart
this.svg
class=(array (or @svgClass styles.icon) this.bxClassNames)
class=(array (or @svgClass this.styles.icon) this.bxClassNames)
fill=@fill
}}
{{/if}}
Expand Down
35 changes: 0 additions & 35 deletions carbon-components-ember/src/components/icon/styles.module.css

This file was deleted.

Loading

0 comments on commit e70e7b5

Please sign in to comment.