Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): use barel export everywhere #57

Merged
merged 4 commits into from
Aug 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ To get started you must run (also once) an initial TS build so that all necessar
```bash
yarn run build
```
Every subsequent occurence should be called with the `rebuild` task which is nearly the same as `build`, the only diffence is that it will empty every `dist` folders prior to running the `build` command.
```bash
yarn run rebuild
```

4. Run Dev (Vanilla Implementation)

Expand Down Expand Up @@ -147,9 +151,9 @@ yarn run test:watch
- [x] Build and run on every PR
- [x] Add full bundler (all types) build step in CircleCI build
- [x] Bundle Creation (vanilla bundle)
- [ ] Eventually add Unit Tests as a Pre-Bundle task
- [x] Eventually add Unit Tests as a Pre-Bundle task
- [x] Remove any Deprecated code
- [ ] Create and Update the [Migration Guide](https://github.com/ghiscoding/slickgrid-universal/wiki/Migration-for-Angular-Aurelia-Slickgrid) for Angular/Aurelia
- [x] Create and Update the [Migration Guide](https://github.com/ghiscoding/slickgrid-universal/wiki/Migration-for-Angular-Aurelia-Slickgrid) for Angular/Aurelia
- [x] Add simple input bindings in the demo (e.g. pinned rows input)
- [x] Add possibility to use SVG instead of Font Family
- [x] Add Typings (interfaces) for Slick Grid & DataView objects
Expand All @@ -159,6 +163,8 @@ yarn run test:watch
- [x] The Pagination/Footer width is a little off sometime compare to the width of the grid container
- [x] See if we can add the number of chars (text counter) typed in `Editors.longText`
- [x] Upgrade to latest jQuery version `3.5.1`
- [x] Change `index` file of `Editors`, `Filters`, ... to regular barel export and rename previous files to `editors.index`, ...
- [x] Also add all `Editors`, `Filters`, ... to the Vanilla Grid Bundle
- [ ] See if we can get `DOM Purify` to work in SF, else keep the custom sanitizer
- [ ] See if we can get all the vanilla-grid-bundle `instances` as `readonly` class members
- [ ] change `Filters` and `Editors` to default index export but move the previous export into the vanilla grid bundle
- [ ] See if adding `lerna-changelog` make sense
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
"scripts": {
"bootstrap": "lerna bootstrap --use-workspaces",
"bundle": "lerna run bundle --stream",
"prebundle:zip": "npm run bundle",
"bundle:zip": "lerna run bundle:zip --stream",
"prebundle:with-tests": "npm run bundle",
"bundle:with-tests": "npm run test",
"build": "lerna run build --stream",
"build:demo": "lerna run build:demo --stream",
"rebuild": "run-s clean build",
Expand Down
31 changes: 31 additions & 0 deletions packages/common/src/aggregators/aggregators.index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { AvgAggregator } from './avgAggregator';
import { CloneAggregator } from './cloneAggregator';
import { CountAggregator } from './countAggregator';
import { DistinctAggregator } from './distinctAggregator';
import { MinAggregator } from './minAggregator';
import { MaxAggregator } from './maxAggregator';
import { SumAggregator } from './sumAggregator';

/** Provides a list of different Aggregators for the Group Formatter */
export const Aggregators = {
/** Average Aggregator which calculate the average of a given group */
Avg: AvgAggregator,

/** Clone Aggregator will simply clone (copy) over the last defined value of a given group */
Clone: CloneAggregator,

/** Count Aggregator will count the number of rows in the group */
Count: CountAggregator,

/** Distinct Aggregator will return an array of distinct values found inside the given group */
Distinct: DistinctAggregator,

/** Minimum Aggregator which will find the minimum value inside the given group */
Min: MinAggregator,

/** Maximum Aggregator which will find the maximum value inside the given group */
Max: MaxAggregator,

/** Sum Aggregator which calculate the sum of a given group */
Sum: SumAggregator
};
39 changes: 8 additions & 31 deletions packages/common/src/aggregators/index.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,8 @@
import { AvgAggregator } from './avgAggregator';
import { CloneAggregator } from './cloneAggregator';
import { CountAggregator } from './countAggregator';
import { DistinctAggregator } from './distinctAggregator';
import { MinAggregator } from './minAggregator';
import { MaxAggregator } from './maxAggregator';
import { SumAggregator } from './sumAggregator';

/** Provides a list of different Aggregators for the Group Formatter */
export const Aggregators = {
/** Average Aggregator which calculate the average of a given group */
Avg: AvgAggregator,

/** Clone Aggregator will simply clone (copy) over the last defined value of a given group */
Clone: CloneAggregator,

/** Count Aggregator will count the number of rows in the group */
Count: CountAggregator,

/** Distinct Aggregator will return an array of distinct values found inside the given group */
Distinct: DistinctAggregator,

/** Minimum Aggregator which will find the minimum value inside the given group */
Min: MinAggregator,

/** Maximum Aggregator which will find the maximum value inside the given group */
Max: MaxAggregator,

/** Sum Aggregator which calculate the sum of a given group */
Sum: SumAggregator
};
export * from './sumAggregator';
export * from './maxAggregator';
export * from './distinctAggregator';
export * from './minAggregator';
export * from './countAggregator';
export * from './cloneAggregator';
export * from './avgAggregator';
export * from './aggregators.index';
46 changes: 46 additions & 0 deletions packages/common/src/editors/editors.index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { AutoCompleteEditor } from './autoCompleteEditor';
import { CheckboxEditor } from './checkboxEditor';
import { DateEditor } from './dateEditor';
import { DualInputEditor } from './dualInputEditor';
import { FloatEditor } from './floatEditor';
import { IntegerEditor } from './integerEditor';
import { LongTextEditor } from './longTextEditor';
import { MultipleSelectEditor } from './multipleSelectEditor';
import { SingleSelectEditor } from './singleSelectEditor';
import { SliderEditor } from './sliderEditor';
import { TextEditor } from './textEditor';

export const Editors = {
/** AutoComplete Editor (using jQuery UI autocomplete feature) */
autoComplete: AutoCompleteEditor,

/** Checkbox Editor (uses native checkbox DOM element) */
checkbox: CheckboxEditor,

/** Date Picker Editor (which uses 3rd party lib "flatpickr") */
date: DateEditor,

/** Dual Input Editor, default input type is text but it could be (integer/float/number/password/text) */
dualInput: DualInputEditor,

/** Float Number Editor */
float: FloatEditor,

/** Integer Editor */
integer: IntegerEditor,

/** Long Text Editor (uses a textarea) */
longText: LongTextEditor,

/** Multiple Select editor (which uses 3rd party lib "multiple-select.js") */
multipleSelect: MultipleSelectEditor,

/** Single Select editor (which uses 3rd party lib "multiple-select.js") */
singleSelect: SingleSelectEditor,

/** Slider Editor */
slider: SliderEditor,

/** Text Editor */
text: TextEditor
};
59 changes: 13 additions & 46 deletions packages/common/src/editors/index.ts
Original file line number Diff line number Diff line change
@@ -1,46 +1,13 @@
import { AutoCompleteEditor } from './autoCompleteEditor';
import { CheckboxEditor } from './checkboxEditor';
import { DateEditor } from './dateEditor';
import { DualInputEditor } from './dualInputEditor';
import { FloatEditor } from './floatEditor';
import { IntegerEditor } from './integerEditor';
import { LongTextEditor } from './longTextEditor';
import { MultipleSelectEditor } from './multipleSelectEditor';
import { SingleSelectEditor } from './singleSelectEditor';
import { SliderEditor } from './sliderEditor';
import { TextEditor } from './textEditor';

export const Editors = {
/** AutoComplete Editor (using jQuery UI autocomplete feature) */
autoComplete: AutoCompleteEditor,

/** Checkbox Editor (uses native checkbox DOM element) */
checkbox: CheckboxEditor,

/** Date Picker Editor (which uses 3rd party lib "flatpickr") */
date: DateEditor,

/** Dual Input Editor, default input type is text but it could be (integer/float/number/password/text) */
dualInput: DualInputEditor,

/** Float Number Editor */
float: FloatEditor,

/** Integer Editor */
integer: IntegerEditor,

/** Long Text Editor (uses a textarea) */
longText: LongTextEditor,

/** Multiple Select editor (which uses 3rd party lib "multiple-select.js") */
multipleSelect: MultipleSelectEditor,

/** Single Select editor (which uses 3rd party lib "multiple-select.js") */
singleSelect: SingleSelectEditor,

/** Slider Editor */
slider: SliderEditor,

/** Text Editor */
text: TextEditor
};
export * from './textEditor';
export * from './sliderEditor';
export * from './singleSelectEditor';
export * from './selectEditor';
export * from './multipleSelectEditor';
export * from './longTextEditor';
export * from './integerEditor';
export * from './floatEditor';
export * from './editors.index';
export * from './dualInputEditor';
export * from './dateEditor';
export * from './checkboxEditor';
export * from './autoCompleteEditor';
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ function executeAssociatedDateCondition(options: FilterConditionOption): boolean
return (resultCondition1 && resultCondition2);
}
return testFilterCondition(options.operator || '==', parseInt(dateCell.format('X'), 10), parseInt(dateSearch1.format('X'), 10));
};
}
16 changes: 16 additions & 0 deletions packages/common/src/filter-conditions/filterConditions.index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { FilterConditionOption } from './../interfaces/filterConditionOption.interface';
import { booleanFilterCondition } from './booleanFilterCondition';
import { executeMappedCondition } from './executeMappedCondition';
import { collectionSearchFilterCondition } from './collectionSearchFilterCondition';
import { numberFilterCondition } from './numberFilterCondition';
import { stringFilterCondition } from './stringFilterCondition';
import { testFilterCondition } from './filterUtilities';

