diff --git a/OLD/2022_Coding_Competition_Finals_Problem_Statement.pdf b/OLD/2022_Coding_Competition_Finals_Problem_Statement.pdf new file mode 100644 index 0000000..864052d Binary files /dev/null and b/OLD/2022_Coding_Competition_Finals_Problem_Statement.pdf differ diff --git a/OLD/LICENSE b/OLD/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/OLD/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/OLD/README.md b/OLD/README.md new file mode 100644 index 0000000..899ce1b --- /dev/null +++ b/OLD/README.md @@ -0,0 +1,32 @@ +# README Template + +## Team Name: <> + +* Team Member(s): <>, <> + +## List of Required Software + +> Examples: `NodeJS version X` or `Java version Y` + +<>, <>, <> + +## How to Run + +> List any commands to run your project. For example: + +```sh +# To get most NodeJS apps to run locally +npm install + +npm start +# OR +npm run dev +``` + +## Known Issues or Bugs + +> If there's any known problems with running your app, please list them below. + +1. <> +2. <> +3. <> diff --git a/OLD/app.py b/OLD/app.py new file mode 100644 index 0000000..2b238c7 --- /dev/null +++ b/OLD/app.py @@ -0,0 +1,12 @@ +from database import dbInit +import json + +with open('config.json','r') as f: + config = json.load(f) + +dbInit.createDatabase(config['sql']); + + + + + diff --git a/OLD/backend/app.py b/OLD/backend/app.py new file mode 100644 index 0000000..ef3b7c9 --- /dev/null +++ b/OLD/backend/app.py @@ -0,0 +1,15 @@ +import time + +from flask import Flask + +app = Flask(__name__) + +def get_hit_count(): + +@app.route('/') +def hello(): + count = 1 + return 'Hello World! I have been seen {} times.\n'.format(count) + +if __name__ == '__main__': + app.run() \ No newline at end of file diff --git a/OLD/backend/data/constact.py b/OLD/backend/data/constact.py new file mode 100644 index 0000000..e69de29 diff --git a/OLD/backend/data/customer.py b/OLD/backend/data/customer.py new file mode 100644 index 0000000..e69de29 diff --git a/OLD/config.json b/OLD/config.json new file mode 100644 index 0000000..3cad5f8 --- /dev/null +++ b/OLD/config.json @@ -0,0 +1,8 @@ +{ + "sql": { + "user": "postgres", + "password": "hQ4SmC4H", + "host": "localhost", + "port": 5432 + } +} \ No newline at end of file diff --git a/OLD/customerData.csv b/OLD/customerData.csv new file mode 100644 index 0000000..47b3f8e --- /dev/null +++ b/OLD/customerData.csv @@ -0,0 +1,21 @@ +id,fullName,dateOfBirth,gender,email,streetAddress,profession,relationship,relationshipStartDate,relationshipEndDate +1,Alisa Aldins,1966-06-26,Female,aaldins0@payments.ex,22947 Artisan Road,Payment Adjustment Coordinator,current,1990-10-31, +2,Regine Sprott,1990-11-21,Female,rsprott1@gsnail.ex,2 Starling Alley,Executive Secretary,current,2001-02-03, +3,Karia Rolinson,1979-10-21,Female,krolinson2@uni.ex,46 Weeping Birch Parkway,Research Assistant I,current,2022-09-09, +4,Frayda Wimpeney,1990-03-27,Female,fwimpeney3@livemail.ex,3 Old Gate Avenue,Senior Developer,current,1998-05-24, +5,Sayer Possell,1995-06-04,Male,sayer@possell.ex,6 American Ash Hill,Environmental Tech,current,2006-03-17, +6,Cobbie Stannett,1960-03-05,Male,cstannett5@jungle.co.ex,1 Myrtle Park,Payment Adjustment Coordinator,prospective,, +7,Arliene Bottini,2000-02-22,Female,abottini6@loa.ex,49656 Hermina Junction,,prospective,, +8,Aila Demann,1994-03-05,Female,ademann7@gsnail.ex,7108 Sommers Court,Assistant Professor,prospective,, +9,Felicia Patrie,2002-10-27,Female,fpatrie8@sysadminsrus.ex,6 Anderson Junction,Systems Administrator IV,previous,2021-06-01,2022-05-31 +10,Evvy Pirozzi,1988-07-12,Female,epirozzi9@accounting.ex,5815 Cascade Junction,Accounting Assistant I,current,2010-04-18, +11,Glennie Seddon,1955-11-02,Female,gseddona@hermesmail.ex,1 Delladonna Junction,,previous,1989-08-17,2020-11-01 +12,Jeddy O'Hartnedy,1996-05-16,Male,johartnedyb@mail.ex,31978 Bobwhite Center,Desktop Support Technician,prospective,, +13,Page Downey,1976-02-17,Female,pdowneyc@bingbingbing.ex,21 Gerald Street,Programmer Analyst IV,prospective,, +14,Courtney Sharvill,1994-12-11,Male,csharvilld@mail.schooldistrict.ex,5378 Buena Vista Trail,Senior Cost Accountant,previous,2003-12-12,2009-07-01 +15,Hershel Kubat,1989-03-09,Male,hkubate@freeemail.ex,0483 Sloan Point,Marketing Manager,previous,1991-03-05,1999-01-15 +16,Sigvard Rawsthorne,1975-09-17,Male,srawsthornef@myexample.ex,532 Doe Crossing Lane,Financial Advisor,prospective,, +17,Roanna Wye,1960-05-27,Female,rwyeg@coldmail.ex,6557 Fisk Center,Statistician IV,current,1994-06-05, +18,Flemming Leonida,1973-10-12,Male,fleonidah@freemail.ex,1930 Comanche Alley,Senior Quality Engineer,prospective,, +19,Mauricio Reuven,1995-01-07,Male,mreuveni@hospital.ex,65276 Scott Court,Registered Nurse,current,2012-12-21, +20,Claudine Doggrell,1973-09-19,Female,cdoggrellj@big.tech.ex,6 Sullivan Trail,Project Manager,current,2014-06-28, \ No newline at end of file diff --git a/OLD/database/Data-Definition.vsdx b/OLD/database/Data-Definition.vsdx new file mode 100644 index 0000000..b3670ed Binary files /dev/null and b/OLD/database/Data-Definition.vsdx differ diff --git a/OLD/database/__pycache__/dbInit.cpython-310.pyc b/OLD/database/__pycache__/dbInit.cpython-310.pyc new file mode 100644 index 0000000..cd90c12 Binary files /dev/null and b/OLD/database/__pycache__/dbInit.cpython-310.pyc differ diff --git a/OLD/database/dbInit.py b/OLD/database/dbInit.py new file mode 100644 index 0000000..feb1d82 --- /dev/null +++ b/OLD/database/dbInit.py @@ -0,0 +1,46 @@ +import csv +import json + +from sqlalchemy import create_engine + + +def createDatabase(config): + with open ('customerData.csv',mode = 'r') as file: + c_data = csv.DictReader(file) + + + + login_string = "postgresql+psycopg2://%s:%s@%s:%s"%(config['user'],config['password'],config['host'],config['port']) + + e = create_engine(login_string,pool_recycle=3600) + conn = e.connect(); + + conn.execute("create table if not EXISTS customer(\ + CustomerId SERIAL Primary key,\ + firstName varchar(255) NOT NULL,\ + lastName varchar(255) NOT NULL,\ + doB DATE NOT NULL,\ + gender varchar(60) NOT NULL,\ + profession varchar(255),\ + relationshipStart Date,\ + relationshipEnd Date\ + ); +\ + create table if not EXISTS contact(\ + Id SERIAL Primary key,\ + CustomerId Integer REFERENCES customer(customerId),\ + ContactType varchar(25) NOT NULL,\ + ContactData Text NOT NULL\ + );\ + ") + + + for customer in c_data: + names = customer['fullName'].split(" ") + conn.execute("INSERT INTO customer (insert into customer (customerid,firstName,lastName,dob,gender,relationship) VALUES (%s,'%s','%s','%s','%s')"%customer['id'],names[0],names[1],customer['dateOfBirth'],customer['relationship']) + + + + + + + \ No newline at end of file diff --git a/OLD/database/tableCreation-DDL.sql b/OLD/database/tableCreation-DDL.sql new file mode 100644 index 0000000..ea0221d --- /dev/null +++ b/OLD/database/tableCreation-DDL.sql @@ -0,0 +1,17 @@ +create table if not EXISTS customer( + CustomerId SERIAL Primary key, + firstName varchar(255) NOT NULL, + lastName varchar(255) NOT NULL, + doB DATE NOT NULL, + gender varchar(60) NOT NULL, + profession varchar(255), + relationshipStart Date, + relationshipEnd Date +); + +create table if not EXISTS contact( + Id SERIAL Primary key, + CustomerId Integer REFERENCES customer(customerId), + ContactType varchar(25) NOT NULL, + ContactData Text NOT NULL +); diff --git a/OLD/docker-compose.yml b/OLD/docker-compose.yml new file mode 100644 index 0000000..1b2cc76 --- /dev/null +++ b/OLD/docker-compose.yml @@ -0,0 +1,14 @@ +volumes: + data: + +services: + postgres: + image: postgres:latest + environment: + - POSTGRES_PASSWORD=hQ4SmC4H + ports: + - 5432:5432 + volumes: + - data:/var/lib/postgresql + myapp: + image: [YOUR-APP-IMAGE] \ No newline at end of file diff --git a/OLD/dockerfile b/OLD/dockerfile new file mode 100644 index 0000000..a3487fa --- /dev/null +++ b/OLD/dockerfile @@ -0,0 +1,11 @@ +# syntax=docker/dockerfile:1 +FROM python:3.7-alpine +WORKDIR /code +ENV FLASK_APP=backend/app.py +ENV FLASK_RUN_HOST=0.0.0.0 +RUN apk add --no-cache gcc musl-dev linux-headers +COPY requirements.txt requirements.txt +RUN pip install -r requirements.txt +EXPOSE 5000 +COPY . . +CMD ["flask", "run"] \ No newline at end of file diff --git a/OLD/feedback.md b/OLD/feedback.md new file mode 100644 index 0000000..f7a853b --- /dev/null +++ b/OLD/feedback.md @@ -0,0 +1,19 @@ +# Feedback + +## Document and describe any enhancements included to help the judges properly grade your submission. + +### Step 1: + +<> + +### Step 2: + +<> + +## Feedback for the coding competition? + +<> + +## Things you would like to see in future events? + +<> \ No newline at end of file diff --git a/OLD/requirements.txt b/OLD/requirements.txt new file mode 100644 index 0000000..28dab50 --- /dev/null +++ b/OLD/requirements.txt @@ -0,0 +1,3 @@ +flask +sqlalchemy +psycopg2 \ No newline at end of file diff --git a/README.md b/README.md index 899ce1b..421354d 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,12 @@ # README Template -## Team Name: <> +## Team Name: Levith -* Team Member(s): <>, <> +* Team Member(s): Levi Bottomley ## List of Required Software -> Examples: `NodeJS version X` or `Java version Y` - -<>, <>, <> +Python 3 ## How to Run @@ -16,17 +14,14 @@ ```sh # To get most NodeJS apps to run locally -npm install - -npm start -# OR -npm run dev +pip install -r requirements.txt +python app.py ``` ## Known Issues or Bugs > If there's any known problems with running your app, please list them below. -1. <> -2. <> -3. <> +1. Accordion display does not collapse +2. Name is not displayed as Accordian header in order to not lose data it was place in the body of the display +s \ No newline at end of file diff --git a/api/__pycache__/customer.cpython-310.pyc b/api/__pycache__/customer.cpython-310.pyc new file mode 100644 index 0000000..8f01b69 Binary files /dev/null and b/api/__pycache__/customer.cpython-310.pyc differ diff --git a/api/customer.py b/api/customer.py new file mode 100644 index 0000000..7e9f1ee --- /dev/null +++ b/api/customer.py @@ -0,0 +1,38 @@ +from flask import request, jsonify +from flask_restful import Resource +import json + + +class CustomerApi(Resource): + def __init__(self,**kwargs): + self.cache = kwargs['cache'] + + def get(self): + name = request.args.get('name') + id = request.args.get('id') + if name is not None or id is not None: + for customer in self.cache.customers: + if name is not None and customer['fullname'] == name: + return jsonify(customer); + if name is not None and customer['id'] == id: + return jsonify(customer); + + return jsonify(self.cache.customers); + + + + def put(self): + name = request.args.get('name') + id = request.args.get('id') + profession = request.args.get('profession') + relationshipStart = request.args.get('relStart') + relationshipEnd = request.args.get('relEnd') + if name is not None or id is not None: + for customer in self.cache.customers: + if name is not None and customer['fullname'] == name: + return jsonify(customer); + if name is not None and customer['id'] == id: + return jsonify(customer); + + return; + diff --git a/app.py b/app.py new file mode 100644 index 0000000..25c8385 --- /dev/null +++ b/app.py @@ -0,0 +1,25 @@ +from flask import Flask, request, render_template +from flask_restful import Resource, Api +from api.customer import CustomerApi +import json + +from data.Cache import Cache + + + +app = Flask(__name__) +api = Api(app) +cache = Cache('customerData.csv') + +api.add_resource(CustomerApi,'/v1/customer/name/','/v1/customer/id/','/v1/customer/',resource_class_kwargs={'cache':cache}); + + +@app.route('/') +def index(): + customers = [*cache.customers.values()]; + print(*customers); + return render_template('index.html',customers=customers); + + +if __name__ == '__main__': + app.run(debug=True) \ No newline at end of file diff --git a/data/Cache.py b/data/Cache.py new file mode 100644 index 0000000..0f61a16 --- /dev/null +++ b/data/Cache.py @@ -0,0 +1,14 @@ +import csv + +class Cache: + def __init__(self,path): + self.path = path; + self.customers = {"0":{}}; + self.buildCache(); + + def buildCache(self): + with open (self.path,mode = 'r') as file: + c_data = csv.DictReader(file) + self.customers = dict(enumerate(c_data)) + + \ No newline at end of file diff --git a/data/__pycache__/Cache.cpython-310.pyc b/data/__pycache__/Cache.cpython-310.pyc new file mode 100644 index 0000000..3e351ec Binary files /dev/null and b/data/__pycache__/Cache.cpython-310.pyc differ diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..21c549d --- /dev/null +++ b/dockerfile @@ -0,0 +1,11 @@ +# syntax=docker/dockerfile:1 +FROM python:3.7-alpine +WORKDIR /code +ENV FLASK_APP=app.py +ENV FLASK_RUN_HOST=0.0.0.0 +RUN apk add --no-cache gcc musl-dev linux-headers +COPY requirements.txt requirements.txt +RUN pip install -r requirements.txt +EXPOSE 5000 +COPY . . +CMD ["flask", "run"] \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 0000000..2e88b3b --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,35 @@ +{ + "name": "2022-StateFarm-CodingCompetitionFinals", + "lockfileVersion": 2, + "requires": true, + "packages": { + "node_modules/@popperjs/core": { + "version": "2.11.6", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.6.tgz", + "integrity": "sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==", + "peer": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, + "node_modules/bootstrap": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.2.2.tgz", + "integrity": "sha512-dEtzMTV71n6Fhmbg4fYJzQsw1N29hJKO1js5ackCgIpDcGid2ETMGC6zwSYw09v05Y+oRdQ9loC54zB1La3hHQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/twbs" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/bootstrap" + } + ], + "peerDependencies": { + "@popperjs/core": "^2.11.6" + } + } + } +} diff --git a/node_modules/@popperjs/core/LICENSE.md b/node_modules/@popperjs/core/LICENSE.md new file mode 100644 index 0000000..0370c45 --- /dev/null +++ b/node_modules/@popperjs/core/LICENSE.md @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2019 Federico Zivolo + +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. diff --git a/node_modules/@popperjs/core/README.md b/node_modules/@popperjs/core/README.md new file mode 100644 index 0000000..53be7b9 --- /dev/null +++ b/node_modules/@popperjs/core/README.md @@ -0,0 +1,376 @@ + +

