create-basicjs 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/bin/create-basicjs.js +58 -5
- package/bin/verify-package.js +1 -1
- package/package.json +2 -2
- package/payload/projects/tauri/.github/workflows/build.yml +86 -0
- package/payload/projects/tauri/.github/workflows/tests.yml +87 -0
- package/payload/projects/tauri/AGENTS.md +128 -0
- package/payload/projects/tauri/CLAUDE.md +1 -0
- package/payload/projects/tauri/LICENSE +201 -0
- package/payload/projects/tauri/NOTICE +8 -0
- package/payload/projects/tauri/README.md +269 -0
- package/payload/projects/tauri/checks/window-check.js +189 -0
- package/payload/projects/tauri/gitignore +8 -0
- package/payload/projects/tauri/handbook/01-getting-started.md +188 -0
- package/payload/projects/tauri/handbook/02-the-project.md +264 -0
- package/payload/projects/tauri/handbook/03-the-page.md +260 -0
- package/payload/projects/tauri/handbook/04-commands.md +265 -0
- package/payload/projects/tauri/handbook/05-events-and-state.md +275 -0
- package/payload/projects/tauri/handbook/06-plugins.md +282 -0
- package/payload/projects/tauri/handbook/07-the-window-and-the-app.md +431 -0
- package/payload/projects/tauri/handbook/08-security.md +374 -0
- package/payload/projects/tauri/handbook/09-tests-and-checks.md +266 -0
- package/payload/projects/tauri/handbook/10-building-and-releasing.md +238 -0
- package/payload/projects/tauri/handbook/11-troubleshooting.md +259 -0
- package/payload/projects/tauri/handbook/README.md +125 -0
- package/payload/projects/tauri/handbook/turkce/01-getting-started.md +193 -0
- package/payload/projects/tauri/handbook/turkce/02-the-project.md +272 -0
- package/payload/projects/tauri/handbook/turkce/03-the-page.md +272 -0
- package/payload/projects/tauri/handbook/turkce/04-commands.md +271 -0
- package/payload/projects/tauri/handbook/turkce/05-events-and-state.md +284 -0
- package/payload/projects/tauri/handbook/turkce/06-plugins.md +286 -0
- package/payload/projects/tauri/handbook/turkce/07-the-window-and-the-app.md +433 -0
- package/payload/projects/tauri/handbook/turkce/08-security.md +384 -0
- package/payload/projects/tauri/handbook/turkce/09-tests-and-checks.md +275 -0
- package/payload/projects/tauri/handbook/turkce/10-building-and-releasing.md +241 -0
- package/payload/projects/tauri/handbook/turkce/11-troubleshooting.md +264 -0
- package/payload/projects/tauri/handbook/turkce/README.md +128 -0
- package/payload/projects/tauri/images/app.png +0 -0
- package/payload/projects/tauri/src-tauri/Cargo.lock +4389 -0
- package/payload/projects/tauri/src-tauri/Cargo.toml +31 -0
- package/payload/projects/tauri/src-tauri/app-icon.svg +16 -0
- package/payload/projects/tauri/src-tauri/build.rs +15 -0
- package/payload/projects/tauri/src-tauri/capabilities/default.json +7 -0
- package/payload/projects/tauri/src-tauri/gitignore +5 -0
- package/payload/projects/tauri/src-tauri/icons/128x128.png +0 -0
- package/payload/projects/tauri/src-tauri/icons/128x128@2x.png +0 -0
- package/payload/projects/tauri/src-tauri/icons/32x32.png +0 -0
- package/payload/projects/tauri/src-tauri/icons/icon.icns +0 -0
- package/payload/projects/tauri/src-tauri/icons/icon.ico +0 -0
- package/payload/projects/tauri/src-tauri/src/check.rs +144 -0
- package/payload/projects/tauri/src-tauri/src/files.rs +255 -0
- package/payload/projects/tauri/src-tauri/src/main.rs +45 -0
- package/payload/projects/tauri/src-tauri/src/sizes.rs +214 -0
- package/payload/projects/tauri/src-tauri/tauri.conf.json +44 -0
- package/payload/projects/tauri/src-tauri/tests/project.rs +243 -0
- package/payload/projects/tauri/ui/app.js +459 -0
- package/payload/projects/tauri/ui/backend.js +196 -0
- package/payload/projects/tauri/ui/basic/LICENSE +14 -0
- package/payload/projects/tauri/ui/basic/basic.min.css +1 -0
- package/payload/projects/tauri/ui/basic/basic.min.js +78 -0
- package/payload/projects/tauri/ui/basic/font/open-sans/LICENSE.txt +206 -0
- package/payload/projects/tauri/ui/basic/font/open-sans/OpenSans-Bold.ttf +0 -0
- package/payload/projects/tauri/ui/basic/font/open-sans/OpenSans-Regular.ttf +0 -0
- package/payload/projects/tauri/ui/basic/scroll-bar.min.js +3 -0
- package/payload/projects/tauri/ui/comp/_sources.txt +9 -0
- package/payload/projects/tauri/ui/comp/components.min.js +21 -0
- package/payload/projects/tauri/ui/index.html +28 -0
- package/payload/projects/tauri/ui/sizes.js +104 -0
- package/payload/starter/AGENTS.md +11 -6
- package/payload/starter/README.md +1 -1
- package/payload/starter/_basic/VERSION +1 -1
- package/payload/starter/_basic/assets/cards/almond-blossom.png +0 -0
- package/payload/starter/_basic/assets/cards/blackberry.png +0 -0
- package/payload/starter/_basic/assets/cards/borage.png +0 -0
- package/payload/starter/_basic/assets/cards/chamomile.png +0 -0
- package/payload/starter/_basic/assets/cards/dill.png +0 -0
- package/payload/starter/_basic/assets/cards/eucalyptus.png +0 -0
- package/payload/starter/_basic/assets/cards/fennel.png +0 -0
- package/payload/starter/_basic/assets/cards/fig.png +0 -0
- package/payload/starter/_basic/assets/cards/juniper.png +0 -0
- package/payload/starter/_basic/assets/cards/lavender.png +0 -0
- package/payload/starter/_basic/assets/cards/lemon.png +0 -0
- package/payload/starter/_basic/assets/cards/olives.png +0 -0
- package/payload/starter/_basic/assets/cards/oregano.png +0 -0
- package/payload/starter/_basic/assets/cards/pepper.png +0 -0
- package/payload/starter/_basic/assets/cards/physalis.png +0 -0
- package/payload/starter/_basic/assets/cards/pomegranate.png +0 -0
- package/payload/starter/_basic/assets/cards/poppy.png +0 -0
- package/payload/starter/_basic/assets/cards/rosehip.png +0 -0
- package/payload/starter/_basic/assets/cards/saffron.png +0 -0
- package/payload/starter/_basic/assets/categories/cappuccino.png +0 -0
- package/payload/starter/_basic/assets/categories/chocolate-milk.png +0 -0
- package/payload/starter/_basic/assets/categories/coffee.png +0 -0
- package/payload/starter/_basic/assets/categories/frappe.png +0 -0
- package/payload/starter/_basic/assets/categories/iced-caffee.png +0 -0
- package/payload/starter/_basic/assets/categories/milkshake.png +0 -0
- package/payload/starter/_basic/assets/categories/orange-juice.png +0 -0
- package/payload/starter/_basic/assets/categories/tea.png +0 -0
- package/payload/starter/_basic/assets/fruids/brokoli.png +0 -0
- package/payload/starter/_basic/assets/fruids/cilek.png +0 -0
- package/payload/starter/_basic/assets/fruids/domates.png +0 -0
- package/payload/starter/_basic/assets/fruids/elma.png +0 -0
- package/payload/starter/_basic/assets/fruids/havuc.png +0 -0
- package/payload/starter/_basic/assets/fruids/karpuz.png +0 -0
- package/payload/starter/_basic/assets/fruids/limon.png +0 -0
- package/payload/starter/_basic/assets/fruids/muz.png +0 -0
- package/payload/starter/_basic/assets/fruids/nar.png +0 -0
- package/payload/starter/_basic/assets/fruids/patlican.png +0 -0
- package/payload/starter/_basic/assets/fruids/yabanmersini.png +0 -0
- package/payload/starter/_basic/assets/fruids/yesilbiber.png +0 -0
- package/payload/starter/_basic/basic/LICENSE +1 -1
- package/payload/starter/_basic/basic/basic.css +3 -6
- package/payload/starter/_basic/basic/basic.js +154 -60
- package/payload/starter/_basic/basic/basic.min.js +19 -6
- package/payload/starter/_basic/basic/scroll-bar.js +4 -2
- package/payload/starter/_basic/basic/scroll-bar.min.js +1 -0
- package/payload/starter/_basic/comp/accordion.js +659 -0
- package/payload/starter/_basic/comp/action-button.js +22 -23
- package/payload/starter/_basic/comp/action-tab-bar.js +8 -8
- package/payload/starter/_basic/comp/app-bar.js +12 -11
- package/payload/starter/_basic/comp/{badge-v2.js → badge.js} +51 -5
- package/payload/starter/_basic/comp/bottom-bar.js +62 -26
- package/payload/starter/_basic/comp/breadcrumbs.js +4 -2
- package/payload/starter/_basic/comp/canvas.js +652 -0
- package/payload/starter/_basic/comp/chat-view.js +827 -0
- package/payload/starter/_basic/comp/check-box.js +137 -21
- package/payload/starter/_basic/comp/code-editor.js +1171 -0
- package/payload/starter/_basic/comp/{select-color.js → color-picker.js} +62 -29
- package/payload/starter/_basic/comp/context-menu.js +348 -31
- package/payload/starter/_basic/comp/{currency-input-b.js → currency-field.js} +48 -29
- package/payload/starter/_basic/comp/data-table.js +114 -42
- package/payload/starter/_basic/comp/{select-date.js → date-picker.js} +104 -52
- package/payload/starter/_basic/comp/dialog.js +214 -76
- package/payload/starter/_basic/comp/email-field.js +65 -0
- package/payload/starter/_basic/comp/{select-file.js → file-picker.js} +245 -57
- package/payload/starter/_basic/comp/filters.js +374 -60
- package/payload/starter/_basic/comp/form.js +38 -26
- package/payload/starter/_basic/comp/full-screen-select.js +36 -33
- package/payload/starter/_basic/comp/gauge.js +12 -8
- package/payload/starter/_basic/comp/graph-box.js +3911 -0
- package/payload/starter/_basic/comp/grid-group.js +185 -0
- package/payload/starter/_basic/comp/hold-to-confirm-button.js +16 -7
- package/payload/starter/_basic/comp/image-view.js +598 -0
- package/payload/starter/_basic/comp/item-list.js +507 -163
- package/payload/starter/_basic/comp/json-editor.js +3221 -0
- package/payload/starter/_basic/comp/json-view.js +597 -0
- package/payload/starter/_basic/comp/label-editor.js +22 -19
- package/payload/starter/_basic/comp/left-menu.js +89 -22
- package/payload/starter/_basic/comp/line-progress-bar.js +196 -45
- package/payload/starter/_basic/comp/loading-screen.js +49 -18
- package/payload/starter/_basic/comp/log-view.js +530 -0
- package/payload/starter/_basic/comp/{login-page-v2.js → login-page.js} +205 -106
- package/payload/starter/_basic/comp/markdown-view.js +1046 -0
- package/payload/starter/_basic/comp/menu-bar.js +624 -0
- package/payload/starter/_basic/comp/mini-graph-box.js +20 -11
- package/payload/starter/_basic/comp/minimal-accent.js +208 -0
- package/payload/starter/_basic/comp/notice.js +15 -13
- package/payload/starter/_basic/comp/{number-input-b.js → number-field.js} +26 -19
- package/payload/starter/_basic/comp/numeric-keyboard.js +15 -13
- package/payload/starter/_basic/comp/page-control.js +21 -4
- package/payload/starter/_basic/comp/page-header.js +7 -6
- package/payload/starter/_basic/comp/password-field.js +192 -0
- package/payload/starter/_basic/comp/period-bar.js +8 -7
- package/payload/starter/_basic/comp/{phone-input-b.js → phone-field.js} +80 -45
- package/payload/starter/_basic/comp/progress-bar.js +401 -85
- package/payload/starter/_basic/comp/property-panel.js +1022 -123
- package/payload/starter/_basic/comp/radio-button.js +79 -19
- package/payload/starter/_basic/comp/range-slider.js +569 -0
- package/payload/starter/_basic/comp/rich-text-editor.js +33 -30
- package/payload/starter/_basic/comp/scroll-area.js +308 -0
- package/payload/starter/_basic/comp/scrolling-text.js +10 -9
- package/payload/starter/_basic/comp/search-input.js +725 -0
- package/payload/starter/_basic/comp/search-results.js +60 -24
- package/payload/starter/_basic/comp/select-box.js +229 -107
- package/payload/starter/_basic/comp/settings-row.js +20 -19
- package/payload/starter/_basic/comp/side-panel.js +53 -10
- package/payload/starter/_basic/comp/slider-field.js +264 -88
- package/payload/starter/_basic/comp/slider.js +556 -86
- package/payload/starter/_basic/comp/smart-button.js +438 -353
- package/payload/starter/_basic/comp/smart-table.js +748 -186
- package/payload/starter/_basic/comp/sortable-list.js +47 -38
- package/payload/starter/_basic/comp/spark-line-box.js +25 -16
- package/payload/starter/_basic/comp/splitter.js +411 -0
- package/payload/starter/_basic/comp/status-bar.js +408 -0
- package/payload/starter/_basic/comp/step-bar.js +345 -0
- package/payload/starter/_basic/comp/stepper.js +103 -49
- package/payload/starter/_basic/comp/tabs.js +67 -18
- package/payload/starter/_basic/comp/tag-input.js +50 -10
- package/payload/starter/_basic/comp/tap-effect.js +6 -4
- package/payload/starter/_basic/comp/text-area-field.js +233 -0
- package/payload/starter/_basic/comp/text-field.js +1006 -0
- package/payload/starter/_basic/comp/time-line.js +102 -28
- package/payload/starter/_basic/comp/{select-time.js → time-picker.js} +104 -51
- package/payload/starter/_basic/comp/tiny-select.js +79 -39
- package/payload/starter/_basic/comp/tiny-table.js +12 -8
- package/payload/starter/_basic/comp/toast.js +87 -34
- package/payload/starter/_basic/comp/toggle.js +149 -28
- package/payload/starter/_basic/comp/tool-bar.js +760 -0
- package/payload/starter/_basic/comp/tooltip.js +80 -17
- package/payload/starter/_basic/comp/tree-view.js +124 -41
- package/payload/starter/_basic/comp/ui-effects.js +17 -11
- package/payload/starter/_basic/comp/ui-standards.js +5 -4
- package/payload/starter/_basic/comp/url-field.js +190 -0
- package/payload/starter/_basic/comp/web-view.js +70 -16
- package/payload/starter/_basic/docs/basic-js-animated-rules.md +15 -9
- package/payload/starter/_basic/docs/basic-js-code-rules.md +42 -5
- package/payload/starter/_basic/docs/basic-js-components.md +12 -17
- package/payload/starter/_basic/docs/basic-js-core.md +5 -4
- package/payload/starter/_basic/docs/component-index.md +248 -107
- package/payload/starter/_basic/docs/component-template.js +28 -24
- package/payload/starter/_basic/docs/handbook/00-introduction.md +6 -2
- package/payload/starter/_basic/docs/handbook/00-what-is-new.md +21 -0
- package/payload/starter/_basic/docs/handbook/01-label.md +4 -4
- package/payload/starter/_basic/docs/handbook/02-box.md +7 -7
- package/payload/starter/_basic/docs/handbook/03-image.md +4 -4
- package/payload/starter/_basic/docs/handbook/04-common-properties.md +6 -5
- package/payload/starter/_basic/docs/handbook/05-autolayout.md +8 -7
- package/payload/starter/_basic/docs/handbook/06-button.md +3 -3
- package/payload/starter/_basic/docs/handbook/07-input.md +3 -3
- package/payload/starter/_basic/docs/handbook/08-page.md +3 -3
- package/payload/starter/_basic/docs/handbook/09-useful-examples.md +39 -58
- package/payload/starter/_basic/docs/handbook/10-motion.md +6 -6
- package/payload/starter/_basic/docs/handbook/11-other-functions.md +1 -0
- package/payload/starter/_basic/docs/handbook/13-sound.md +3 -3
- package/payload/starter/_basic/docs/handbook/14-using-components.md +180 -0
- package/payload/starter/_basic/docs/handbook/15-making-a-component.md +338 -0
- package/payload/starter/_basic/docs/what-is-new.md +106 -0
- package/payload/starter/_basic/examples/accordion.htm +174 -0
- package/payload/starter/_basic/examples/action-button.htm +74 -32
- package/payload/starter/_basic/examples/action-tab-bar.htm +5 -6
- package/payload/starter/_basic/examples/app-bar.htm +63 -41
- package/payload/starter/_basic/examples/badge.htm +96 -0
- package/payload/starter/_basic/examples/bottom-bar-2.htm +61 -48
- package/payload/starter/_basic/examples/bottom-bar.htm +74 -16
- package/payload/starter/_basic/examples/breadcrumbs.htm +160 -150
- package/payload/starter/_basic/examples/canvas.htm +190 -0
- package/payload/starter/_basic/examples/chat-view.htm +143 -0
- package/payload/starter/_basic/examples/check-box-2.htm +71 -82
- package/payload/starter/_basic/examples/check-box-3.htm +72 -83
- package/payload/starter/_basic/examples/check-box.htm +207 -0
- package/payload/starter/_basic/examples/code-editor-2.htm +259 -0
- package/payload/starter/_basic/examples/code-editor.htm +272 -0
- package/payload/starter/_basic/examples/color-picker.htm +206 -0
- package/payload/starter/_basic/examples/context-menu.htm +180 -139
- package/payload/starter/_basic/examples/currency-field.htm +105 -0
- package/payload/starter/_basic/examples/data-table-2.htm +2 -1
- package/payload/starter/_basic/examples/data-table-3.htm +1 -1
- package/payload/starter/_basic/examples/data-table-4.htm +15 -12
- package/payload/starter/_basic/examples/data-table-5.htm +11 -3
- package/payload/starter/_basic/examples/data-table.htm +90 -40
- package/payload/starter/_basic/examples/date-picker.htm +239 -0
- package/payload/starter/_basic/examples/dialog-centered.htm +394 -40
- package/payload/starter/_basic/examples/dialog.htm +267 -46
- package/payload/starter/_basic/examples/email-field.htm +102 -0
- package/payload/starter/_basic/examples/file-picker.htm +296 -0
- package/payload/starter/_basic/examples/filters.htm +33 -22
- package/payload/starter/_basic/examples/{form-1.htm → form.htm} +18 -19
- package/payload/starter/_basic/examples/full-screen-select.htm +81 -58
- package/payload/starter/_basic/examples/gallery-styled.htm +896 -0
- package/payload/starter/_basic/examples/gauge.htm +95 -81
- package/payload/starter/_basic/examples/graph-box.htm +365 -0
- package/payload/starter/_basic/examples/grid-group.htm +179 -0
- package/payload/starter/_basic/examples/hold-to-confirm-button.htm +102 -113
- package/payload/starter/_basic/examples/image-view.htm +195 -0
- package/payload/starter/_basic/examples/item-list-2.htm +138 -94
- package/payload/starter/_basic/examples/item-list.htm +191 -86
- package/payload/starter/_basic/examples/json-editor.htm +206 -0
- package/payload/starter/_basic/examples/json-view.htm +153 -0
- package/payload/starter/_basic/examples/label-editor.htm +85 -89
- package/payload/starter/_basic/examples/left-menu-2.htm +93 -0
- package/payload/starter/_basic/examples/left-menu.htm +42 -37
- package/payload/starter/_basic/examples/line-progress-bar.htm +155 -114
- package/payload/starter/_basic/examples/loading-screen.htm +149 -125
- package/payload/starter/_basic/examples/log-view.htm +175 -0
- package/payload/starter/_basic/examples/{login-page-dark-v2.htm → login-page-dark.htm} +265 -267
- package/payload/starter/_basic/examples/{login-page-v2.htm → login-page.htm} +266 -267
- package/payload/starter/_basic/examples/markdown-view.htm +220 -0
- package/payload/starter/_basic/examples/menu-bar-2.htm +225 -0
- package/payload/starter/_basic/examples/menu-bar.htm +145 -0
- package/payload/starter/_basic/examples/mini-graph-box.htm +98 -109
- package/payload/starter/_basic/examples/minimal-accent.htm +196 -0
- package/payload/starter/_basic/examples/minimal-theme.htm +432 -0
- package/payload/starter/_basic/examples/notice.htm +13 -4
- package/payload/starter/_basic/examples/number-field.htm +103 -0
- package/payload/starter/_basic/examples/numeric-keyboard.htm +44 -42
- package/payload/starter/_basic/examples/page-control.htm +181 -130
- package/payload/starter/_basic/examples/page-header.htm +57 -30
- package/payload/starter/_basic/examples/password-field.htm +117 -0
- package/payload/starter/_basic/examples/period-bar.htm +43 -29
- package/payload/starter/_basic/examples/phone-field-select-country.htm +292 -0
- package/payload/starter/_basic/examples/phone-field.htm +104 -0
- package/payload/starter/_basic/examples/progress-bar-ozden.htm +229 -92
- package/payload/starter/_basic/examples/progress-bar.htm +222 -174
- package/payload/starter/_basic/examples/property-panel.htm +152 -52
- package/payload/starter/_basic/examples/radio-button-2.htm +101 -109
- package/payload/starter/_basic/examples/radio-button-3.htm +81 -71
- package/payload/starter/_basic/examples/radio-button.htm +289 -0
- package/payload/starter/_basic/examples/range-slider.htm +171 -0
- package/payload/starter/_basic/examples/rich-text-editor.htm +115 -110
- package/payload/starter/_basic/examples/scroll-area.htm +293 -0
- package/payload/starter/_basic/examples/scrolling-text.htm +27 -6
- package/payload/starter/_basic/examples/search-input-2-light.htm +112 -0
- package/payload/starter/_basic/examples/search-input-3-dark.htm +105 -0
- package/payload/starter/_basic/examples/{search-input-v2-place.htm → search-input-place.htm} +25 -26
- package/payload/starter/_basic/examples/search-input.htm +159 -0
- package/payload/starter/_basic/examples/search-results.htm +85 -88
- package/payload/starter/_basic/examples/select-box-2-item-view.htm +304 -0
- package/payload/starter/_basic/examples/select-box-ozden-dark-text.htm +70 -0
- package/payload/starter/_basic/examples/select-box-ozden-item.htm +6 -5
- package/payload/starter/_basic/examples/select-box-ozden-text.htm +5 -3
- package/payload/starter/_basic/examples/select-box.htm +190 -159
- package/payload/starter/_basic/examples/settings-row.htm +92 -43
- package/payload/starter/_basic/examples/side-panel-2.htm +63 -25
- package/payload/starter/_basic/examples/side-panel.htm +84 -70
- package/payload/starter/_basic/examples/slider-2-split.htm +186 -0
- package/payload/starter/_basic/examples/slider-field-ozden.htm +286 -0
- package/payload/starter/_basic/examples/slider-field.htm +174 -134
- package/payload/starter/_basic/examples/slider.htm +257 -180
- package/payload/starter/_basic/examples/smart-button-3-ozden.htm +170 -257
- package/payload/starter/_basic/examples/smart-button-4-dark.htm +86 -47
- package/payload/starter/_basic/examples/smart-button-5-features.htm +130 -125
- package/payload/starter/_basic/examples/smart-button-alternatif.htm +266 -0
- package/payload/starter/_basic/examples/smart-button.htm +207 -174
- package/payload/starter/_basic/examples/smart-table-2.htm +43 -56
- package/payload/starter/_basic/examples/smart-table-3.htm +148 -113
- package/payload/starter/_basic/examples/smart-table-4.htm +37 -50
- package/payload/starter/_basic/examples/{smart-table-1.htm → smart-table-5.htm} +37 -48
- package/payload/starter/_basic/examples/smart-table.htm +183 -0
- package/payload/starter/_basic/examples/sortable-list.htm +191 -142
- package/payload/starter/_basic/examples/spark-line-box.htm +149 -161
- package/payload/starter/_basic/examples/splitter.htm +164 -0
- package/payload/starter/_basic/examples/status-bar.htm +166 -0
- package/payload/starter/_basic/examples/step-bar.htm +129 -0
- package/payload/starter/_basic/examples/stepper-2.htm +86 -58
- package/payload/starter/_basic/examples/stepper.htm +146 -135
- package/payload/starter/_basic/examples/tabs-2.htm +58 -67
- package/payload/starter/_basic/examples/tabs.htm +197 -180
- package/payload/starter/_basic/examples/tag-input.htm +150 -153
- package/payload/starter/_basic/examples/tap-effect.htm +23 -19
- package/payload/starter/_basic/examples/text-area-field.htm +104 -0
- package/payload/starter/_basic/examples/text-field-2.htm +113 -0
- package/payload/starter/_basic/examples/text-field-3-style.htm +105 -0
- package/payload/starter/_basic/examples/text-field-4-custom-unit.htm +96 -0
- package/payload/starter/_basic/examples/{input-b-ex5-warning-icon.htm → text-field-5-warning-icon.htm} +19 -19
- package/payload/starter/_basic/examples/text-field-6-modern-dark.htm +114 -0
- package/payload/starter/_basic/examples/text-field-7-modern.htm +106 -0
- package/payload/starter/_basic/examples/text-field-8-light-dark.htm +159 -0
- package/payload/starter/_basic/examples/text-field.htm +163 -0
- package/payload/starter/_basic/examples/time-line.htm +180 -116
- package/payload/starter/_basic/examples/time-picker.htm +240 -0
- package/payload/starter/_basic/examples/tiny-select.htm +118 -86
- package/payload/starter/_basic/examples/tiny-table.htm +40 -34
- package/payload/starter/_basic/examples/toast.htm +145 -147
- package/payload/starter/_basic/examples/toggle-2.htm +99 -68
- package/payload/starter/_basic/examples/toggle-3.htm +104 -101
- package/payload/starter/_basic/examples/toggle.htm +161 -93
- package/payload/starter/_basic/examples/tool-bar.htm +172 -0
- package/payload/starter/_basic/examples/tooltip-2.htm +110 -60
- package/payload/starter/_basic/examples/tooltip-3.htm +124 -65
- package/payload/starter/_basic/examples/tooltip-4.htm +218 -0
- package/payload/starter/_basic/examples/tooltip.htm +206 -124
- package/payload/starter/_basic/examples/tree-view.htm +210 -182
- package/payload/starter/_basic/examples/ui-effects.htm +207 -185
- package/payload/starter/_basic/examples/ui-standards.htm +200 -139
- package/payload/starter/_basic/examples/url-field.htm +120 -0
- package/payload/starter/_basic/examples/web-view.htm +109 -110
- package/payload/starter/_basic/min/accordion.min.js +2 -0
- package/payload/starter/_basic/min/action-button.min.js +1 -1
- package/payload/starter/_basic/min/app-bar.min.js +1 -1
- package/payload/starter/_basic/min/badge.min.js +2 -0
- package/payload/starter/_basic/min/bottom-bar.min.js +1 -1
- package/payload/starter/_basic/min/canvas.min.js +2 -0
- package/payload/starter/_basic/min/chat-view.min.js +2 -0
- package/payload/starter/_basic/min/check-box.min.js +1 -1
- package/payload/starter/_basic/min/code-editor.min.js +2 -0
- package/payload/starter/_basic/min/color-picker.min.js +2 -0
- package/payload/starter/_basic/min/context-menu.min.js +1 -1
- package/payload/starter/_basic/min/currency-field.min.js +2 -0
- package/payload/starter/_basic/min/data-table.min.js +1 -1
- package/payload/starter/_basic/min/date-picker.min.js +2 -0
- package/payload/starter/_basic/min/dialog.min.js +1 -1
- package/payload/starter/_basic/min/email-field.min.js +2 -0
- package/payload/starter/_basic/min/file-picker.min.js +2 -0
- package/payload/starter/_basic/min/filters.min.js +1 -1
- package/payload/starter/_basic/min/form.min.js +1 -1
- package/payload/starter/_basic/min/full-screen-select.min.js +1 -1
- package/payload/starter/_basic/min/gauge.min.js +1 -1
- package/payload/starter/_basic/min/graph-box.min.js +2 -0
- package/payload/starter/_basic/min/grid-group.min.js +2 -0
- package/payload/starter/_basic/min/hold-to-confirm-button.min.js +1 -1
- package/payload/starter/_basic/min/image-view.min.js +2 -0
- package/payload/starter/_basic/min/item-list.min.js +1 -1
- package/payload/starter/_basic/min/json-editor.min.js +2 -0
- package/payload/starter/_basic/min/json-view.min.js +2 -0
- package/payload/starter/_basic/min/label-editor.min.js +1 -1
- package/payload/starter/_basic/min/left-menu.min.js +1 -1
- package/payload/starter/_basic/min/line-progress-bar.min.js +1 -1
- package/payload/starter/_basic/min/loading-screen.min.js +1 -1
- package/payload/starter/_basic/min/log-view.min.js +2 -0
- package/payload/starter/_basic/min/login-page.min.js +2 -0
- package/payload/starter/_basic/min/markdown-view.min.js +2 -0
- package/payload/starter/_basic/min/menu-bar.min.js +2 -0
- package/payload/starter/_basic/min/mini-graph-box.min.js +1 -1
- package/payload/starter/_basic/min/minimal-accent.min.js +2 -0
- package/payload/starter/_basic/min/notice.min.js +1 -1
- package/payload/starter/_basic/min/number-field.min.js +2 -0
- package/payload/starter/_basic/min/numeric-keyboard.min.js +1 -1
- package/payload/starter/_basic/min/page-control.min.js +1 -1
- package/payload/starter/_basic/min/password-field.min.js +2 -0
- package/payload/starter/_basic/min/phone-field.min.js +2 -0
- package/payload/starter/_basic/min/progress-bar.min.js +1 -1
- package/payload/starter/_basic/min/property-panel.min.js +1 -1
- package/payload/starter/_basic/min/radio-button.min.js +1 -1
- package/payload/starter/_basic/min/range-slider.min.js +2 -0
- package/payload/starter/_basic/min/rich-text-editor.min.js +1 -1
- package/payload/starter/_basic/min/scroll-area.min.js +2 -0
- package/payload/starter/_basic/min/scrolling-text.min.js +1 -1
- package/payload/starter/_basic/min/search-input.min.js +2 -0
- package/payload/starter/_basic/min/search-results.min.js +1 -1
- package/payload/starter/_basic/min/select-box.min.js +1 -1
- package/payload/starter/_basic/min/settings-row.min.js +1 -1
- package/payload/starter/_basic/min/side-panel.min.js +1 -1
- package/payload/starter/_basic/min/slider-field.min.js +1 -1
- package/payload/starter/_basic/min/slider.min.js +1 -1
- package/payload/starter/_basic/min/smart-button.min.js +1 -1
- package/payload/starter/_basic/min/smart-table.min.js +1 -1
- package/payload/starter/_basic/min/sortable-list.min.js +1 -1
- package/payload/starter/_basic/min/spark-line-box.min.js +1 -1
- package/payload/starter/_basic/min/splitter.min.js +2 -0
- package/payload/starter/_basic/min/status-bar.min.js +2 -0
- package/payload/starter/_basic/min/step-bar.min.js +2 -0
- package/payload/starter/_basic/min/stepper.min.js +1 -1
- package/payload/starter/_basic/min/tabs.min.js +1 -1
- package/payload/starter/_basic/min/tag-input.min.js +1 -1
- package/payload/starter/_basic/min/text-area-field.min.js +2 -0
- package/payload/starter/_basic/min/text-field.min.js +2 -0
- package/payload/starter/_basic/min/time-line.min.js +1 -1
- package/payload/starter/_basic/min/time-picker.min.js +2 -0
- package/payload/starter/_basic/min/tiny-select.min.js +1 -1
- package/payload/starter/_basic/min/toast.min.js +1 -1
- package/payload/starter/_basic/min/toggle.min.js +1 -1
- package/payload/starter/_basic/min/tool-bar.min.js +2 -0
- package/payload/starter/_basic/min/tooltip.min.js +1 -1
- package/payload/starter/_basic/min/tree-view.min.js +1 -1
- package/payload/starter/_basic/min/ui-effects.min.js +1 -1
- package/payload/starter/_basic/min/url-field.min.js +2 -0
- package/payload/starter/_basic/min/web-view.min.js +1 -1
- package/payload/templates/booking/app/app.js +11 -8
- package/payload/templates/booking/app/settings.js +4 -4
- package/payload/templates/booking/index.htm +3 -3
- package/payload/templates/booking/pages/account.js +6 -6
- package/payload/templates/booking/pages/book.js +1 -1
- package/payload/templates/booking/pages/services.js +5 -4
- package/payload/templates/classic/app/app.js +15 -11
- package/payload/templates/classic/app/settings.js +22 -20
- package/payload/templates/classic/assets/_attribute.txt +2 -0
- package/payload/templates/classic/assets/cards/dill.png +0 -0
- package/payload/templates/classic/assets/cards/fennel.png +0 -0
- package/payload/templates/classic/assets/cards/juniper.png +0 -0
- package/payload/templates/classic/assets/cards/olives.png +0 -0
- package/payload/templates/classic/assets/cards/oregano.png +0 -0
- package/payload/templates/classic/assets/cards/pepper.png +0 -0
- package/payload/templates/classic/assets/cards/rosehip.png +0 -0
- package/payload/templates/classic/assets/categories/cappuccino.png +0 -0
- package/payload/templates/classic/assets/categories/chocolate-milk.png +0 -0
- package/payload/templates/classic/assets/categories/coffee.png +0 -0
- package/payload/templates/classic/assets/categories/frappe.png +0 -0
- package/payload/templates/classic/assets/categories/iced-caffee.png +0 -0
- package/payload/templates/classic/assets/categories/milkshake.png +0 -0
- package/payload/templates/classic/assets/categories/orange-juice.png +0 -0
- package/payload/templates/classic/assets/categories/tea.png +0 -0
- package/payload/templates/classic/index.htm +2 -2
- package/payload/templates/classic/pages/example.js +10 -10
- package/payload/templates/classic/pages/examples.js +44 -43
- package/payload/templates/classic/pages/home.js +16 -15
- package/payload/templates/classic/pages/info-pages.js +5 -5
- package/payload/templates/classic/pages/search.js +8 -7
- package/payload/templates/classic/pages/settings.js +13 -13
- package/payload/templates/classic/pages/tasks.js +1 -0
- package/payload/templates/classic/pages/template-pages.js +12 -11
- package/payload/templates/coffee-shop/app/app.js +12 -8
- package/payload/templates/coffee-shop/app/settings.js +4 -4
- package/payload/templates/coffee-shop/index.htm +3 -3
- package/payload/templates/coffee-shop/pages/drink.js +1 -1
- package/payload/templates/coffee-shop/pages/menu.js +5 -4
- package/payload/templates/forms/TEMPLATE.md +1 -1
- package/payload/templates/forms/appointment-form.htm +55 -53
- package/payload/templates/forms/contact-form-to-mail.htm +38 -37
- package/payload/templates/forms/contact-form-to-supabase.htm +47 -46
- package/payload/templates/forms/dark-contact-form.htm +43 -40
- package/payload/templates/forms/event-registration-form.htm +80 -77
- package/payload/templates/forms/feedback-form.htm +54 -54
- package/payload/templates/forms/order-form.htm +88 -84
- package/payload/templates/forms/recruitment-form.htm +60 -60
- package/payload/templates/forms/service/readme.md +9 -8
- package/payload/templates/forms/service/send-form-mail.php +38 -21
- package/payload/templates/forms/support-ticket-form.htm +67 -65
- package/payload/templates/panel/common/module-page.js +2 -2
- package/payload/templates/panel/common/theme.js +37 -10
- package/payload/templates/panel/common/top-bar.js +45 -40
- package/payload/templates/panel/index.htm +59 -60
- package/payload/templates/panel/module10/greenhouse.htm +98 -113
- package/payload/templates/panel/module11/arduino-projects.htm +47 -58
- package/payload/templates/panel/module6/energy-hub.htm +71 -103
- package/payload/templates/panel/module7/3d-printers.htm +58 -81
- package/payload/templates/panel/module8/cold-rooms.htm +58 -79
- package/payload/templates/panel/module9/elevator-fleet.htm +72 -93
- package/payload/templates/panel/pages/activity.js +134 -152
- package/payload/templates/panel/pages/contents.js +291 -308
- package/payload/templates/panel/pages/customers.js +250 -267
- package/payload/templates/panel/pages/edit-user.js +31 -30
- package/payload/templates/panel/pages/home.js +39 -70
- package/payload/templates/panel/pages/media.js +166 -183
- package/payload/templates/panel/pages/notifications.js +7 -7
- package/payload/templates/panel/pages/orders.js +200 -217
- package/payload/templates/panel/pages/products.js +259 -278
- package/payload/templates/panel/pages/reports.js +74 -123
- package/payload/templates/panel/pages/roles.js +57 -60
- package/payload/templates/panel/pages/settings.js +127 -143
- package/payload/templates/panel/pages/user-actions.js +106 -110
- package/payload/templates/panel/pages/user-list.js +221 -238
- package/payload/templates/panel/pages/users.js +14 -29
- package/payload/templates/shop/TEMPLATE.md +1 -1
- package/payload/templates/shop/app/app.js +11 -8
- package/payload/templates/shop/app/settings.js +4 -4
- package/payload/templates/shop/index.htm +3 -3
- package/payload/templates/shop/pages/account.js +7 -7
- package/payload/templates/shop/pages/cart.js +1 -1
- package/payload/templates/shop/pages/checkout.js +2 -2
- package/payload/templates/shop/pages/product.js +2 -2
- package/payload/templates/shop/pages/shop.js +6 -5
- package/payload/templates/starter/TEMPLATE.md +1 -1
- package/payload/templates/starter/app/app.js +12 -8
- package/payload/templates/starter/app/settings.js +14 -11
- package/payload/templates/starter/index.htm +3 -3
- package/payload/templates/starter/pages/about.js +1 -1
- package/payload/templates/starter/pages/home.js +2 -2
- package/payload/templates/starter/pages/product.js +1 -1
- package/payload/templates/starter/pages/products.js +5 -5
- package/payload/templates/starter/pages/settings.js +1 -1
- package/payload/templates/starter/pages/tasks.js +8 -8
- package/payload/templates/starter/pages/website.js +1 -1
- package/payload/starter/_basic/comp/chart-box/chart-4.5.1.umd.min.js +0 -13
- package/payload/starter/_basic/comp/chart-box/chart-js-LICENSE.md +0 -9
- package/payload/starter/_basic/comp/chart-box.js +0 -868
- package/payload/starter/_basic/comp/email-input-b.js +0 -57
- package/payload/starter/_basic/comp/input-b.js +0 -759
- package/payload/starter/_basic/comp/password-input-b.js +0 -164
- package/payload/starter/_basic/comp/search-input-v2.js +0 -427
- package/payload/starter/_basic/comp/textarea-b.js +0 -184
- package/payload/starter/_basic/comp/url-input-b.js +0 -145
- package/payload/starter/_basic/examples/badgeV2.htm +0 -68
- package/payload/starter/_basic/examples/chart-box.htm +0 -287
- package/payload/starter/_basic/examples/check-box-1.htm +0 -220
- package/payload/starter/_basic/examples/currency-input-b.htm +0 -71
- package/payload/starter/_basic/examples/email-input-b.htm +0 -67
- package/payload/starter/_basic/examples/input-b-ex1.htm +0 -132
- package/payload/starter/_basic/examples/input-b-ex2.htm +0 -136
- package/payload/starter/_basic/examples/input-b-ex3-style.htm +0 -113
- package/payload/starter/_basic/examples/input-b-ex4-custom-unit.htm +0 -112
- package/payload/starter/_basic/examples/input-b-ex6-dark.htm +0 -108
- package/payload/starter/_basic/examples/input-b-ex7-ozden.htm +0 -153
- package/payload/starter/_basic/examples/number-input-b.htm +0 -68
- package/payload/starter/_basic/examples/password-input-b.htm +0 -70
- package/payload/starter/_basic/examples/phone-input-b-select-country.htm +0 -298
- package/payload/starter/_basic/examples/phone-input-b.htm +0 -72
- package/payload/starter/_basic/examples/radio-button-1.htm +0 -264
- package/payload/starter/_basic/examples/search-input-v2-ozden.htm +0 -128
- package/payload/starter/_basic/examples/search-input-v2.htm +0 -65
- package/payload/starter/_basic/examples/select-color.htm +0 -215
- package/payload/starter/_basic/examples/select-date.htm +0 -244
- package/payload/starter/_basic/examples/select-file.htm +0 -268
- package/payload/starter/_basic/examples/select-time.htm +0 -249
- package/payload/starter/_basic/examples/smart-button-2.htm +0 -220
- package/payload/starter/_basic/examples/textarea-b.htm +0 -76
- package/payload/starter/_basic/examples/unfinished-login-page-dark-supabase.htm +0 -221
- package/payload/starter/_basic/examples/unfinished-login-page-supabase.htm +0 -221
- package/payload/starter/_basic/examples/url-input-b.htm +0 -85
- package/payload/starter/_basic/min/badge-v2.min.js +0 -2
- package/payload/starter/_basic/min/chart-box.min.js +0 -2
- package/payload/starter/_basic/min/currency-input-b.min.js +0 -2
- package/payload/starter/_basic/min/email-input-b.min.js +0 -2
- package/payload/starter/_basic/min/input-b.min.js +0 -2
- package/payload/starter/_basic/min/login-page-v2.min.js +0 -2
- package/payload/starter/_basic/min/number-input-b.min.js +0 -2
- package/payload/starter/_basic/min/password-input-b.min.js +0 -2
- package/payload/starter/_basic/min/phone-input-b.min.js +0 -2
- package/payload/starter/_basic/min/search-input-v2.min.js +0 -2
- package/payload/starter/_basic/min/select-color.min.js +0 -2
- package/payload/starter/_basic/min/select-date.min.js +0 -2
- package/payload/starter/_basic/min/select-file.min.js +0 -2
- package/payload/starter/_basic/min/select-time.min.js +0 -2
- package/payload/starter/_basic/min/textarea-b.min.js +0 -2
- package/payload/starter/_basic/min/url-input-b.min.js +0 -2
- package/payload/templates/panel/common/bridge.min.js +0 -0
- package/payload/templates/panel/common/full-view.min.js +0 -1
- package/payload/templates/panel/common/main-view.min.js +0 -1
- package/payload/templates/panel/common/module-page.min.js +0 -1
- package/payload/templates/panel/common/right-view.min.js +0 -1
- package/payload/templates/panel/common/start-page.min.js +0 -1
- package/payload/templates/panel/common/top-bar-v25-07-29-1.js +0 -330
- package/payload/templates/panel/common/top-bar-v25-07-29-2.js +0 -265
- package/payload/templates/panel/common/top-bar.min.js +0 -1
- package/payload/templates/panel/common/ui-standards.min.js +0 -1
- package/payload/templates/panel/managers/database.min.js +0 -1
- package/payload/templates/panel/managers/login.min.js +0 -1
- package/payload/templates/panel/pages/_page-template.min.js +0 -1
- package/payload/templates/panel/pages/contents.min.js +0 -1
- package/payload/templates/panel/pages/edit-user.min.js +0 -1
- package/payload/templates/panel/pages/edit-users-table.min.js +0 -1
- package/payload/templates/panel/pages/home.min.js +0 -1
- package/payload/templates/panel/pages/notifications.min.js +0 -1
- package/payload/templates/panel/pages/reports.min.js +0 -1
- package/payload/templates/panel/pages/settings.min.js +0 -1
- package/payload/templates/panel/pages/user-actions.min.js +0 -2
- package/payload/templates/panel/pages/users.min.js +0 -1
- /package/payload/starter/_basic/comp/{password-input-b → password-field}/hide-btn.png +0 -0
- /package/payload/starter/_basic/comp/{password-input-b → password-field}/hide-btn2.png +0 -0
- /package/payload/starter/_basic/comp/{password-input-b → password-field}/show-btn.png +0 -0
- /package/payload/starter/_basic/comp/{password-input-b → password-field}/show-btn2.png +0 -0
- /package/payload/starter/_basic/comp/{search-input-v2 → search-input}/clear-round.svg +0 -0
- /package/payload/starter/_basic/comp/{search-input-v2 → search-input}/clear.svg +0 -0
- /package/payload/starter/_basic/comp/{search-input-v2 → search-input}/filter.png +0 -0
- /package/payload/starter/_basic/comp/{search-input-v2 → search-input}/filter.svg +0 -0
- /package/payload/starter/_basic/comp/{search-input-v2 → search-input}/search.svg +0 -0
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
Tabs - v26.10
|
|
6
6
|
|
|
7
7
|
UI COMPONENT TEMPLATE
|
|
8
|
+
- THE CONTENT OF THE TABS (new pages): Tabs is the bar; the pages under it are a PageControl (comp/page-control.js),
|
|
9
|
+
one page for each tab with the same key, and the onChange of the tabs opens it:
|
|
10
|
+
const pages = PageControl({ width: "100%", height: 400, transition: "fade", pages: ["home", "orders"] });
|
|
11
|
+
Tabs({ tabs: ["home", "orders"], value: "home", onChange: (self) => pages.open(self.value) });
|
|
12
|
+
PageControl gives the pages their motion (slide, fade), hides the inactive ones from the keyboard and the screen
|
|
13
|
+
readers and can be swiped. (panels: 1 stays for the pages made with it.)
|
|
8
14
|
- A tab bar: one tab is active, the others can be clicked. An animated indicator moves to the active tab.
|
|
9
15
|
- Variants: "underline" (a line under the active tab, default) and "pill" (a filled shape behind the active tab,
|
|
10
16
|
like a segmented control).
|
|
@@ -14,13 +20,13 @@ UI COMPONENT TEMPLATE
|
|
|
14
20
|
and the active tab is scrolled into view.
|
|
15
21
|
- fullWidth: 1 -> the tabs share the bar width equally.
|
|
16
22
|
- vertical: 1 -> the tabs are stacked (Ex: settings sections). The indicator is on the left side.
|
|
17
|
-
- panels: 1 -> a content Box for every tab under the bar. Only the active one is shown.
|
|
23
|
+
- panels: 1 -> a content Box for every tab under the bar. Only the active one is shown. (New pages: a PageControl, above.)
|
|
18
24
|
Fill a panel with setPanelContent(key, fn) or startPanel(key) ... endPanel(), or get it with getPanel(key).
|
|
19
25
|
- Keyboard: ArrowLeft / ArrowRight (ArrowUp / ArrowDown when vertical), Home, End move between the tabs. Enter / Space
|
|
20
26
|
activates, Delete closes a closable tab. Tab key moves the focus out of the bar (roving tabindex).
|
|
21
27
|
- Accessibility: tablist / tab / tabpanel roles, aria-selected, aria-controls.
|
|
22
28
|
- onChange is NOT called when the component is created or when the value is set with silent: 1.
|
|
23
|
-
- Style packages: "
|
|
29
|
+
- Style packages: "light" (default; the old name "classic" works too), "modern", "dark". Select with styleName. (Tabs.styles)
|
|
24
30
|
- Everything is drawn with code (no image files needed).
|
|
25
31
|
- scale: multiplies every size (the style, width / height / barWidth / panelHeight, the spaces in the code).
|
|
26
32
|
Its default is basic.uiScale: on a page fitted with page.fit() (basic.uiScale = 1 / page.zoom) the tabs keep
|
|
@@ -57,10 +63,12 @@ Tabs({ variant: "pill", tabs: ["Day", "Week", "Month"] });
|
|
|
57
63
|
Tabs({ vertical: 1, width: 200, tabs: ["General", "Security", "Billing"] });
|
|
58
64
|
|
|
59
65
|
Started Date: September 2026
|
|
60
|
-
Developer: Bugra Ozden
|
|
61
|
-
Email: bugra.ozden@gmail.com
|
|
62
66
|
Webpage: https://bug7a.github.io/js-components/
|
|
63
67
|
|
|
68
|
+
Copyright 2020-2026 Bugra Ozden <bugra.ozden@gmail.com> (https://bug7a.github.io/)
|
|
69
|
+
Licensed under the Apache License, Version 2.0
|
|
70
|
+
SPDX-License-Identifier: Apache-2.0
|
|
71
|
+
|
|
64
72
|
*/
|
|
65
73
|
|
|
66
74
|
"use strict";
|
|
@@ -87,8 +95,8 @@ const TabsDefaults = {
|
|
|
87
95
|
onChange: function (self) { }, // self.value, self.previousValue, self.getActiveTab()
|
|
88
96
|
onClose: function (self, tab) { }, // Return false to keep the tab.
|
|
89
97
|
onAdd: function (self) { },
|
|
90
|
-
styleName: "
|
|
91
|
-
style: { //
|
|
98
|
+
styleName: "light", // "light" ("classic": its old name), "modern", "dark", "minimal", "minimalDark" or a name added to Tabs.styles
|
|
99
|
+
style: { // Light style package (default)
|
|
92
100
|
bar: { // Underline variant
|
|
93
101
|
color: "transparent",
|
|
94
102
|
padding: [0, 0], // [x, y]
|
|
@@ -196,7 +204,7 @@ const TabsDefaults = {
|
|
|
196
204
|
|
|
197
205
|
const Tabs = function (params = {}) {
|
|
198
206
|
|
|
199
|
-
// Merge style package: params.style > Tabs.styles[styleName] > TabsDefaults.style (
|
|
207
|
+
// Merge style package: params.style > Tabs.styles[styleName] > TabsDefaults.style (light)
|
|
200
208
|
basic.applyStylePackage(params, Tabs.styles, TabsDefaults);
|
|
201
209
|
|
|
202
210
|
// Merge params:
|
|
@@ -224,7 +232,9 @@ const Tabs = function (params = {}) {
|
|
|
224
232
|
const isFullWidth = basic.isOn(box.fullWidth);
|
|
225
233
|
let items = []; // [{ tab, group, label, countLabel, badgeDot, closeButton, icon, panel, isHovered }]
|
|
226
234
|
let panelStack = []; // startPanel() / endPanel()
|
|
227
|
-
let
|
|
235
|
+
let isIndicatorMoving = 0; // the indicator moves with a motion (startIndicatorMotion: the first change of the tab)
|
|
236
|
+
let isFirstViewDone = 0; // the bar has been drawn once
|
|
237
|
+
let shownValue = null; // the tab the indicator shows
|
|
228
238
|
const scale = box.scale; // The px of the code below are multiplied by it, like the style.
|
|
229
239
|
const SCROLL_SPACE_X = 24 * scale; // Space next to the active tab when the strip scrolls to it.
|
|
230
240
|
const SCROLL_SPACE_Y = 8 * scale;
|
|
@@ -360,13 +370,16 @@ const Tabs = function (params = {}) {
|
|
|
360
370
|
indicator.color = item.tab.selectedColor || indicatorColor;
|
|
361
371
|
indicator.opacity = 1;
|
|
362
372
|
|
|
363
|
-
|
|
364
|
-
if (!isIndicatorReady) {
|
|
365
|
-
isIndicatorReady = 1;
|
|
366
|
-
indicator.elem.offsetWidth;
|
|
367
|
-
indicator.setMotionNow(getIndicatorMotion());
|
|
368
|
-
}
|
|
373
|
+
};
|
|
369
374
|
|
|
375
|
+
// The indicator moves with a motion from one tab to another, after the first view.
|
|
376
|
+
// WHY not from its first place: the tab of the login pages grew with a motion when the
|
|
377
|
+
// page opened: the first size was measured before the fonts and the page were ready, and the motion that was
|
|
378
|
+
// on followed the right size. Its first place and the sizes before the first change are drawn at once.
|
|
379
|
+
const startIndicatorMotion = function () {
|
|
380
|
+
if (isIndicatorMoving || !isFirstViewDone) return;
|
|
381
|
+
isIndicatorMoving = 1;
|
|
382
|
+
box.indicator.setMotionNow(getIndicatorMotion());
|
|
370
383
|
};
|
|
371
384
|
|
|
372
385
|
const getIndicatorMotion = function () {
|
|
@@ -421,6 +434,8 @@ const Tabs = function (params = {}) {
|
|
|
421
434
|
// WHY: One place, so a change can not forget its panel or its place in the Tab order.
|
|
422
435
|
const showActiveTab = function () {
|
|
423
436
|
paintTabs();
|
|
437
|
+
if (shownValue !== null && shownValue !== box.value) startIndicatorMotion();
|
|
438
|
+
shownValue = box.value;
|
|
424
439
|
refreshLayout();
|
|
425
440
|
showActivePanel();
|
|
426
441
|
makeTabbable(findItem(box.value));
|
|
@@ -434,7 +449,7 @@ const Tabs = function (params = {}) {
|
|
|
434
449
|
|
|
435
450
|
// WHY: New tabs: the indicator jumps to its first place, it does not fly from the old one.
|
|
436
451
|
const resetIndicator = function () {
|
|
437
|
-
|
|
452
|
+
isIndicatorMoving = 0;
|
|
438
453
|
box.indicator.setMotionNow("none");
|
|
439
454
|
};
|
|
440
455
|
|
|
@@ -672,9 +687,10 @@ const Tabs = function (params = {}) {
|
|
|
672
687
|
paintTab(item);
|
|
673
688
|
});
|
|
674
689
|
group.on("keydown", function (self, event) { onTabKeyDown(item, event); });
|
|
675
|
-
|
|
690
|
+
// WHY :focus-visible: the ring is for the keyboard. A click focuses the tab after its mousedown, so clearing the
|
|
691
|
+
// ring at mousedown did not stop it (a click on a tab showed the ring).
|
|
692
|
+
group.on("focus", function () { group.boxShadow = group.elem.matches(":focus-visible") ? focusRing : "none"; });
|
|
676
693
|
group.on("blur", function () { group.boxShadow = "none"; });
|
|
677
|
-
group.on("mousedown", function () { group.boxShadow = "none"; }); // WHY: No focus ring for mouse clicks.
|
|
678
694
|
|
|
679
695
|
// Middle mouse button closes a closable tab (like a browser).
|
|
680
696
|
group.on("auxclick", function (self, event) {
|
|
@@ -1183,6 +1199,9 @@ const Tabs = function (params = {}) {
|
|
|
1183
1199
|
box.value = resolveActiveKey(initialValue);
|
|
1184
1200
|
box.setEnabled(box.enabled);
|
|
1185
1201
|
showActiveTab();
|
|
1202
|
+
requestAnimationFrame(function () {
|
|
1203
|
+
isFirstViewDone = 1; // (a change of the tab before it is not a move: startIndicatorMotion)
|
|
1204
|
+
});
|
|
1186
1205
|
|
|
1187
1206
|
return endObject(box);
|
|
1188
1207
|
|
|
@@ -1268,7 +1287,7 @@ Tabs.injectCss = function () {
|
|
|
1268
1287
|
Tabs.styles = {
|
|
1269
1288
|
|
|
1270
1289
|
// Dark text and a dark line on a light page.
|
|
1271
|
-
|
|
1290
|
+
light: TabsDefaults.style,
|
|
1272
1291
|
|
|
1273
1292
|
// Cadetblue, same colors as the modern CheckBox, RadioButton, ProgressBar and TagInput.
|
|
1274
1293
|
modern: {
|
|
@@ -1315,3 +1334,33 @@ Tabs.styles = {
|
|
|
1315
1334
|
},
|
|
1316
1335
|
|
|
1317
1336
|
};
|
|
1337
|
+
Tabs.styles.classic = Tabs.styles.light; // the old name of light: the pages made with it keep their look
|
|
1338
|
+
|
|
1339
|
+
// The minimal theme (_designs/minimal-theme.htm): a 13 px text, a 2 px ink line under the selected tab on one thin
|
|
1340
|
+
// line, no fill under the mouse (the text gets darker); the pill variant: a line around the bar and an ink line
|
|
1341
|
+
// around the selected tab. minimalDark: the same on a dark window.
|
|
1342
|
+
Tabs.createMinimalStyle = function (colors) {
|
|
1343
|
+
return {
|
|
1344
|
+
bar: { color: "transparent", padding: [0, 0], gap: 2, round: 0, dividerColor: colors.line, dividerWidth: 1 },
|
|
1345
|
+
pillBar: { color: "transparent", padding: [2, 2], gap: 2, round: 4, border: 1, borderColor: colors.line },
|
|
1346
|
+
tab: { fontSize: 13, textColor: colors.softText, padding: [10, 6], round: 3, gap: 6, minHeight: 30 },
|
|
1347
|
+
tabHover: { color: "transparent", textColor: colors.text },
|
|
1348
|
+
tabActive: { color: "transparent", textColor: colors.ink },
|
|
1349
|
+
pillActive: { textColor: colors.ink },
|
|
1350
|
+
tabDisabled: { opacity: 0.4 },
|
|
1351
|
+
indicator: { color: colors.ink, thickness: 2, round: 1, motion: 0.25 },
|
|
1352
|
+
pillIndicator: { color: "transparent", round: 3, shadow: "inset 0 0 0 1px " + colors.ink, motion: 0.25 },
|
|
1353
|
+
icon: { size: 14 },
|
|
1354
|
+
count: { fontSize: 11, color: "transparent", textColor: colors.softText, activeColor: colors.ink, activeTextColor: colors.onInk, round: 8, padding: [5, 0] },
|
|
1355
|
+
close: { color: colors.softText, hoverColor: colors.danger, size: 12 },
|
|
1356
|
+
addButton: { color: colors.softText, hoverColor: colors.ink, hoverBackground: "transparent", size: 14 },
|
|
1357
|
+
arrow: { color: colors.softText, background: colors.ground, size: 14 },
|
|
1358
|
+
focus: { outlineColor: colors.focus },
|
|
1359
|
+
panel: { color: "transparent", padding: [0, 12], round: 0, border: 0, borderColor: "transparent" },
|
|
1360
|
+
disabled: { opacity: 0.4 },
|
|
1361
|
+
};
|
|
1362
|
+
};
|
|
1363
|
+
Tabs.MINIMAL_COLORS = { ground: "#FFFFFF", ink: "#1F1F1F", onInk: "#FFFFFF", text: Black(0.85), softText: Black(0.55), line: Black(0.2), danger: "#C24A36", focus: "#3D8BD9" };
|
|
1364
|
+
Tabs.styles.minimal = Tabs.createMinimalStyle(Tabs.MINIMAL_COLORS);
|
|
1365
|
+
Tabs.MINIMAL_DARK_COLORS = { ground: "#1A1A19", ink: "#EDEDEB", onInk: "#1A1A19", text: White(0.88), softText: White(0.55), line: White(0.18), danger: "#FF9F93", focus: "#7FB6DE" };
|
|
1366
|
+
Tabs.styles.minimalDark = Tabs.createMinimalStyle(Tabs.MINIMAL_DARK_COLORS);
|
|
@@ -16,7 +16,8 @@ UI COMPONENT TEMPLATE
|
|
|
16
16
|
ArrowLeft / ArrowRight move between the chips, Delete removes the selected chip. Escape closes the suggestions.
|
|
17
17
|
- Counter: "3 / 5" when there is a maxTags limit.
|
|
18
18
|
- Accessibility: The chips have role="listitem" and aria-labels, the suggestion list is a listbox.
|
|
19
|
-
- Style packages: "
|
|
19
|
+
- Style packages: "light" (default; the old name "classic" works too), "modern", "dark", "minimal", "minimalDark".
|
|
20
|
+
Select with styleName. (TagInput.styles)
|
|
20
21
|
- Everything is drawn with code (no image files needed).
|
|
21
22
|
|
|
22
23
|
USAGE:
|
|
@@ -35,10 +36,12 @@ TagInput({ validate: (tag) => (/^\S+@\S+\.\S+$/.test(tag)) ? "" : "Not an e-mail
|
|
|
35
36
|
TagInput({ styleName: "dark" });
|
|
36
37
|
|
|
37
38
|
Started Date: September 2026
|
|
38
|
-
Developer: Bugra Ozden
|
|
39
|
-
Email: bugra.ozden@gmail.com
|
|
40
39
|
Webpage: https://bug7a.github.io/js-components/
|
|
41
40
|
|
|
41
|
+
Copyright 2020-2026 Bugra Ozden <bugra.ozden@gmail.com> (https://bug7a.github.io/)
|
|
42
|
+
Licensed under the Apache License, Version 2.0
|
|
43
|
+
SPDX-License-Identifier: Apache-2.0
|
|
44
|
+
|
|
42
45
|
*/
|
|
43
46
|
|
|
44
47
|
"use strict";
|
|
@@ -74,8 +77,8 @@ const TagInputDefaults = {
|
|
|
74
77
|
long: "A tag can have up to {max} characters.",
|
|
75
78
|
notAllowed: "Choose a tag from the list.",
|
|
76
79
|
},
|
|
77
|
-
styleName: "
|
|
78
|
-
style: { //
|
|
80
|
+
styleName: "light", // "light" ("classic": its old name), "modern", "dark", "minimal", "minimalDark" or a name added to TagInput.styles
|
|
81
|
+
style: { // Light style package (default)
|
|
79
82
|
field: {
|
|
80
83
|
color: White(1),
|
|
81
84
|
border: 1,
|
|
@@ -146,8 +149,9 @@ const TagInputDefaults = {
|
|
|
146
149
|
optionActive: {
|
|
147
150
|
color: Black(0.06),
|
|
148
151
|
},
|
|
149
|
-
highlight: {
|
|
152
|
+
highlight: { // The typed part of a suggestion
|
|
150
153
|
color: "rgba(255, 196, 0, 0.35)",
|
|
154
|
+
fontFamily: "", // "": the font of the option. Ex: "opensans-bold"
|
|
151
155
|
},
|
|
152
156
|
empty: {
|
|
153
157
|
fontSize: 13,
|
|
@@ -169,7 +173,7 @@ const TagInputDefaults = {
|
|
|
169
173
|
|
|
170
174
|
const TagInput = function (params = {}) {
|
|
171
175
|
|
|
172
|
-
// Merge style package: params.style > TagInput.styles[styleName] > TagInputDefaults.style (
|
|
176
|
+
// Merge style package: params.style > TagInput.styles[styleName] > TagInputDefaults.style (light)
|
|
173
177
|
basic.applyStylePackage(params, TagInput.styles, TagInputDefaults);
|
|
174
178
|
|
|
175
179
|
// Merge params:
|
|
@@ -202,6 +206,7 @@ const TagInput = function (params = {}) {
|
|
|
202
206
|
const PAGE_MARGIN = 8; // The panel stays this far from the edges of the page
|
|
203
207
|
const MIN_PANEL_WIDTH = 160;
|
|
204
208
|
const MIN_LIST_HEIGHT = 60; // When the list is made shorter to fit the page
|
|
209
|
+
const PANEL_Z_INDEX = 1001; // the panel on the page, over the content (over a Dialog that holds the field: at open)
|
|
205
210
|
|
|
206
211
|
// *** PUBLIC VARIABLES:
|
|
207
212
|
// NOTE: Default values are also public variables. (box.tags, box.suggestions, box.maxTags)
|
|
@@ -464,7 +469,8 @@ const TagInput = function (params = {}) {
|
|
|
464
469
|
const before = TagInput.escapeHtml(label.slice(0, index));
|
|
465
470
|
const match = TagInput.escapeHtml(label.slice(index, index + text.length));
|
|
466
471
|
const after = TagInput.escapeHtml(label.slice(index + text.length));
|
|
467
|
-
|
|
472
|
+
let markStyle = "background:" + _s.highlight.color + "; color: inherit; border-radius: 3px";
|
|
473
|
+
if (_s.highlight.fontFamily) markStyle += "; font-family: " + _s.highlight.fontFamily;
|
|
468
474
|
return before + "<mark style='" + markStyle + "'>" + match + "</mark>" + after;
|
|
469
475
|
};
|
|
470
476
|
|
|
@@ -572,6 +578,7 @@ const TagInput = function (params = {}) {
|
|
|
572
578
|
if (!filtered.length && box.allowCustom == 1) return closePanel(); // Custom tags: an empty list is not useful.
|
|
573
579
|
if (!isOpen) {
|
|
574
580
|
isOpen = 1;
|
|
581
|
+
box.panel.zIndex = basic.zIndexAbove(box, PANEL_Z_INDEX); // WHY: over a Dialog that holds the field
|
|
575
582
|
box.panel.visible = 1;
|
|
576
583
|
box.input.inputElement.setAttribute("aria-expanded", "true");
|
|
577
584
|
}
|
|
@@ -926,7 +933,7 @@ const TagInput = function (params = {}) {
|
|
|
926
933
|
// WHY: visible: 0 at create time makes the children absolute (not flex items). Hide it after the children are added.
|
|
927
934
|
box.panel.css.alignItems = "stretch";
|
|
928
935
|
box.panel.boxShadow = _s.panel.shadow;
|
|
929
|
-
box.panel.zIndex =
|
|
936
|
+
box.panel.zIndex = PANEL_Z_INDEX;
|
|
930
937
|
|
|
931
938
|
// BOX: List (scrolls)
|
|
932
939
|
box.list = Box({ width: "100%", height: "auto", color: "transparent", scrollY: 1, position: "relative" });
|
|
@@ -1016,7 +1023,7 @@ TagInput.injectCss = function () {
|
|
|
1016
1023
|
TagInput.styles = {
|
|
1017
1024
|
|
|
1018
1025
|
// Gray chips in a white field.
|
|
1019
|
-
|
|
1026
|
+
light: TagInputDefaults.style,
|
|
1020
1027
|
|
|
1021
1028
|
// Round cadetblue chips, same colors as the modern CheckBox, RadioButton and ProgressBar.
|
|
1022
1029
|
modern: {
|
|
@@ -1065,3 +1072,36 @@ TagInput.styles = {
|
|
|
1065
1072
|
},
|
|
1066
1073
|
|
|
1067
1074
|
};
|
|
1075
|
+
TagInput.styles.classic = TagInput.styles.light; // the old name of light: the pages made with it keep their look
|
|
1076
|
+
|
|
1077
|
+
// The minimal theme (_designs/minimal-theme.htm): a 28 px field with no fill and an edge of 3:1 at least, ink while it
|
|
1078
|
+
// is typed in; the tags are 20 px with a soft line (a faint fill under the mouse, ink when they are chosen with the
|
|
1079
|
+
// keyboard); a flat suggestion list with a line and no shadow, the typed part in bold. minimalDark: the same on a dark
|
|
1080
|
+
// window.
|
|
1081
|
+
TagInput.createMinimalStyle = function (colors) {
|
|
1082
|
+
return {
|
|
1083
|
+
field: { color: "transparent", border: 1, borderColor: colors.edge, round: 4, padding: [6, 3], gap: 4, minHeight: 28 },
|
|
1084
|
+
fieldHover: { borderColor: colors.edgeHover },
|
|
1085
|
+
fieldFocus: { borderColor: colors.ink },
|
|
1086
|
+
fieldError: { borderColor: colors.danger },
|
|
1087
|
+
input: { fontSize: 13, textColor: colors.text, minWidth: 80, height: 20 },
|
|
1088
|
+
placeholder: { textColor: colors.faintText },
|
|
1089
|
+
tag: { color: "transparent", border: 1, borderColor: colors.line, round: 3, padding: [6, 0], height: 20, gap: 3 },
|
|
1090
|
+
tagHover: { color: colors.hover },
|
|
1091
|
+
tagSelected: { color: colors.ink, textColor: colors.onInk, removeColor: colors.onInk },
|
|
1092
|
+
tagText: { fontSize: 12, textColor: colors.text },
|
|
1093
|
+
tagRemove: { color: colors.softText, hoverColor: colors.danger },
|
|
1094
|
+
panel: { color: colors.ground, border: 1, borderColor: colors.line, round: 4, padding: 4, shadow: "none", maxHeight: 200 },
|
|
1095
|
+
option: { fontSize: 13, textColor: colors.text, round: 3, padding: [8, 5] },
|
|
1096
|
+
optionActive: { color: colors.hover },
|
|
1097
|
+
highlight: { color: "transparent", fontFamily: "opensans-bold" }, // WHY bold: a faint fill behind a few small letters read as a smudge
|
|
1098
|
+
empty: { fontSize: 12, textColor: colors.softText },
|
|
1099
|
+
message: { fontSize: 11, textColor: colors.danger },
|
|
1100
|
+
counter: { fontSize: 11, textColor: colors.softText },
|
|
1101
|
+
disabled: { opacity: 0.4 },
|
|
1102
|
+
};
|
|
1103
|
+
};
|
|
1104
|
+
TagInput.MINIMAL_COLORS = { ground: "#FFFFFF", text: Black(0.85), softText: Black(0.55), faintText: Black(0.54), line: Black(0.2), edge: Black(0.45), edgeHover: Black(0.65), ink: "#1F1F1F", onInk: "#FFFFFF", hover: Black(0.05), danger: "#C24A36" };
|
|
1105
|
+
TagInput.styles.minimal = TagInput.createMinimalStyle(TagInput.MINIMAL_COLORS);
|
|
1106
|
+
TagInput.MINIMAL_DARK_COLORS = { ground: "#1A1A19", text: White(0.88), softText: White(0.55), faintText: White(0.48), line: White(0.18), edge: White(0.42), edgeHover: White(0.62), ink: "#EDEDEB", onInk: "#1A1A19", hover: White(0.07), danger: "#FF9F93" };
|
|
1107
|
+
TagInput.styles.minimalDark = TagInput.createMinimalStyle(TagInput.MINIMAL_DARK_COLORS);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Tap Effect - v26.11
|
|
6
6
|
|
|
7
|
-
A soft circle where the screen is tapped
|
|
7
|
+
A soft circle where the screen is tapped. A black circle
|
|
8
8
|
(80 px, opacity 0.05) comes in the middle of the tap, fades to 0 in 0.2 s (it starts 50 ms after the tap) and goes
|
|
9
9
|
(removed at 250 ms). It is over everything and never catches a tap: the tap goes to the object under it.
|
|
10
10
|
- TapEffect.start(options): the taps of the page make circles. TapEffect.stop(): no more circles (its window
|
|
@@ -29,11 +29,13 @@ TapEffect.stop();
|
|
|
29
29
|
TapEffect.show(200, 300); // a circle at x 200, y 300 of the page
|
|
30
30
|
if (TapEffect.isOn) TapEffect.stop();
|
|
31
31
|
|
|
32
|
-
Started Date: November 2026
|
|
33
|
-
Developer: Bugra Ozden
|
|
34
|
-
Email: bugra.ozden@gmail.com
|
|
32
|
+
Started Date: November 2026
|
|
35
33
|
Webpage: https://bug7a.github.io/js-components/
|
|
36
34
|
|
|
35
|
+
Copyright 2020-2026 Bugra Ozden <bugra.ozden@gmail.com> (https://bug7a.github.io/)
|
|
36
|
+
Licensed under the Apache License, Version 2.0
|
|
37
|
+
SPDX-License-Identifier: Apache-2.0
|
|
38
|
+
|
|
37
39
|
*/
|
|
38
40
|
|
|
39
41
|
"use strict";
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
/* Bismillah */
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
|
|
5
|
+
TextAreaField - v26.11
|
|
6
|
+
|
|
7
|
+
UI COMPONENT TEMPLATE
|
|
8
|
+
- You can customize, this template code as you need:
|
|
9
|
+
- NEW PROJECTS: styleName "light" (the default) on a light page, "dark" on a dark page (the packages
|
|
10
|
+
of TextField, comp/text-field.js; the look of _basic/examples/text-field-8-light-dark.htm), unless the user asks for another one.
|
|
11
|
+
- scrollBarStyle: the scroll bar of the text (the params of ScrollBar; a style package can give it: minimal).
|
|
12
|
+
- rightPadding is its own (5): a style package does not change it (on the right is the scroll bar). Under its title
|
|
13
|
+
(titlePosition "above", minimal), from the right edge: the scroll bar right inside the edge, the warning ball left
|
|
14
|
+
of it, then the text.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
Started Date: June 2024
|
|
18
|
+
Webpage: https://bug7a.github.io/js-components/
|
|
19
|
+
|
|
20
|
+
Copyright 2020-2026 Bugra Ozden <bugra.ozden@gmail.com> (https://bug7a.github.io/)
|
|
21
|
+
Licensed under the Apache License, Version 2.0
|
|
22
|
+
SPDX-License-Identifier: Apache-2.0
|
|
23
|
+
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
"use strict";
|
|
27
|
+
|
|
28
|
+
// Default values
|
|
29
|
+
const TextAreaFieldDefaults = {
|
|
30
|
+
type: "textarea",
|
|
31
|
+
titleText: "MESSAGE",
|
|
32
|
+
placeholder: "How can we help you?",
|
|
33
|
+
required: 1,
|
|
34
|
+
minCharCount: 80, // 0, 80
|
|
35
|
+
showCount: 1, // 0, 1
|
|
36
|
+
lengthText: "length: ",
|
|
37
|
+
warningText: "The entered text must be longer than 80",
|
|
38
|
+
warningColor: "#E5885E",
|
|
39
|
+
maxLength: 255,
|
|
40
|
+
height: 170, // 170 (4line)
|
|
41
|
+
rightPadding: 5,
|
|
42
|
+
unitStyle: {
|
|
43
|
+
padding: [12, 4],
|
|
44
|
+
color: "#373836EE",
|
|
45
|
+
textColor: "white",
|
|
46
|
+
},
|
|
47
|
+
scrollBarStyle: { // The scroll bar of the text (the params of ScrollBar)
|
|
48
|
+
bar_border: 0,
|
|
49
|
+
bar_round: 2,
|
|
50
|
+
bar_borderColor: "rgba(0, 0, 0, 1)",
|
|
51
|
+
bar_width: 4,
|
|
52
|
+
bar_mouseOverWidth: 4,
|
|
53
|
+
bar_mouseOverColor: "#373836",
|
|
54
|
+
bar_opacity: 0.4,
|
|
55
|
+
bar_mouseOverOpacity: 0.9,
|
|
56
|
+
bar_padding: 3,
|
|
57
|
+
bar_color: "#373836",
|
|
58
|
+
neverHide: 1,
|
|
59
|
+
showDots: 1,
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const TextAreaField = function(params = {}) {
|
|
64
|
+
|
|
65
|
+
// Merge params first: the style package of TextField, then the defaults of TextAreaField
|
|
66
|
+
// WHY the package first: a package that sets a key of TextAreaField (minimal: unitStyle, scrollBarStyle) wins over the
|
|
67
|
+
// defaults here, as over the defaults of TextField
|
|
68
|
+
// WHY its own rightPadding: on the right of a TextAreaField is its scroll bar, not the room of the warning ball of a
|
|
69
|
+
// one-line field (the rightPadding of a package pushed the scroll bar to the middle)
|
|
70
|
+
const givenRightPadding = params.rightPadding;
|
|
71
|
+
basic.applyStylePackage(params, TextField.styles, TextFieldDefaults);
|
|
72
|
+
params.rightPadding = (givenRightPadding !== undefined) ? givenRightPadding : TextAreaFieldDefaults.rightPadding;
|
|
73
|
+
mergeIntoIfMissing(params, TextAreaFieldDefaults);
|
|
74
|
+
|
|
75
|
+
// Control params
|
|
76
|
+
params.createInput = 0; // WHY: A <textarea> is made here instead of the Input of TextField.
|
|
77
|
+
params.showDescription = 0;
|
|
78
|
+
params.descriptionText = "";
|
|
79
|
+
|
|
80
|
+
if (params.showCount != 0) {
|
|
81
|
+
params.showUnit = 1;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// BOX: Component container
|
|
85
|
+
const box = startExtendedObject(TextField, params);
|
|
86
|
+
|
|
87
|
+
// *** PRIVATE VARIABLES:
|
|
88
|
+
const textareaElem = document.createElement("textarea");
|
|
89
|
+
|
|
90
|
+
// *** PUBLIC VARIABLES:
|
|
91
|
+
box.textareaElem = textareaElem; // the raw <textarea>: a page can listen to its paste / drop / keydown
|
|
92
|
+
|
|
93
|
+
// *** PRIVATE FUNCTIONS:
|
|
94
|
+
// The count is hidden when the text is long enough.
|
|
95
|
+
const refreshCount = function() {
|
|
96
|
+
if (!box.showCount) return;
|
|
97
|
+
|
|
98
|
+
const currentLength = box.getValue().length;
|
|
99
|
+
box.setUnitText(`${box.lengthText}${currentLength}`);
|
|
100
|
+
box.unit.opacity = (currentLength > box.minCharCount) ? 0 : 1;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// The textarea grows with its text (the inputBox scrolls).
|
|
104
|
+
const autoGrow = function(elem) {
|
|
105
|
+
elem.style.height = "auto"; // WHY: First reset, so scrollHeight is the height of the text (also when it got shorter).
|
|
106
|
+
// WHY: not drawn yet (a closed tab, a Dialog filled before it opens): scrollHeight is 0 and a 0 px textarea
|
|
107
|
+
// could not be seen or clicked. box.onResize grows it when it is shown.
|
|
108
|
+
if (elem.scrollHeight === 0) return;
|
|
109
|
+
elem.style.height = elem.scrollHeight + "px";
|
|
110
|
+
// WHY: After the browser drew the new height.
|
|
111
|
+
box.after(0, () => box.inputBox.scrollBar.refreshScroll());
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// *** PUBLIC FUNCTIONS:
|
|
115
|
+
box.setValue = function(value) { // OVERRIDE
|
|
116
|
+
if (value != textareaElem.value) {
|
|
117
|
+
box.value = value;
|
|
118
|
+
textareaElem.value = value;
|
|
119
|
+
// WHY: Same as TextField.setValue. Without it, a required textarea cleared by code (after a form is sent) showed no required icon.
|
|
120
|
+
box.checkIfInputIsRequiredAndEmpty();
|
|
121
|
+
box.showWarningIfNotValid(box.isValid());
|
|
122
|
+
refreshCount();
|
|
123
|
+
autoGrow(textareaElem);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
box.getValue = function() { // OVERRIDE
|
|
128
|
+
return textareaElem.value;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
// WHY: The ones of TextField write to box.input, which a TextAreaField does not have (createInput: 0): a TypeError.
|
|
132
|
+
box.setPlaceholder = function(text) { // OVERRIDE
|
|
133
|
+
box.placeholder = text;
|
|
134
|
+
textareaElem.placeholder = text;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
box.setMaxLength = function(count) { // OVERRIDE
|
|
138
|
+
box.maxLength = count;
|
|
139
|
+
textareaElem.maxLength = count;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
box.isValid = function() { // OVERRIDE
|
|
143
|
+
return (box.getValue().length > box.minCharCount) ? 1 : 0;
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
// UNDER ITS TITLE (titlePosition "above"), from the right edge of the field: the scroll bar right inside the edge,
|
|
147
|
+
// the warning ball left of it, then the text. WHY apart: the scroll bar was under the ball.
|
|
148
|
+
const EDGE_WIDTH = 1; // px: the edge of the field
|
|
149
|
+
const BALL_SPACE = 2; // px between the scroll bar and the ball, and between the ball and the text
|
|
150
|
+
const placeRightSideUnderTitle = function () {
|
|
151
|
+
const bar = box.scrollBarStyle;
|
|
152
|
+
const barRoom = bar.bar_padding + Math.max(bar.bar_width, bar.bar_mouseOverWidth);
|
|
153
|
+
const ballRight = EDGE_WIDTH + barRoom + BALL_SPACE;
|
|
154
|
+
const textRight = ballRight + box.warningBall.width + BALL_SPACE - EDGE_WIDTH; // from the right of the text box
|
|
155
|
+
box.inputGroup.padding = [box.leftPadding, 0, EDGE_WIDTH, 0];
|
|
156
|
+
box.warningBall.right = ballRight;
|
|
157
|
+
textareaElem.style.padding = TEXT_SPACE + "px " + textRight + "px " + TEXT_SPACE + "px 0px";
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
// *** OBJECT VIEW:
|
|
161
|
+
const isTitleAbove = (box.titlePosition === "above");
|
|
162
|
+
const TEXT_SPACE = 6; // px over and under the text in a field under its title (titlePosition "above")
|
|
163
|
+
box.inputGroup.gap = isTitleAbove ? box.titleGap : 8;
|
|
164
|
+
box.inputGroup.height = "100%";
|
|
165
|
+
box.inputBox.color = "transparent";
|
|
166
|
+
box.inputBox.height = isTitleAbove ? "calc(100% - " + box.fieldTop + "px)" : "calc(100% - 20px)";
|
|
167
|
+
|
|
168
|
+
// WHY: A raw <textarea> (not a basic.js object): its style is written directly.
|
|
169
|
+
textareaElem.classList.add("basic_textbox");
|
|
170
|
+
textareaElem.classList.add("minimal");
|
|
171
|
+
textareaElem.style.cssText = "background-color:transparent;font-size:" + box.inputFontSize + "px;resize:none;width:100%;padding:0px 0px;box-sizing:border-box";
|
|
172
|
+
textareaElem.style.overflow = "hidden";
|
|
173
|
+
if (isTitleAbove) placeRightSideUnderTitle();
|
|
174
|
+
// WHY a CSS size, not the measured one: the field is clickable in all its height, also when it is made hidden
|
|
175
|
+
// (box.inputBox.height is 0 then) and after the text changed (autoGrow cleared the measured one)
|
|
176
|
+
textareaElem.style.minHeight = "calc(100% - 4px)";
|
|
177
|
+
textareaElem.style.height = "auto";
|
|
178
|
+
|
|
179
|
+
textareaElem.placeholder = box.placeholder;
|
|
180
|
+
// WHY: The <textarea> is made here, not by TextField, so the text colors of TextField were never given to it:
|
|
181
|
+
// on a dark package (dark, ozdenDark) the typed text was dark on a dark field.
|
|
182
|
+
box.applyTextColors(textareaElem);
|
|
183
|
+
textareaElem.maxLength = box.maxLength;
|
|
184
|
+
box.inputBox.elem.appendChild(textareaElem);
|
|
185
|
+
box.inputBox.clickable = 1;
|
|
186
|
+
textareaElem.value = box.value;
|
|
187
|
+
box.inputBox.scrollY = 1;
|
|
188
|
+
|
|
189
|
+
// SCROLL BAR:
|
|
190
|
+
box.inputBox.scrollBar = ScrollBar(Object.assign({ scrollableBox: box.inputBox }, box.scrollBarStyle));
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
// *** OBJECT INIT CODE:
|
|
194
|
+
|
|
195
|
+
// Event bindings
|
|
196
|
+
box.focusFunc = function () {
|
|
197
|
+
box.paintFocus(1);
|
|
198
|
+
box.onFocus(box);
|
|
199
|
+
}
|
|
200
|
+
textareaElem.addEventListener("focus", function(){ box.focusFunc() });
|
|
201
|
+
|
|
202
|
+
box.blurFunc = function () {
|
|
203
|
+
box.paintFocus(0);
|
|
204
|
+
box.onBlur(box);
|
|
205
|
+
}
|
|
206
|
+
textareaElem.addEventListener("blur", function(){ box.blurFunc() });
|
|
207
|
+
|
|
208
|
+
box.inputFunc = function () {
|
|
209
|
+
|
|
210
|
+
box.applyFormattedValueToInput();
|
|
211
|
+
box.checkIfInputIsRequiredAndEmpty();
|
|
212
|
+
box.showWarningIfNotValid(box.isValid());
|
|
213
|
+
|
|
214
|
+
// Refresh count on unit
|
|
215
|
+
refreshCount();
|
|
216
|
+
autoGrow(textareaElem);
|
|
217
|
+
|
|
218
|
+
box.onChange(box);
|
|
219
|
+
|
|
220
|
+
}
|
|
221
|
+
textareaElem.addEventListener("input", function(){ box.inputFunc() });
|
|
222
|
+
|
|
223
|
+
box.checkIfInputIsRequiredAndEmpty();
|
|
224
|
+
|
|
225
|
+
refreshCount();
|
|
226
|
+
|
|
227
|
+
box.onResize(function() {
|
|
228
|
+
autoGrow(textareaElem); // WHY: a field made or filled while hidden gets its height when it is shown
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
return endExtendedObject(box);
|
|
232
|
+
|
|
233
|
+
};
|