export const FilterConditions = {
executeMappedCondition,
booleanFilter: booleanFilterCondition,
collectionSearchFilter: collectionSearchFilterCondition,
numberFilter: numberFilterCondition,
stringFilter: stringFilterCondition,
testFilter: testFilterCondition
};
24 changes: 8 additions & 16 deletions packages/common/src/filter-conditions/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
import { FilterConditionOption } from './../interfaces/filterConditionOption.interface';
import { booleanFilterCondition } from './booleanFilterCondition';
import { executeMappedCondition } from './executeMappedCondition';
import { collectionSearchFilterCondition } from './collectionSearchFilterCondition';
import { numberFilterCondition } from './numberFilterCondition';
import { stringFilterCondition } from './stringFilterCondition';
import { testFilterCondition } from './filterUtilities';

export const FilterConditions = {
executeMappedCondition,
booleanFilter: booleanFilterCondition,
collectionSearchFilter: collectionSearchFilterCondition,
numberFilter: numberFilterCondition,
stringFilter: stringFilterCondition,
testFilter: testFilterCondition
};
export * from './stringFilterCondition';
export * from './objectFilterCondition';
export * from './numberFilterCondition';
export * from './filterUtilities';
export * from './filterConditions.index';
export * from './executeMappedCondition';
export * from './collectionSearchFilterCondition';
export * from './booleanFilterCondition';
76 changes: 76 additions & 0 deletions packages/common/src/filters/filters.index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// import { Column, Filter } from '../interfaces/index';
import { AutoCompleteFilter } from './autoCompleteFilter';
import { CompoundDateFilter } from './compoundDateFilter';
import { CompoundInputFilter } from './compoundInputFilter';
import { CompoundInputNumberFilter } from './compoundInputNumberFilter';
import { CompoundInputPasswordFilter } from './compoundInputPasswordFilter';
import { CompoundSliderFilter } from './compoundSliderFilter';
import { InputFilter } from './inputFilter';
import { InputMaskFilter } from './inputMaskFilter';
import { InputNumberFilter } from './inputNumberFilter';
import { InputPasswordFilter } from './inputPasswordFilter';
import { MultipleSelectFilter } from './multipleSelectFilter';
import { NativeSelectFilter } from './nativeSelectFilter';
import { DateRangeFilter } from './dateRangeFilter';
import { SingleSelectFilter } from './singleSelectFilter';
import { SliderFilter } from './sliderFilter';
import { SliderRangeFilter } from './sliderRangeFilter';