+ Popper +

+ +
+

Tooltip & Popover Positioning Engine

+
+ +

+ + npm version + + + npm downloads per month (popper.js + @popperjs/core) + + + Rolling Versions + +

+ +
+ + +**Positioning tooltips and popovers is difficult. Popper is here to help!** + +Given an element, such as a button, and a tooltip element describing it, Popper +will automatically put the tooltip in the right place near the button. + +It will position _any_ UI element that "pops out" from the flow of your document +and floats near a target element. The most common example is a tooltip, but it +also includes popovers, drop-downs, and more. All of these can be generically +described as a "popper" element. + +## Demo + +[![Popper visualized](https://i.imgur.com/F7qWsmV.jpg)](https://popper.js.org) + +## Docs + +- [v2.x (latest)](https://popper.js.org/docs/v2/) +- [v1.x](https://popper.js.org/docs/v1/) + +We've created a +[Migration Guide](https://popper.js.org/docs/v2/migration-guide/) to help you +migrate from Popper 1 to Popper 2. + +To contribute to the Popper website and documentation, please visit the +[dedicated repository](https://github.com/popperjs/website). + +## Why not use pure CSS? + +- **Clipping and overflow issues**: Pure CSS poppers will not be prevented from + overflowing clipping boundaries, such as the viewport. It will get partially + cut off or overflows if it's near the edge since there is no dynamic + positioning logic. When using Popper, your popper will always be positioned in + the right place without needing manual adjustments. +- **No flipping**: CSS poppers will not flip to a different placement to fit + better in view if necessary. While you can manually adjust for the main axis + overflow, this feature cannot be achieved via CSS alone. Popper automatically + flips the tooltip to make it fit in view as best as possible for the user. +- **No virtual positioning**: CSS poppers cannot follow the mouse cursor or be + used as a context menu. Popper allows you to position your tooltip relative to + any coordinates you desire. +- **Slower development cycle**: When pure CSS is used to position popper + elements, the lack of dynamic positioning means they must be carefully placed + to consider overflow on all screen sizes. In reusable component libraries, + this means a developer can't just add the component anywhere on the page, + because these issues need to be considered and adjusted for every time. With + Popper, you can place your elements anywhere and they will be positioned + correctly, without needing to consider different screen sizes, layouts, etc. + This massively speeds up development time because this work is automatically + offloaded to Popper. +- **Lack of extensibility**: CSS poppers cannot be easily extended to fit any + arbitrary use case you may need to adjust for. Popper is built with + extensibility in mind. + +## Why Popper? + +With the CSS drawbacks out of the way, we now move on to Popper in the +JavaScript space itself. + +Naive JavaScript tooltip implementations usually have the following problems: + +- **Scrolling containers**: They don't ensure the tooltip stays with the + reference element while scrolling when inside any number of scrolling + containers. +- **DOM context**: They often require the tooltip move outside of its original + DOM context because they don't handle `offsetParent` contexts. +- **Compatibility**: Popper handles an incredible number of edge cases regarding + different browsers and environments (mobile viewports, RTL, scrollbars enabled + or disabled, etc.). Popper is a popular and well-maintained library, so you + can be confident positioning will work for your users on any device. +- **Configurability**: They often lack advanced configurability to suit any + possible use case. +- **Size**: They are usually relatively large in size, or require an ancient + jQuery dependency. +- **Performance**: They often have runtime performance issues and update the + tooltip position too slowly. + +**Popper solves all of these key problems in an elegant, performant manner.** It +is a lightweight ~3 kB library that aims to provide a reliable and extensible +positioning engine you can use to ensure all your popper elements are positioned +in the right place. + +When you start writing your own popper implementation, you'll quickly run into +all of the problems mentioned above. These widgets are incredibly common in our +UIs; we've done the hard work figuring this out so you don't need to spend hours +fixing and handling numerous edge cases that we already ran into while building +the library! + +Popper is used in popular libraries like Bootstrap, Foundation, Material UI, and +more. It's likely you've already used popper elements on the web positioned by +Popper at some point in the past few years. + +Since we write UIs using powerful abstraction libraries such as React or Angular +nowadays, you'll also be glad to know Popper can fully integrate with them and +be a good citizen together with your other components. Check out `react-popper` +for the official Popper wrapper for React. + +## Installation + +### 1. Package Manager + +```bash +# With npm +npm i @popperjs/core + +# With Yarn +yarn add @popperjs/core +``` + +### 2. CDN + +```html + + + + + +``` + +### 3. Direct Download? + +Managing dependencies by "directly downloading" them and placing them into your +source code is not recommended for a variety of reasons, including missing out +on feat/fix updates easily. Please use a versioning management system like a CDN +or npm/Yarn. + +## Usage + +The most straightforward way to get started is to import Popper from the `unpkg` +CDN, which includes all of its features. You can call the `Popper.createPopper` +constructor to create new popper instances. + +Here is a complete example: + +```html + +Popper example + + + + + + + + +``` + +Visit the [tutorial](https://popper.js.org/docs/v2/tutorial/) for an example of +how to build your own tooltip from scratch using Popper. + +### Module bundlers + +You can import the `createPopper` constructor from the fully-featured file: + +```js +import { createPopper } from '@popperjs/core'; + +const button = document.querySelector('#button'); +const tooltip = document.querySelector('#tooltip'); + +// Pass the button, the tooltip, and some options, and Popper will do the +// magic positioning for you: +createPopper(button, tooltip, { + placement: 'right', +}); +``` + +All the modifiers listed in the docs menu will be enabled and "just work", so +you don't need to think about setting Popper up. The size of Popper including +all of its features is about 5 kB minzipped, but it may grow a bit in the +future. + +#### Popper Lite (tree-shaking) + +If bundle size is important, you'll want to take advantage of tree-shaking. The +library is built in a modular way to allow to import only the parts you really +need. + +```js +import { createPopperLite as createPopper } from '@popperjs/core'; +``` + +The Lite version includes the most necessary modifiers that will compute the +offsets of the popper, compute and add the positioning styles, and add event +listeners. This is close in bundle size to pure CSS tooltip libraries, and +behaves somewhat similarly. + +However, this does not include the features that makes Popper truly useful. + +The two most useful modifiers not included in Lite are `preventOverflow` and +`flip`: + +```js +import { + createPopperLite as createPopper, + preventOverflow, + flip, +} from '@popperjs/core'; + +const button = document.querySelector('#button'); +const tooltip = document.querySelector('#tooltip'); + +createPopper(button, tooltip, { + modifiers: [preventOverflow, flip], +}); +``` + +As you make more poppers, you may be finding yourself needing other modifiers +provided by the library. + +See [tree-shaking](https://popper.js.org/docs/v2/performance/#tree-shaking) for more +information. + +## Distribution targets + +Popper is distributed in 3 different versions, in 3 different file formats. + +The 3 file formats are: + +- `esm` (works with `import` syntax — **recommended**) +- `umd` (works with ` + + + + + + +
+
+ {% for cust in customers %} +
+

+ +

+
+
+
    +
  • Name: {{ cust['name'] }}
  • +
  • Id: {{ cust['id'] }}
  • +
  • Date of Birth: {{ cust['dateOfBirth'] }}
  • +
  • Email: {{ cust['email'] }}
  • +
  • Address: {{ cust['streetAddress'] }}
  • +
  • Profession: {{ cust['profession'] }}
  • +
  • Relationship: {{ cust['relationship'] }}
  • +
+
+
+
+ {% endfor %} +
+
+ + + + + + + + + \ No newline at end of file diff --git a/templates/template.html b/templates/template.html new file mode 100644 index 0000000..3676164 --- /dev/null +++ b/templates/template.html @@ -0,0 +1,17 @@ + + + + + + Customer DB + + + + + + + +> \ No newline at end of file