Repository: myliang/x-spreadsheet Branch: master Commit: 0c55f3ee1e70 Files: 143 Total size: 998.7 KB Directory structure: gitextract_treep73p/ ├── .babelrc ├── .eslintignore ├── .eslintrc.js ├── .github/ │ └── FUNDING.yml ├── .gitignore ├── .travis.yml ├── CODE_OF_CONDUCT.md ├── LICENSE ├── build/ │ ├── locale_loader.js │ ├── webpack.config.js │ ├── webpack.dev.js │ ├── webpack.locale.js │ └── webpack.prod.js ├── dist/ │ ├── index.html │ ├── locale/ │ │ ├── de.js │ │ ├── en.js │ │ ├── nl.js │ │ └── zh-cn.js │ ├── xspreadsheet.css │ └── xspreadsheet.js ├── docs/ │ ├── dist/ │ │ ├── index.html │ │ ├── locale/ │ │ │ ├── de.js │ │ │ ├── en.js │ │ │ ├── nl.js │ │ │ └── zh-cn.js │ │ ├── xspreadsheet.css │ │ └── xspreadsheet.js │ ├── index.html │ ├── locale/ │ │ ├── de.js │ │ ├── en.js │ │ ├── nl.js │ │ └── zh-cn.js │ ├── xspreadsheet.css │ └── xspreadsheet.js ├── index.html ├── npmx.txt ├── package.json ├── readme.md ├── src/ │ ├── algorithm/ │ │ ├── bitmap.js │ │ └── expression.js │ ├── canvas/ │ │ ├── draw.js │ │ └── draw2.js │ ├── component/ │ │ ├── border_palette.js │ │ ├── bottombar.js │ │ ├── button.js │ │ ├── calendar.js │ │ ├── color_palette.js │ │ ├── contextmenu.js │ │ ├── datepicker.js │ │ ├── dropdown.js │ │ ├── dropdown_align.js │ │ ├── dropdown_border.js │ │ ├── dropdown_color.js │ │ ├── dropdown_font.js │ │ ├── dropdown_fontsize.js │ │ ├── dropdown_format.js │ │ ├── dropdown_formula.js │ │ ├── dropdown_linetype.js │ │ ├── editor.js │ │ ├── element.js │ │ ├── event.js │ │ ├── form_field.js │ │ ├── form_input.js │ │ ├── form_select.js │ │ ├── icon.js │ │ ├── message.js │ │ ├── modal.js │ │ ├── modal_validation.js │ │ ├── print.js │ │ ├── resizer.js │ │ ├── scrollbar.js │ │ ├── selector.js │ │ ├── sheet.js │ │ ├── sort_filter.js │ │ ├── suggest.js │ │ ├── table.js │ │ ├── toolbar/ │ │ │ ├── align.js │ │ │ ├── autofilter.js │ │ │ ├── bold.js │ │ │ ├── border.js │ │ │ ├── clearformat.js │ │ │ ├── dropdown_item.js │ │ │ ├── fill_color.js │ │ │ ├── font.js │ │ │ ├── font_size.js │ │ │ ├── format.js │ │ │ ├── formula.js │ │ │ ├── freeze.js │ │ │ ├── icon_item.js │ │ │ ├── index.js │ │ │ ├── italic.js │ │ │ ├── item.js │ │ │ ├── merge.js │ │ │ ├── more.js │ │ │ ├── paintformat.js │ │ │ ├── print.js │ │ │ ├── redo.js │ │ │ ├── strike.js │ │ │ ├── text_color.js │ │ │ ├── textwrap.js │ │ │ ├── toggle_item.js │ │ │ ├── underline.js │ │ │ ├── undo.js │ │ │ └── valign.js │ │ ├── toolbar.js │ │ └── tooltip.js │ ├── config.js │ ├── core/ │ │ ├── _.prototypes.js │ │ ├── alphabet.js │ │ ├── auto_filter.js │ │ ├── cell.js │ │ ├── cell_range.js │ │ ├── clipboard.js │ │ ├── col.js │ │ ├── data_proxy.js │ │ ├── font.js │ │ ├── format.js │ │ ├── formula.js │ │ ├── helper.js │ │ ├── history.js │ │ ├── merge.js │ │ ├── row.js │ │ ├── scroll.js │ │ ├── selector.js │ │ ├── validation.js │ │ └── validator.js │ ├── index.d.ts │ ├── index.js │ ├── index.less │ └── locale/ │ ├── de.js │ ├── en.js │ ├── locale.js │ ├── nl.js │ └── zh-cn.js └── test/ ├── core/ │ ├── alphabet_test.js │ ├── cell_range_test.js │ ├── cell_test.js │ ├── font_test.js │ ├── format_test.js │ └── formula_test.js ├── helper_test.js ├── index_test.js └── locale/ └── locale_test.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .babelrc ================================================ { "presets": ["@babel/preset-env"], "plugins": ["@babel/plugin-proposal-class-properties"], } ================================================ FILE: .eslintignore ================================================ build dist ================================================ FILE: .eslintrc.js ================================================ module.exports = { "extends": "airbnb-base", "rules": { "no-param-reassign": ["error", { "props": false }], "class-methods-use-this": "off", "no-restricted-syntax": ["error", "WithStatement"], "quotes": ["error", "single", { "allowTemplateLiterals": true }], "no-console": "off" }, }; ================================================ FILE: .github/FUNDING.yml ================================================ # These are supported funding model platforms github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] patreon: # Replace with a single Patreon username open_collective: x-spreadsheet # Replace with a single Open Collective username ko_fi: # Replace with a single Ko-fi username tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] ================================================ FILE: .gitignore ================================================ node_modules yarn.lock .nyc_output/* ================================================ FILE: .travis.yml ================================================ language: node_js node_js: - 10.12.0 branches: only: - master install: - npm install -g istanbul - npm install before_script: script: - npm run build - npm run test - npm run coverage after_script: - cp ./dist/* ./docs/ -r ================================================ FILE: CODE_OF_CONDUCT.md ================================================ # Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at liangyuliang0335@126.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html [homepage]: https://www.contributor-covenant.org For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2017 myliang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: build/locale_loader.js ================================================ const path = require('path'); function getLocaleCode(name, code) { return `${code.replace('export default', 'const message =')} if (window && window.x_spreadsheet) { window.x_spreadsheet.$messages = window.x_spreadsheet.$messages || {}; window.x_spreadsheet.$messages['${name}'] = message; } export default message; `; } module.exports = require('babel-loader').custom(babel => { return { result(result, { options }) { // console.log('options:', options); const lang = path.basename(options.filename, '.js'); result.code = getLocaleCode(lang, result.code); return result; }, }; }); ================================================ FILE: build/webpack.config.js ================================================ const path = require('path'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const resolve = dir => path.join(__dirname, '..', dir); module.exports = { entry: { xspreadsheet: './src/index.js', }, module: { rules: [ { test: /\.js$/, use: { loader: 'babel-loader', options: { presets: ['@babel/preset-env'], } }, include: [resolve('src'), resolve('test')], }, { test: /\.css$/, use: [ MiniCssExtractPlugin.loader, 'style-loader', 'css-loader', ], }, { test: /\.less$/, use: [ MiniCssExtractPlugin.loader, 'css-loader', 'less-loader', ], }, { test: /\.(png|svg|jpg|gif)$/, use: [ 'file-loader', ], }, { test: /\.(woff|woff2|eot|ttf|otf)$/, use: [ 'file-loader', ], }, ], }, }; ================================================ FILE: build/webpack.dev.js ================================================ const merge = require('webpack-merge'); const common = require('./webpack.config.js'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const CleanWebpackPlugin = require('clean-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); module.exports = merge(common, { mode: 'development', plugins: [ new CleanWebpackPlugin(['dist']), // you should know that the HtmlWebpackPlugin by default will generate its own index.html new HtmlWebpackPlugin({ template: './index.html', title: 'x-spreadsheet', }), new MiniCssExtractPlugin({ // Options similar to the same options in webpackOptions.output // both options are optional filename: '[name].[contenthash].css', // chunkFilename: devMode ? '[id].[hash].css' : '[id].css', }), ], output: { filename: '[name].[contenthash].js', }, devtool: 'inline-source-map', devServer: { host: 'localhost', contentBase: '../dist', }, }); ================================================ FILE: build/webpack.locale.js ================================================ const path = require('path'); const fs = require('fs'); const localeFiles = fs.readdirSync(path.resolve(__dirname, '../src/locale')); const entry = {}; localeFiles.forEach((file) => { const name = file.split('.')[0]; if (name !== 'locale') { entry[name] = `./src/locale/${file}`; } }); module.exports = { entry, output: { filename: '[name].js', path: path.resolve(__dirname, '../dist/locale'), }, module: { rules: [ { test: /\.js$/, loader: path.resolve(__dirname, 'locale_loader.js'), } ] }, plugins: [ ], }; ================================================ FILE: build/webpack.prod.js ================================================ const path = require('path'); const merge = require('webpack-merge'); const common = require('./webpack.config.js'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const CleanWebpackPlugin = require('clean-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); module.exports = merge(common, { mode: 'production', devtool: 'source-map', plugins: [ new CleanWebpackPlugin(['dist']), // you should know that the HtmlWebpackPlugin by default will generate its own index.html new HtmlWebpackPlugin({ template: './index.html', title: 'x-spreadsheet', }), new MiniCssExtractPlugin({ // Options similar to the same options in webpackOptions.output // both options are optional filename: '[name].css', // chunkFilename: devMode ? '[id].[hash].css' : '[id].css', }), ], output: { filename: '[name].js', path: path.resolve(__dirname, '../dist'), }, }); ================================================ FILE: dist/index.html ================================================