From 15357150d4350088d87079eea24d818257f638db Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Sat, 10 Jul 2021 16:55:55 +0530 Subject: [PATCH] New components --- Standard UI Components/.gitattributes | 2 + Standard UI Components/README.md | 83 +- Standard UI Components/_config.yml | 5 + Standard UI Components/components.js | 2480 ++++++------ Standard UI Components/components.min.js | 1 + Standard UI Components/components.ts | 3591 +++++++++++++++++ Standard UI Components/css/main.css | 713 +++- Standard UI Components/css/main.css.map | 10 +- Standard UI Components/css/main.min.css | 1 + Standard UI Components/css/main.scss | 577 ++- Standard UI Components/dist/button.js | 157 + Standard UI Components/dist/button.min.js | 1 + Standard UI Components/dist/carousel.js | 400 ++ Standard UI Components/dist/carousel.min.js | 1 + Standard UI Components/dist/checkbox.js | 196 + Standard UI Components/dist/checkbox.min.js | 1 + Standard UI Components/dist/copy.js | 112 + Standard UI Components/dist/copy.min.js | 1 + Standard UI Components/dist/file-input.js | 158 + Standard UI Components/dist/file-input.min.js | 1 + Standard UI Components/dist/form.js | 93 + Standard UI Components/dist/form.min.js | 1 + Standard UI Components/dist/input.js | 419 ++ Standard UI Components/dist/input.min.js | 1 + Standard UI Components/dist/menu.js | 291 ++ Standard UI Components/dist/menu.min.js | 1 + Standard UI Components/dist/notifications.js | 224 + .../dist/notifications.min.js | 1 + Standard UI Components/dist/popup.js | 360 ++ Standard UI Components/dist/popup.min.js | 1 + Standard UI Components/dist/radio.js | 185 + Standard UI Components/dist/radio.min.js | 1 + Standard UI Components/dist/select.js | 387 ++ Standard UI Components/dist/select.min.js | 1 + Standard UI Components/dist/strip-select.js | 324 ++ .../dist/strip-select.min.js | 1 + Standard UI Components/dist/switch.js | 228 ++ Standard UI Components/dist/switch.min.js | 1 + Standard UI Components/dist/tabs.js | 412 ++ Standard UI Components/dist/tabs.min.js | 1 + Standard UI Components/dist/tags-input.js | 207 + Standard UI Components/dist/tags-input.min.js | 1 + Standard UI Components/dist/textarea.js | 188 + Standard UI Components/dist/textarea.min.js | 1 + Standard UI Components/index.html | 1005 ++++- Standard UI Components/prettify.js | 46 + Standard UI Components/tsconfig.json | 11 + 47 files changed, 11078 insertions(+), 1805 deletions(-) create mode 100644 Standard UI Components/.gitattributes create mode 100644 Standard UI Components/_config.yml create mode 100644 Standard UI Components/components.min.js create mode 100644 Standard UI Components/components.ts create mode 100644 Standard UI Components/css/main.min.css create mode 100644 Standard UI Components/dist/button.js create mode 100644 Standard UI Components/dist/button.min.js create mode 100644 Standard UI Components/dist/carousel.js create mode 100644 Standard UI Components/dist/carousel.min.js create mode 100644 Standard UI Components/dist/checkbox.js create mode 100644 Standard UI Components/dist/checkbox.min.js create mode 100644 Standard UI Components/dist/copy.js create mode 100644 Standard UI Components/dist/copy.min.js create mode 100644 Standard UI Components/dist/file-input.js create mode 100644 Standard UI Components/dist/file-input.min.js create mode 100644 Standard UI Components/dist/form.js create mode 100644 Standard UI Components/dist/form.min.js create mode 100644 Standard UI Components/dist/input.js create mode 100644 Standard UI Components/dist/input.min.js create mode 100644 Standard UI Components/dist/menu.js create mode 100644 Standard UI Components/dist/menu.min.js create mode 100644 Standard UI Components/dist/notifications.js create mode 100644 Standard UI Components/dist/notifications.min.js create mode 100644 Standard UI Components/dist/popup.js create mode 100644 Standard UI Components/dist/popup.min.js create mode 100644 Standard UI Components/dist/radio.js create mode 100644 Standard UI Components/dist/radio.min.js create mode 100644 Standard UI Components/dist/select.js create mode 100644 Standard UI Components/dist/select.min.js create mode 100644 Standard UI Components/dist/strip-select.js create mode 100644 Standard UI Components/dist/strip-select.min.js create mode 100644 Standard UI Components/dist/switch.js create mode 100644 Standard UI Components/dist/switch.min.js create mode 100644 Standard UI Components/dist/tabs.js create mode 100644 Standard UI Components/dist/tabs.min.js create mode 100644 Standard UI Components/dist/tags-input.js create mode 100644 Standard UI Components/dist/tags-input.min.js create mode 100644 Standard UI Components/dist/textarea.js create mode 100644 Standard UI Components/dist/textarea.min.js create mode 100644 Standard UI Components/prettify.js create mode 100644 Standard UI Components/tsconfig.json diff --git a/Standard UI Components/.gitattributes b/Standard UI Components/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/Standard UI Components/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/Standard UI Components/README.md b/Standard UI Components/README.md index d646da4..ef4600e 100644 --- a/Standard UI Components/README.md +++ b/Standard UI Components/README.md @@ -51,7 +51,6 @@ Now you are ready to use them in your HTML markup as any other standard HMTL tag | [Carousel](#carousel) | | [Checkbox](#checkbox) | | [Input](#input) | -| [Menu](#menu) | | [Notifications](#notifications) | | [Popup](#popup) | | [Switch](#switch) | @@ -89,16 +88,19 @@ Variants are different stylistic versions of same component, But they have same #### Disabled State -These can disabled adding `disable` attribute. That makes them look in-active but they still will receive events. ***Thats why it's important to only use it's custom event to listen for click event*** more on that further. +These can disabled adding `disabled="true` attribute. That makes them look in-active but they still will receive events. ***Thats why it's important to only use it's custom event to listen for click event*** more on that further. ```html -Disabled +Disabled ``` #### Custom Events -1. `clicked` is a custom event specified for `sm-button` that listens to button being clicked like normal `click` event. The main difference being `click` event will fire even if `disable` is set as sm-button doesn't stop actual component from receiving pointer events. The reason being it has another event to handle disabled state. +1. `clicked` is a custom event specified for `sm-button` that listens to button being clicked like normal `click` event. The main difference being `click` event will fire even if `disabled="true"` is set as sm-button doesn't stop actual component from receiving pointer events. The reason being it has another event to handle disabled state. 2. `disabled` event fires when button is disabled and user tries to click on it. This event can be useful if you want to validate a form but user clicked submit before all data so you show message according to situation. +#### Is it ***Responsive***? + +No, As by default this is an inline element that means it won't strech accross whole horizontal space. But this behaviour can be changed that by following css. ```css sm-button{ width: 100%; @@ -166,22 +168,22 @@ This has two custom attributes `checked` and `disabled`. 1. Checked ```html - + ``` 2. disabled ```html - + ``` #### Disabled State -This component can disabled adding `disable` attribute. +This component can disabled adding `disabled="true` attribute. You can also have option to use both of these attributes at the same time. ```html - + ``` #### Supported Events @@ -205,7 +207,7 @@ let myCheckbox = document.getElementById('my_checkbox'); ``` ##### To set checked ```js -checkbox.checked = true +checkbox.checked="true" //or myCheckbox.setAttribute('checked', 'true') ``` @@ -213,9 +215,9 @@ Replace `"true"` with `"false"` to un-tick checkbox ##### To set disabled ```js -myCheckbox.disabled = true +myCheckbox.disabled="true" //or -myCheckbox.setAttribute('disable', '') +myCheckbox.setAttribute('disabled', 'true') ``` ### Input @@ -243,7 +245,9 @@ By default placeholder will disappear when input field has some value. All events supported by traditional input. +#### Is it ***Responsive***? +No, As by default this is an inline element that means it won't strech accross whole horizontal space. But this behaviour can be changed that by following css. ```css sm-input{ width: 100%; @@ -274,32 +278,6 @@ console.log(myInput.value) console.log(myInput.isValid) ``` -### Menu -[See Demo](https://sairaj-mote.github.io/components/) - -```html - -``` -You can add options using `` instead of `