Skip to content

Commit c573c90

Browse files
luk-rafqunabu
andauthored
angular wrapper - factory api integration (#11984)
* angular wrapper: - new adapter for editorFactory api integration - hot-dynamic-renderer-component.service - new function to create renderer by rendererFactory - HotCellEditorComponent - new props and hooks added - ColumnSettings - new props added to define cell render mode * angular-wrapper - new advanced component for renderer and editor added * angular-wrapper - new advanced component for renderer and editor added * angular-wrapper: new recipes for angular added; custom-cells.md - updated for angular; * angular-wrapper: angular-webpack.config - angular material and cdk added; lint issues fixed; tests fixed * angular-wrapper: changes after code review; angular-webpack.config - additional configuration for editor and render imports * angular-wrapper: docs - changes after code review * angular-wrapper: changes after code review; column-settings.ts - renderer and editor - added types to support new API ; angular-webpack.config - amd value fix * sidebar.js - build issue after merge fix * sidebar.js - build issue after merge fix * angular-wrapper: recipes - examples link fix * angular-wrapper: recipes - double quotation marks replaced with a single quotation mark * missing from build preview * copy wrappers into docs/.vuepress/public/@handsontable so would work * copy angular wrapper dist to proper folder * typo * Fix path for angular-wrapper hot-table copy * copy only angular wrapper essential files Comment out the creation and copying of wrapper files for documentation. * Fix directory creation and update copy commands in workflow Updated the documentation staging workflow to create the directory for Handsontable and adjusted the copy commands for the angular-wrapper. * Fix docs:build command in package.json --------- Co-authored-by: Mateusz Wojczal <mateusz@qunabu.com>
1 parent 08b099a commit c573c90

42 files changed

Lines changed: 6516 additions & 222 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docs-staging.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,20 @@ jobs:
102102
pnpm install
103103
npm run all build -- --e examples visual-tests
104104
105+
mkdir -p docs/.vuepress/public/@handsontable
106+
107+
# cp -r ./wrappers/angular docs/.vuepress/public/@handsontable
108+
# cp -r ./wrappers/angular-wrapper docs/.vuepress/public/@handsontable
109+
# cp -r ./wrappers/react docs/.vuepress/public/@handsontable
110+
# cp -r ./wrappers/react-wrapper docs/.vuepress/public/@handsontable
111+
# cp -r ./wrappers/vue docs/.vuepress/public/@handsontable
112+
# cp -r ./wrappers/vue3 docs/.vuepress/public/@handsontable
113+
114+
cp -r ./wrappers/angular-wrapper/dist/hot-table docs/.vuepress/public/@handsontable/
115+
mv docs/.vuepress/public/@handsontable/hot-table docs/.vuepress/public/@handsontable/angular-wrapper
116+
117+
ls -la docs/.vuepress/public/@handsontable/angular-wrapper
118+
105119
- name: Generate API references
106120
run: |
107121
npm run docs:api
@@ -129,13 +143,13 @@ jobs:
129143
130144
mkdir -p docs/docs/@handsontable
131145
rm -rf ../../@handsontable/angular/node_modules
132-
rm -rf ../../@handsontable/angular-wrapper/node_modules
146+
#rm -rf ../../@handsontable/angular-wrapper/node_modules
133147
rm -rf ../../@handsontable/react/node_modules
134148
rm -rf ../../@handsontable/react-wrapper/node_modules
135149
rm -rf ../../@handsontable/vue/node_modules
136150
rm -rf ../../@handsontable/vue3/node_modules
137151
cp -r ../../wrappers/angular docs/docs/@handsontable/
138-
cp -r ../../wrappers/angular-wrapper docs/docs/@handsontable/
152+
#cp -r ../../wrappers/angular-wrapper docs/docs/@handsontable/
139153
cp -r ../../wrappers/react docs/docs/@handsontable/
140154
cp -r ../../wrappers/react-wrapper docs/docs/@handsontable/
141155
cp -r ../../wrappers/vue docs/docs/@handsontable/

docs/.vuepress/handsontable-manager/dependencies.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ const buildDependencyGetter = (version) => {
142142
'angular-platform-browser': [getPrebuiltUmdUrl('angular-platformBrowser.umd.min.js'), [/* todo */]],
143143
'angular-platform-browser-dynamic': [getPrebuiltUmdUrl('angular-platformBrowserDynamic.umd.min.js'), [/* todo */]],
144144
'angular-core-primitives-signals': [getPrebuiltUmdUrl('angular-core-primitives-signals.umd.min.js'), [/* todo */]],
145+
'angular-material-checkbox': [getPrebuiltUmdUrl('angular-material-checkbox.umd.min.js'), [/* todo */]],
146+
'angular-cdk-a11y': [getPrebuiltUmdUrl('angular-cdk-a11y.umd.min.js'), [/* todo */]],
147+
'angular-cdk-observers': [getPrebuiltUmdUrl('angular-cdk-observers.umd.min.js'), [/* todo */]],
148+
'angular-cdk-coercion': [getPrebuiltUmdUrl('angular-cdk-coercion.umd.min.js'), [/* todo */]],
145149
'hot-angular': [getPrebuiltUmdUrl('handsontable-angular-wrapper.umd.min.js')],
146150
'hot-vue': [getPackageUrls('@handsontable/vue', version, 'js'), [/* todo */], null, 'hot-vue3'],
147151
'hot-vue3': [getPackageUrls('@handsontable/vue3', version, 'js'), [/* todo */], null, 'hot-vue'],
@@ -181,7 +185,7 @@ const presetMap = {
181185
'react-numbro': ['hot', 'numbro', 'react', 'react-dom', 'hot-react', 'fixer'],
182186
'react-redux': ['hot', 'react', 'react-dom', 'redux', 'react-redux', 'hot-react', 'fixer'],
183187
'react-advanced': ['hot', 'react', 'react-dom', 'redux', 'react-redux', 'hot-react', 'react-star-rating-component', 'fixer', 'react-colorful'],
184-
angular: ['hot', 'rxjs', 'core-js', 'zone', 'angular-core-primitives-signals', 'angular-compiler', 'angular-core', 'angular-common', 'angular-forms', 'angular-platform-browser', 'angular-platform-browser-dynamic', 'hot-angular', 'fixer'],
188+
angular: ['hot', 'rxjs', 'core-js', 'zone', 'angular-core-primitives-signals', 'angular-compiler', 'angular-core', 'angular-common', 'angular-forms', 'angular-platform-browser', 'angular-platform-browser-dynamic', 'hot-angular', 'angular-cdk-a11y', 'angular-cdk-observers', 'angular-cdk-coercion', 'angular-material-checkbox', 'date-fns', 'fixer'],
185189
'angular-languages': ['hot', 'languages', 'rxjs', 'core-js', 'zone', 'angular-core-primitives-signals', 'angular-compiler', 'angular-core', 'angular-common', 'angular-forms', 'angular-platform-browser', 'angular-platform-browser-dynamic', 'hot-angular', 'fixer'],
186190
'angular-numbro': ['hot', 'numbro', 'rxjs', 'core-js', 'zone', 'angular-core-primitives-signals', 'angular-compiler', 'angular-core', 'angular-common', 'angular-forms', 'angular-platform-browser', 'angular-platform-browser-dynamic', 'hot-angular', 'fixer'],
187191
vue: ['hot', 'vue', 'hot-vue', 'fixer'],

docs/.vuepress/public/scripts/fixer.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@
100100
else if (key === '@handsontable/angular-wrapper') {
101101
ns = 'Handsontable.angular';
102102

103+
} else if (/^@angular\/material\//.test(key)) {
104+
const moduleName = key.split('/')[2];
105+
ns = `ng.material-${moduleName}`;
106+
107+
} else if (/^@angular\/cdk\//.test(key)) {
108+
const moduleName = key.split('/')[2];
109+
ns = `ng.cdk-${moduleName}`;
110+
103111
} else if (key === '@handsontable/react-wrapper') {
104112
ns = 'Handsontable.react';
105113

docs/.vuepress/tools/angular-umd-builder/angular-webpack.config.js

Lines changed: 71 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ module.exports = {
2323
'core-primitives-signals': '../../../node_modules/@angular/core/fesm2022/primitives/signals.mjs',
2424
'core-primitives-di': '../../../node_modules/@angular/core/fesm2022/primitives/di.mjs',
2525
'common-http': '../../../node_modules/@angular/common/fesm2022/http.mjs',
26+
'material-checkbox': '../../../node_modules/@angular/material/fesm2022/checkbox.mjs',
27+
'cdk-a11y': '../../../node_modules/@angular/cdk/fesm2022/a11y.mjs',
28+
'cdk-observers': '../../../node_modules/@angular/cdk/fesm2022/observers.mjs',
29+
'cdk-coercion': '../../../node_modules/@angular/cdk/fesm2022/coercion.mjs',
2630
'handsontable-angular-wrapper': {
2731
import: angularImportPath,
2832
library: {
@@ -60,26 +64,68 @@ module.exports = {
6064
]
6165
},
6266
externals: [
63-
function({ request }, callback) {
64-
// Externalize any handsontable module
65-
if (request === 'handsontable' || request.startsWith('handsontable/')) {
66-
return callback(null, {
67-
root: 'Handsontable',
68-
commonjs: 'handsontable',
69-
commonjs2: 'handsontable',
70-
amd: 'handsontable'
71-
});
72-
}
73-
callback();
74-
},
7567
{
68+
'handsontable/editors/factory': {
69+
root: ['Handsontable', 'editors'],
70+
commonjs: 'handsontable/editors/factory',
71+
commonjs2: 'handsontable/editors/factory',
72+
amd: 'handsontable/editors/factory'
73+
},
74+
'handsontable/editors': {
75+
root: ['Handsontable', 'editors'],
76+
commonjs: 'handsontable/editors',
77+
commonjs2: 'handsontable/editors',
78+
amd: 'handsontable/editors'
79+
},
80+
'handsontable/renderers/factory': {
81+
root: ['Handsontable', 'renderers'],
82+
commonjs: 'handsontable/renderers/factory',
83+
commonjs2: 'handsontable/renderers/factory',
84+
amd: 'handsontable/renderers/factory'
85+
},
86+
'handsontable/renderers': {
87+
root: ['Handsontable', 'renderers'],
88+
commonjs: 'handsontable/renderers',
89+
commonjs2: 'handsontable/renderers',
90+
amd: 'handsontable/renderers'
91+
},
7692
rxjs: 'rxjs',
7793
'rxjs/operators': {
7894
root: ['rxjs', 'operators'],
7995
commonjs: 'rxjs.operators',
8096
commonjs2: 'rxjs.operators',
8197
amd: 'rxjs.operators'
8298
},
99+
'date-fns': {
100+
root: 'dateFns',
101+
commonjs: 'dateFns',
102+
commonjs2: 'date-fns',
103+
amd: 'date-fns'
104+
},
105+
'@angular/material/checkbox': {
106+
root: ['ng', 'material-checkbox'],
107+
commonjs: '@angular/material/checkbox',
108+
commonjs2: '@angular/material/checkbox',
109+
amd: '@angular/material/checkbox'
110+
},
111+
'@angular/cdk/a11y': {
112+
root: ['ng', 'cdk-a11y'],
113+
commonjs: '@angular/cdk/a11y',
114+
commonjs2: '@angular/cdk/a11y',
115+
amd: '@angular/cdk/a11y'
116+
},
117+
'@angular/cdk/observers': {
118+
root: ['ng', 'cdk-observers'],
119+
commonjs: '@angular/cdk/observers',
120+
commonjs2: '@angular/cdk/observers',
121+
amd: '@angular/cdk/observers'
122+
},
123+
'@angular/cdk/coercion': {
124+
root: ['ng', 'cdk-coercion'],
125+
commonjs: '@angular/cdk/coercion',
126+
commonjs2: '@angular/cdk/coercion',
127+
amd: '@angular/cdk/coercion'
128+
},
83129
'@handsontable/angular-wrapper': {
84130
root: ['Handsontable', 'angular'],
85131
commonjs: '@handsontable/angular-wrapper',
@@ -140,6 +186,18 @@ module.exports = {
140186
commonjs2: '@angular/common/http',
141187
amd: '@angular/common/http'
142188
}
143-
}
189+
},
190+
function({ request }, callback) {
191+
// Externalize any handsontable module
192+
if (request === 'handsontable' || request.startsWith('handsontable/')) {
193+
return callback(null, {
194+
root: 'Handsontable',
195+
commonjs: 'handsontable',
196+
commonjs2: 'handsontable',
197+
amd: 'handsontable'
198+
});
199+
}
200+
callback();
201+
},
144202
],
145203
};

0 commit comments

Comments
 (0)