export const Filters = {
/** AutoComplete Filter (using jQuery UI autocomplete feature) */
autoComplete: AutoCompleteFilter,

/** Compound Date Filter (compound of Operator + Date picker) */
compoundDate: CompoundDateFilter,

/** Alias to compoundInputText to Compound Input Filter (compound of Operator + Input Text) */
compoundInput: CompoundInputFilter,

/** Compound Input Number Filter (compound of Operator + Input of type Number) */
compoundInputNumber: CompoundInputNumberFilter,

/** Compound Input Password Filter (compound of Operator + Input of type Password, also note that only the text shown in the UI will be masked, filter query is still plain text) */
compoundInputPassword: CompoundInputPasswordFilter,

/** Compound Input Text Filter (compound of Operator + Input Text) */
compoundInputText: CompoundInputFilter,

/** Compound Slider Filter (compound of Operator + Slider) */
compoundSlider: CompoundSliderFilter,

/** Range Date Filter (uses the Flactpickr Date picker with range option) */
dateRange: DateRangeFilter,

/** Alias to inputText, input type text filter */
input: InputFilter,

/**
* Input Filter of type text that will be formatted with a mask output
* e.g.: column: { filter: { model: Filters.inputMask }, params: { mask: '(000) 000-0000' }}
*/
inputMask: InputMaskFilter,

/** Input Filter of type Number */
inputNumber: InputNumberFilter,

/** Input Filter of type Password (note that only the text shown in the UI will be masked, filter query is still plain text) */
inputPassword: InputPasswordFilter,

/** Default Filter, input type text filter */
inputText: InputFilter,

/** Multiple Select filter, which uses 3rd party lib "multiple-select.js" */
multipleSelect: MultipleSelectFilter,

/** Select filter, which uses native DOM element select */
select: NativeSelectFilter,

/** Single Select filter, which uses 3rd party lib "multiple-select.js" */
singleSelect: SingleSelectFilter,

/** Slider Filter (only 1 value) */
slider: SliderFilter,

/** Slider Range Filter, uses jQuery UI Range Slider (2 values, lowest/highest search range) */
sliderRange: SliderRangeFilter,
};
Loading