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,21 +5,34 @@
|
|
|
5
5
|
ItemList - v26.11
|
|
6
6
|
|
|
7
7
|
UI COMPONENT TEMPLATE
|
|
8
|
+
- NEW PROJECTS: use styleName "ozden" on a light page (the default: rows that are white with a thin line above
|
|
9
|
+
and under them under the mouse; its search box the ozden SearchInput in white) and "ozdenDark" on a dark page (_basic/examples/item-list.htm), unless the user asks for
|
|
10
|
+
another look.
|
|
8
11
|
- A list of items: an icon, a title and a description on every row, or your own row (createItemView).
|
|
9
|
-
The new version of comp-m1/item-list.js (ItemList.create / setItemCreationFunction).
|
|
10
12
|
- Layouts: "vertical" (a list), "horizontal" (one row of tiles: categories, cards) and "grid" (tiles that
|
|
11
|
-
wrap: files, icons, pictures). setLayout() changes it later.
|
|
13
|
+
wrap: files, icons, pictures). setLayout() changes it later. style.tile.fitRow: 1: the tiles of a grid share the
|
|
14
|
+
whole row (as many as fit at tile.width, then wider), so no empty end is left before the scroll bar.
|
|
12
15
|
- Selection: "single", "multiple" or "none". The selected keys: getSelectedKeys(), the items: getSelected().
|
|
16
|
+
style.selected.canSelectAgain: 0 (ozden, ozdenDark; light and dark: 1): in a single list the selected row can not
|
|
17
|
+
be chosen again: a click, Enter or Space does nothing (no onItemClick), no look under the mouse, no hand cursor.
|
|
18
|
+
The keys can still go to it (its focus ring; a screen reader reads it as selected).
|
|
13
19
|
onChange(self, selectedItems) is NOT called at create time, by setItems() or with silent: 1.
|
|
14
|
-
- Search box: showSearch: 1 puts a SearchInput (comp/search-input
|
|
20
|
+
- Search box: showSearch: 1 puts a SearchInput (comp/search-input.js, load it first) over the list;
|
|
15
21
|
its look is style.search, more params in searchParams (Ex: the icon paths for your page). box.searchInput.
|
|
16
|
-
- Search: search(text) shows only the matching items (
|
|
22
|
+
- Search: search(text) shows only the matching items (text, description and searchText; Turkish letters are
|
|
17
23
|
matched without their marks: "isik" finds "Işık"). It returns the count of the shown items.
|
|
18
|
-
- Keyboard: the arrow keys move the focus (Up / Down in a list, Left / Right in a row, all four in a
|
|
19
|
-
Home / End,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
- Keyboard (a listbox): the arrow keys move the focus (Up / Down in a list, Left / Right in a row, all four in a
|
|
25
|
+
grid), Home / End, PageUp / PageDown (a page of rows), letters (type-ahead: the next item whose text starts with
|
|
26
|
+
them). Enter or Space is a click (onItemClick and the selection). Only one row is in the Tab order: the focused
|
|
27
|
+
one, or the first selected one, or the first one. multiple: Shift + a move, Shift + Space and Shift + click select
|
|
28
|
+
the rows from the last clicked one; Ctrl / Cmd + A selects all the shown items (again: none). With a search box:
|
|
29
|
+
the arrow down goes from it into the list, the arrow up from the first line back to it, Escape clears it.
|
|
30
|
+
- A combobox whose keyboard stays in its field (SelectBox) shows its active row with setActiveKey(key): the look of
|
|
31
|
+
the mouse (style.hover), also on a selected row, and only on that row. null: none.
|
|
32
|
+
- Items: strings or objects { key, text, description, iconFile, searchText, enabled }. Any other keys stay on the
|
|
33
|
+
item for your createItemView. An item without a key gets its index as its key. style.title and style.desc are the
|
|
34
|
+
look of its text and its description.
|
|
35
|
+
- Sections: an item { type: "section", text: "VIEWS" } is a title row between the items (style.section). It is
|
|
23
36
|
never selected, focused, hovered or clicked, the arrow keys skip it, and getSelected(), search() and the empty
|
|
24
37
|
text count only the items. It is shown while at least one item under it (until the next section) is shown: in
|
|
25
38
|
a search, only the sections with a match (a section without items is hidden too).
|
|
@@ -34,8 +47,11 @@ UI COMPONENT TEMPLATE
|
|
|
34
47
|
setAnimated(0/1).
|
|
35
48
|
- height: "auto" -> The list grows with its rows (no scrolling). Otherwise it scrolls with basic/scroll-bar.js
|
|
36
49
|
(if it is loaded).
|
|
37
|
-
- Style packages: "
|
|
38
|
-
|
|
50
|
+
- Style packages: "ozden" (default; the name "classic" still works), "ozdenDark" (the same on a dark page), "gallery" and
|
|
51
|
+
"galleryDark" (pictures: layout "grid", a big photo on every tile with its title under it),
|
|
52
|
+
"light" and "dark" (the light and dark look of the kit: a white box with one thin line, flat 56 px rows, the
|
|
53
|
+
selected one in a tint of the accent with a full mark: _designs/item-list.htm), "minimal" and "minimalDark"
|
|
54
|
+
(lines, 28 px rows: _designs/minimal-theme.htm).
|
|
39
55
|
Select with styleName. (ItemList.styles)
|
|
40
56
|
|
|
41
57
|
USAGE:
|
|
@@ -43,36 +59,38 @@ const list = ItemList({
|
|
|
43
59
|
width: 360,
|
|
44
60
|
height: 400,
|
|
45
61
|
items: [
|
|
46
|
-
{ key: "broccoli",
|
|
47
|
-
{ key: "strawberry",
|
|
62
|
+
{ key: "broccoli", text: "Broccoli", description: "Vegetable", iconFile: "assets/fruids/brokoli.png" },
|
|
63
|
+
{ key: "strawberry", text: "Strawberry", description: "Fruit", iconFile: "assets/fruids/cilek.png" },
|
|
48
64
|
],
|
|
49
65
|
onChange: function (self, selectedItems) { println(self.getSelectedKeys()); },
|
|
50
66
|
});
|
|
51
67
|
list.search("fruit"); // 1 (the count of the shown items)
|
|
52
68
|
list.setSelected(["broccoli"], 1); // silent: onChange is not called
|
|
53
|
-
list.addItem({ key: "tomato",
|
|
54
|
-
list.updateItem("tomato", {
|
|
69
|
+
list.addItem({ key: "tomato", text: "Tomato", description: "Vegetable" });
|
|
70
|
+
list.updateItem("tomato", { description: "Fruit, really" });
|
|
55
71
|
list.setLayout("grid");
|
|
56
|
-
ItemList({ selection: "multiple", styleName: "
|
|
72
|
+
ItemList({ selection: "multiple", styleName: "light" });
|
|
57
73
|
ItemList({ layout: "horizontal", height: 200, styleName: "dark" });
|
|
58
|
-
ItemList({ showSearch: 1, searchParams: {
|
|
74
|
+
ItemList({ showSearch: 1, searchParams: { placeholder: "Ara" } });
|
|
59
75
|
ItemList({
|
|
60
76
|
style: { row: { height: "auto" } },
|
|
61
77
|
createItemView: function (item, row, self) { // Objects created here go into the row.
|
|
62
|
-
Label({ plainText: item.
|
|
78
|
+
Label({ plainText: item.text, fontSize: 18 });
|
|
63
79
|
},
|
|
64
80
|
});
|
|
65
|
-
ItemList({ items: [{ type: "section",
|
|
81
|
+
ItemList({ items: [{ type: "section", text: "FRUITS" }, "Apple", "Banana", { type: "section", text: "VEGETABLES" }, "Carrot"] });
|
|
66
82
|
ItemList({ style: { hover: {} } }); // No look under the mouse
|
|
67
83
|
ItemList({ selection: "none", style: { pressed: { color: Black(0.2) }, row: { motion: "background-color 0.3s" } } });
|
|
68
84
|
const animatedList = ItemList({ animated: 1, items: ["A", "B", "C"] });
|
|
69
85
|
animatedList.removeItem("0"); // "A" fades out, then "B" and "C" move up
|
|
70
86
|
|
|
71
|
-
Started Date:
|
|
72
|
-
Developer: Bugra Ozden
|
|
73
|
-
Email: bugra.ozden@gmail.com
|
|
87
|
+
Started Date: October 2026
|
|
74
88
|
Webpage: https://bug7a.github.io/js-components/
|
|
75
89
|
|
|
90
|
+
Copyright 2020-2026 Bugra Ozden <bugra.ozden@gmail.com> (https://bug7a.github.io/)
|
|
91
|
+
Licensed under the Apache License, Version 2.0
|
|
92
|
+
SPDX-License-Identifier: Apache-2.0
|
|
93
|
+
|
|
76
94
|
*/
|
|
77
95
|
|
|
78
96
|
"use strict";
|
|
@@ -82,7 +100,7 @@ const ItemListDefaults = {
|
|
|
82
100
|
key: "0", // Your name for this object: read it in a callback (self.key)
|
|
83
101
|
width: 600,
|
|
84
102
|
height: 400, // "auto": grows with the rows (no scrolling)
|
|
85
|
-
items: [], // Strings or { key,
|
|
103
|
+
items: [], // Strings or { key, text, description, iconFile, searchText, enabled }. A title row: { type: "section", text: "VIEWS" }
|
|
86
104
|
layout: "vertical", // "vertical", "horizontal", "grid"
|
|
87
105
|
selection: "single", // "single", "multiple", "none"
|
|
88
106
|
selectedKeys: [], // The keys selected at create time
|
|
@@ -90,8 +108,8 @@ const ItemListDefaults = {
|
|
|
90
108
|
createItemView: null, // function (item, row, self) { ... } Objects created here go into the row (instead of the icon and texts). Not called for a section.
|
|
91
109
|
createSectionView: null, // function (item, row, self) { ... } Your own section row (instead of its title)
|
|
92
110
|
animated: 0, // 1: addItem / removeItem move the rows (a new row fades in, a removed one fades out). setAnimated(0/1)
|
|
93
|
-
showSearch: 0, // 1: a search box over the list (comp/search-input
|
|
94
|
-
searchParams: {}, // More params of the SearchInput. Ex: {
|
|
111
|
+
showSearch: 0, // 1: a search box over the list (comp/search-input.js SearchInput must be loaded)
|
|
112
|
+
searchParams: {}, // More params of the SearchInput. Ex: { placeholder: "Ara", searchIconFile: "_basic/comp/search-input/search.svg" }
|
|
95
113
|
emptyText: "No items",
|
|
96
114
|
noResultText: "No results",
|
|
97
115
|
enabled: 1,
|
|
@@ -99,20 +117,20 @@ const ItemListDefaults = {
|
|
|
99
117
|
ariaLabel: "List",
|
|
100
118
|
onItemClick: function (self, item, index, event) { },
|
|
101
119
|
onChange: function (self, selectedItems) { }, // Not at create time, not by setItems(), not with silent: 1
|
|
102
|
-
styleName: "
|
|
103
|
-
style: { //
|
|
120
|
+
styleName: "ozden", // "ozden", "ozdenDark", "light", "dark", "gallery", "galleryDark", "minimal", "minimalDark" or a name added to ItemList.styles
|
|
121
|
+
style: { // The ozden style package (default)
|
|
104
122
|
box: {
|
|
105
|
-
color: "
|
|
123
|
+
color: "whitesmoke", // WHY: A row is white under the mouse: on a white page a list with no color of its own shows nothing.
|
|
106
124
|
border: 1,
|
|
107
125
|
borderColor: "rgba(20, 20, 20, 0.45)",
|
|
108
|
-
round:
|
|
126
|
+
round: 6,
|
|
109
127
|
padding: 0, // Around the rows of the vertical layout
|
|
110
128
|
},
|
|
111
129
|
list: {
|
|
112
130
|
gap: 0, // Between the rows of the vertical layout
|
|
113
131
|
},
|
|
114
|
-
// A row of the vertical layout
|
|
115
|
-
// as wide as the list, white under the mouse, the selected one half transparent.
|
|
132
|
+
// A row of the vertical layout:
|
|
133
|
+
// as wide as the list, white under the mouse with a thin line above and under it, the selected one half transparent.
|
|
116
134
|
row: {
|
|
117
135
|
height: 80, // "auto": as high as its content (a createItemView)
|
|
118
136
|
padding: [20, 12],
|
|
@@ -123,7 +141,8 @@ const ItemListDefaults = {
|
|
|
123
141
|
round: 0,
|
|
124
142
|
opacity: 1,
|
|
125
143
|
boxShadow: "",
|
|
126
|
-
|
|
144
|
+
lineColor: "", // A line at the top and at the bottom of the row (1 px, inside it: no row moves). "": none
|
|
145
|
+
motion: "background-color 0.2s, box-shadow 0.2s", // WHY: box-shadow: the lines come and go with the color.
|
|
127
146
|
},
|
|
128
147
|
// An item of the horizontal and grid layouts: the icon on top, the texts under it
|
|
129
148
|
// (the category items of the home page of the template)
|
|
@@ -134,11 +153,13 @@ const ItemListDefaults = {
|
|
|
134
153
|
gap: 15,
|
|
135
154
|
spacing: 4, // Between the tiles
|
|
136
155
|
listPadding: [12, 5], // Around the tiles
|
|
156
|
+
fitRow: 0, // 1 (layout "grid"): the tiles share a row: as many as fit at their width, then wider: no empty end
|
|
137
157
|
iconSize: 70,
|
|
138
158
|
frameSize: 90, // A circle behind the icon. 0: no circle
|
|
139
159
|
frameColor: White(0.3),
|
|
140
160
|
frameRound: 100,
|
|
141
161
|
iconFilter: "grayscale(100%)", // "": none
|
|
162
|
+
iconFit: "", // How a picture fills its square: "cover" (a photo), "contain". "": as the Icon does
|
|
142
163
|
iconMotion: "transform 0.3s",
|
|
143
164
|
hover: {}, // The look under the mouse (the rows use style.hover)
|
|
144
165
|
selectedColor: "white", // "": the color of style.selected (the rows)
|
|
@@ -147,7 +168,7 @@ const ItemListDefaults = {
|
|
|
147
168
|
selectedIconFilter: "grayscale(30%)",
|
|
148
169
|
selectedFontFamily: "opensans-bold", // "": the font does not change
|
|
149
170
|
},
|
|
150
|
-
// A section: an item { type: "section",
|
|
171
|
+
// A section: an item { type: "section", text: "VIEWS" }, a title between the items
|
|
151
172
|
section: {
|
|
152
173
|
height: "auto",
|
|
153
174
|
padding: [20, 8],
|
|
@@ -156,30 +177,28 @@ const ItemListDefaults = {
|
|
|
156
177
|
textColor: Black(0.4),
|
|
157
178
|
},
|
|
158
179
|
// A state: only the keys that change
|
|
159
|
-
hover: { color: "white" }, // style: { hover: {} }: no look under the mouse
|
|
180
|
+
hover: { color: "white", lineColor: Black(0.2) }, // style: { hover: {} }: no look under the mouse.
|
|
160
181
|
pressed: { color: null }, // A click, Enter or Space: this color at once, then it fades back (style.row.motion). null: none
|
|
161
|
-
|
|
182
|
+
// WHY: a selected row does not get the white and its lines under the mouse.
|
|
183
|
+
// canSelectAgain 0 (single, as SelectBox ozden): it can not be
|
|
184
|
+
// chosen again: a click, Enter or Space does nothing (no onItemClick), no look under the mouse, no hand.
|
|
185
|
+
selected: { color: "transparent", lineColor: "", opacity: 0.5, canSelectAgain: 0 },
|
|
162
186
|
disabled: { opacity: 0.4 },
|
|
163
187
|
focus: { ringColor: "rgba(55, 56, 54, 0.5)" }, // The ring of the keyboard focus
|
|
164
188
|
icon: { size: 50, round: 4, color: "transparent" },
|
|
165
189
|
title: { fontSize: 20, textColor: "rgba(0, 0, 0, 0.8)", fontFamily: "", selectedTextColor: "" },
|
|
166
|
-
desc: { fontSize: 14, textColor: "gray", marginTop: -4 }, // WHY
|
|
190
|
+
desc: { fontSize: 14, textColor: "gray", marginTop: -4 }, // WHY -4: the title and the description overlap a little.
|
|
167
191
|
check: { visible: 0, size: 22, color: "#373836", iconColor: "white", borderColor: Black(0.25) }, // A mark on the selected rows
|
|
168
192
|
empty: { fontSize: 16, textColor: Black(0.4) },
|
|
169
|
-
// The search box (showSearch: 1): the params of SearchInput
|
|
193
|
+
// The search box (showSearch: 1): the params of SearchInput: its ozden package (its font and icon sizes, its
|
|
194
|
+
// icons, its bottom line), white, nearly square and without a border, 44 px high (ozdenDark takes it too).
|
|
170
195
|
search: {
|
|
171
|
-
|
|
196
|
+
styleName: "ozden", // A package of SearchInput.styles
|
|
197
|
+
height: 44,
|
|
172
198
|
padding: [0, 0, 0, 0], // left, top, right, bottom: 0, as wide as the list
|
|
173
|
-
fontSize: 18,
|
|
174
199
|
color: "white",
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
border: 0,
|
|
178
|
-
borderColor: "rgba(0, 0, 0, 0.1)",
|
|
179
|
-
borderBottomStyle: "2px solid rgba(0, 0, 0, 0.06)",
|
|
180
|
-
round: 6,
|
|
181
|
-
searchIconSize: 20,
|
|
182
|
-
invertIconColor: 0,
|
|
200
|
+
border: 0, // WHY: the list has its own border: only the bottom line of the package
|
|
201
|
+
round: 2,
|
|
183
202
|
},
|
|
184
203
|
scrollBar: {
|
|
185
204
|
bar_border: 0,
|
|
@@ -204,7 +223,7 @@ const ItemList = function (params = {}) {
|
|
|
204
223
|
const givenHover = params.style && params.style.hover;
|
|
205
224
|
const isHoverOff = !!givenHover && Object.keys(givenHover).length === 0;
|
|
206
225
|
|
|
207
|
-
// Merge style package: params.style > ItemList.styles[styleName] > ItemListDefaults.style (
|
|
226
|
+
// Merge style package: params.style > ItemList.styles[styleName] > ItemListDefaults.style (ozden)
|
|
208
227
|
basic.applyStylePackage(params, ItemList.styles, ItemListDefaults);
|
|
209
228
|
|
|
210
229
|
// Merge params:
|
|
@@ -225,10 +244,16 @@ const ItemList = function (params = {}) {
|
|
|
225
244
|
let removedEntries = []; // animated: the removed items whose rows still fade out (they leave after the motion)
|
|
226
245
|
let selectedKeys = []; // Strings, in the order they were selected
|
|
227
246
|
let focusedKey = null;
|
|
247
|
+
let activeKey = null; // The active row of a combobox (setActiveKey)
|
|
248
|
+
let anchorKey = null; // multiple: a Shift range starts at this row (the last click, Enter or Space without Shift)
|
|
249
|
+
let rangeBaseKeys = []; // multiple: the selection at that time (a Shift range is added to it)
|
|
250
|
+
let typedText = ""; // Type-ahead: the letters typed one after the other
|
|
251
|
+
let cancelTypedText = null;
|
|
228
252
|
let searchText = "";
|
|
229
253
|
let wasAnimated = 0;
|
|
230
254
|
const EMPTY_TEXT_TOP = 24; // The "No results" text under the top of the list
|
|
231
255
|
const PRESS_HOLD_TIME = 50; // ms: the pressed color stays this long, then it fades back with the row motion
|
|
256
|
+
const TYPE_AHEAD_TIME = 600; // ms: the letters typed in this time make one word
|
|
232
257
|
|
|
233
258
|
// animated: 1
|
|
234
259
|
const MOTION_TIME = 0.25; // s
|
|
@@ -257,7 +282,7 @@ const ItemList = function (params = {}) {
|
|
|
257
282
|
};
|
|
258
283
|
|
|
259
284
|
const toItemObject = function (item) {
|
|
260
|
-
if (typeof item === "string") return {
|
|
285
|
+
if (typeof item === "string") return { text: item };
|
|
261
286
|
return item || {};
|
|
262
287
|
};
|
|
263
288
|
|
|
@@ -285,7 +310,17 @@ const ItemList = function (params = {}) {
|
|
|
285
310
|
};
|
|
286
311
|
|
|
287
312
|
const isEntryEnabled = function (entry) {
|
|
288
|
-
return box.enabled == 1 &&
|
|
313
|
+
return box.enabled == 1 && (entry.data.enabled === undefined || basic.isOn(entry.data.enabled));
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
// single, style.selected.canSelectAgain: 0 (ozden): the selected row can not be chosen again.
|
|
317
|
+
const isLockedEntry = function (entry) {
|
|
318
|
+
return box.selection === "single" && _s.selected.canSelectAgain == 0 && isSelected(entry);
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
// A row a click, Enter or Space chooses: enabled, not the locked selected one.
|
|
322
|
+
const isEntryChoosable = function (entry) {
|
|
323
|
+
return isEntryEnabled(entry) && !isLockedEntry(entry);
|
|
289
324
|
};
|
|
290
325
|
|
|
291
326
|
const getSelectedItems = function () {
|
|
@@ -314,7 +349,7 @@ const ItemList = function (params = {}) {
|
|
|
314
349
|
|
|
315
350
|
const getSearchableText = function (entry) {
|
|
316
351
|
const data = entry.data;
|
|
317
|
-
return normalizeText([data.
|
|
352
|
+
return normalizeText([data.text, data.description, data.searchText].join(" "));
|
|
318
353
|
};
|
|
319
354
|
|
|
320
355
|
const isMatch = function (entry) {
|
|
@@ -343,7 +378,12 @@ const ItemList = function (params = {}) {
|
|
|
343
378
|
const isTile = entry.row.isTile;
|
|
344
379
|
const hoverLook = isTile ? _s.tile.hover : _s.hover;
|
|
345
380
|
const selectedLook = isTile ? { color: _s.tile.selectedColor || _s.selected.color, borderColor: _s.selected.borderColor } : _s.selected;
|
|
346
|
-
|
|
381
|
+
// WHY: The active row takes the look of the mouse after the selection: the keyboard sees it on a selected row too.
|
|
382
|
+
// WHY: The locked selected row gets no look of the mouse (canSelectAgain: 0).
|
|
383
|
+
const isLocked = isLockedEntry(entry);
|
|
384
|
+
const activeLook = (entry.key === activeKey && !isLocked) ? hoverLook : {};
|
|
385
|
+
const mouseLook = (entry.isHover && !isLocked) ? hoverLook : {};
|
|
386
|
+
const look = Object.assign({}, _s.row, mouseLook, isOn ? selectedLook : {}, activeLook);
|
|
347
387
|
if (look.opacity === undefined) look.opacity = 1;
|
|
348
388
|
// WHY: In the look, not only in the click: a paint of the selection or of the mouse keeps the pressed color.
|
|
349
389
|
if (entry.isPressed && _s.pressed.color) look.color = _s.pressed.color;
|
|
@@ -360,6 +400,8 @@ const ItemList = function (params = {}) {
|
|
|
360
400
|
|
|
361
401
|
row.color = look.color;
|
|
362
402
|
row.borderColor = look.borderColor;
|
|
403
|
+
paintLines(row, look.lineColor || "");
|
|
404
|
+
row.cursor = isEntryChoosable(entry) ? "pointer" : "default";
|
|
363
405
|
row.css.opacity = String(isEntryEnabled(entry) ? look.opacity : _s.disabled.opacity);
|
|
364
406
|
row.aria = { selected: isOn ? "true" : "false", disabled: isEntryEnabled(entry) ? "false" : "true" };
|
|
365
407
|
|
|
@@ -368,6 +410,20 @@ const ItemList = function (params = {}) {
|
|
|
368
410
|
if (row.isTile) paintTile(row, isOn);
|
|
369
411
|
};
|
|
370
412
|
|
|
413
|
+
// The lines at the top and at the bottom of a row (look.lineColor): inset shadows, so no row moves.
|
|
414
|
+
// WHY: Only when the lines change: the own shadow of a row (style.row.boxShadow, or one set by createItemView)
|
|
415
|
+
// stays under them, and a package without lines never touches it.
|
|
416
|
+
const paintLines = function (row, lineColor) {
|
|
417
|
+
const shownLineColor = row.shownLineColor || "";
|
|
418
|
+
if (lineColor === shownLineColor) return;
|
|
419
|
+
if (!shownLineColor) row.ownShadow = row.boxShadow;
|
|
420
|
+
row.shownLineColor = lineColor;
|
|
421
|
+
const shadows = [];
|
|
422
|
+
if (lineColor) shadows.push("inset 0 1px 0 " + lineColor, "inset 0 -1px 0 " + lineColor);
|
|
423
|
+
if (row.ownShadow) shadows.push(row.ownShadow);
|
|
424
|
+
row.boxShadow = shadows.join(", ");
|
|
425
|
+
};
|
|
426
|
+
|
|
371
427
|
// The effects of a selected tile: the circle goes, the icon grows and gets its colors, the title is bold.
|
|
372
428
|
const paintTile = function (row, isOn) {
|
|
373
429
|
const tile = _s.tile;
|
|
@@ -391,11 +447,18 @@ const ItemList = function (params = {}) {
|
|
|
391
447
|
entries.forEach(paintRow);
|
|
392
448
|
};
|
|
393
449
|
|
|
394
|
-
//
|
|
395
|
-
|
|
396
|
-
|
|
450
|
+
// The row of the Tab order: the focused one, or else the first selected shown one, or else the first shown one.
|
|
451
|
+
// WHY: A listbox is entered at its selection, not always at its top.
|
|
452
|
+
const getTabEntry = function () {
|
|
397
453
|
const focused = findEntry(focusedKey);
|
|
398
|
-
|
|
454
|
+
if (focused && focused.isShown) return focused;
|
|
455
|
+
const shown = getShownEntries();
|
|
456
|
+
return shown.find(isSelected) || shown[0] || null;
|
|
457
|
+
};
|
|
458
|
+
|
|
459
|
+
// Only one row is in the Tab order (getTabEntry).
|
|
460
|
+
const refreshTabOrder = function () {
|
|
461
|
+
const tabEntry = getTabEntry();
|
|
399
462
|
entries.forEach(function (e) {
|
|
400
463
|
// WHY: A section gets no tabIndex: even a click does not focus it.
|
|
401
464
|
if (!e.row || e.isSection) return;
|
|
@@ -411,12 +474,17 @@ const ItemList = function (params = {}) {
|
|
|
411
474
|
return icon;
|
|
412
475
|
};
|
|
413
476
|
|
|
477
|
+
const fitTileIcon = function (row) {
|
|
478
|
+
if (row.icon && _s.tile.iconFit) row.icon.imageFit = _s.tile.iconFit;
|
|
479
|
+
};
|
|
480
|
+
|
|
414
481
|
// A tile icon may sit in a circle (style.tile.frameSize).
|
|
415
482
|
const createTileIcon = function (row, entry) {
|
|
416
483
|
const tile = _s.tile;
|
|
417
484
|
if (!entry.data.iconFile) return;
|
|
418
485
|
if (!(tile.frameSize > 0)) {
|
|
419
486
|
row.icon = createIcon(entry, tile.iconSize);
|
|
487
|
+
fitTileIcon(row);
|
|
420
488
|
return;
|
|
421
489
|
}
|
|
422
490
|
// GROUP: The circle behind the icon
|
|
@@ -426,6 +494,7 @@ const ItemList = function (params = {}) {
|
|
|
426
494
|
row.iconFrame.clipContent = 0; // WHY: The selected icon grows out of the circle.
|
|
427
495
|
row.iconFrame.setMotion("background-color 0.3s");
|
|
428
496
|
row.icon = createIcon(entry, tile.iconSize);
|
|
497
|
+
fitTileIcon(row);
|
|
429
498
|
endGroup();
|
|
430
499
|
};
|
|
431
500
|
|
|
@@ -434,11 +503,11 @@ const ItemList = function (params = {}) {
|
|
|
434
503
|
row.texts = VGroup({ width: isTile ? "100%" : "auto", height: "auto", align: isTile ? "center top" : "left center", gap: 0 });
|
|
435
504
|
row.texts.css = { flex: isTile ? "" : "1 1 0", minWidth: "0", alignItems: "stretch" };
|
|
436
505
|
|
|
437
|
-
row.lblTitle = Label({ plainText: entry.data.
|
|
506
|
+
row.lblTitle = Label({ plainText: entry.data.text || "", width: "100%", fontSize: _s.title.fontSize, ellipsis: 1 });
|
|
438
507
|
if (_s.title.fontFamily) row.lblTitle.fontFamily = _s.title.fontFamily;
|
|
439
508
|
|
|
440
|
-
if (entry.data.
|
|
441
|
-
row.lblDesc = Label({ plainText: entry.data.
|
|
509
|
+
if (entry.data.description) {
|
|
510
|
+
row.lblDesc = Label({ plainText: entry.data.description, width: "100%", fontSize: _s.desc.fontSize, textColor: _s.desc.textColor, ellipsis: 1 });
|
|
442
511
|
row.lblDesc.css.marginTop = (_s.desc.marginTop || 0) + "px";
|
|
443
512
|
}
|
|
444
513
|
|
|
@@ -475,9 +544,15 @@ const ItemList = function (params = {}) {
|
|
|
475
544
|
createTexts(row, entry, isTile);
|
|
476
545
|
};
|
|
477
546
|
|
|
547
|
+
const isFitRowGrid = function () {
|
|
548
|
+
return box.layout === "grid" && basic.isOn(_s.tile.fitRow);
|
|
549
|
+
};
|
|
550
|
+
|
|
478
551
|
const createRowBox = function (isTile) {
|
|
479
552
|
if (isTile) {
|
|
480
|
-
|
|
553
|
+
// WHY "auto": a cell of the grid of fitRow gives the width (createListGroup)
|
|
554
|
+
const width = isFitRowGrid() ? "auto" : _s.tile.width;
|
|
555
|
+
return VGroup({ width: width, height: _s.tile.height, align: "center top", gap: _s.tile.gap, padding: _s.tile.padding });
|
|
481
556
|
}
|
|
482
557
|
return HGroup({ width: "100%", height: _s.row.height, align: "left center", gap: _s.row.gap, padding: _s.row.padding });
|
|
483
558
|
};
|
|
@@ -493,13 +568,12 @@ const ItemList = function (params = {}) {
|
|
|
493
568
|
row.shrink = 0;
|
|
494
569
|
row.round = _s.row.round;
|
|
495
570
|
row.border = _s.row.border;
|
|
496
|
-
row.cursor = "pointer";
|
|
497
571
|
row.clickable = 1;
|
|
498
572
|
row.clipContent = 0; // WHY: The focus ring is drawn on the edge of the row.
|
|
499
573
|
if (_s.row.boxShadow) row.boxShadow = _s.row.boxShadow;
|
|
500
574
|
setStartMotion(row, entry);
|
|
501
575
|
row.role = "option";
|
|
502
|
-
row.aria = { label: entry.data.
|
|
576
|
+
row.aria = { label: entry.data.text || entry.key };
|
|
503
577
|
row.setFocusRing(_s.focus.ringColor);
|
|
504
578
|
|
|
505
579
|
createRowContent(row, entry, isTile);
|
|
@@ -526,7 +600,7 @@ const ItemList = function (params = {}) {
|
|
|
526
600
|
if (typeof box.createSectionView === "function") {
|
|
527
601
|
box.createSectionView(entry.item, row, box);
|
|
528
602
|
} else {
|
|
529
|
-
row.lblTitle = Label({ plainText: entry.data.
|
|
603
|
+
row.lblTitle = Label({ plainText: entry.data.text || "", width: width, fontSize: section.fontSize, textColor: section.textColor, ellipsis: 1 });
|
|
530
604
|
if (section.fontFamily) row.lblTitle.fontFamily = section.fontFamily;
|
|
531
605
|
}
|
|
532
606
|
|
|
@@ -560,12 +634,8 @@ const ItemList = function (params = {}) {
|
|
|
560
634
|
const row = entry.row;
|
|
561
635
|
row.on("click", function (self, event) {
|
|
562
636
|
// WHY: A removed row that still fades out is not clicked (a button made in it by createItemView).
|
|
563
|
-
if (entry.isLeaving
|
|
564
|
-
|
|
565
|
-
focusedKey = entry.key;
|
|
566
|
-
refreshTabOrder();
|
|
567
|
-
box.onItemClick(box, entry.item, indexOf(entry), event);
|
|
568
|
-
toggleEntry(entry, 0);
|
|
637
|
+
if (entry.isLeaving) return;
|
|
638
|
+
activateEntry(entry, event);
|
|
569
639
|
});
|
|
570
640
|
row.onHoverChange(function (self, isOver) {
|
|
571
641
|
entry.isHover = (isOver && isEntryEnabled(entry)) ? 1 : 0;
|
|
@@ -583,7 +653,10 @@ const ItemList = function (params = {}) {
|
|
|
583
653
|
return group;
|
|
584
654
|
}
|
|
585
655
|
if (box.layout === "grid") {
|
|
586
|
-
|
|
656
|
+
const grid = HGroup({ width: "100%", height: "auto", align: "left top", gap: _s.tile.spacing, padding: _s.tile.listPadding, wrap: 1 });
|
|
657
|
+
// tile.fitRow: columns of tile.width at least that fill the row (the browser counts them at every width)
|
|
658
|
+
if (isFitRowGrid()) grid.css = { display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(" + _s.tile.width + "px, 1fr))" };
|
|
659
|
+
return grid;
|
|
587
660
|
}
|
|
588
661
|
const group = VGroup({ width: "100%", height: "auto", align: "left top", gap: _s.list.gap, padding: _s.box.padding });
|
|
589
662
|
group.css.alignItems = "stretch";
|
|
@@ -639,7 +712,11 @@ const ItemList = function (params = {}) {
|
|
|
639
712
|
box.wrapper.css.boxSizing = "border-box";
|
|
640
713
|
box.wrapper.clipContent = 0;
|
|
641
714
|
box.wrapper.role = "listbox";
|
|
642
|
-
box.wrapper.aria = {
|
|
715
|
+
box.wrapper.aria = {
|
|
716
|
+
label: box.ariaLabel,
|
|
717
|
+
multiselectable: (box.selection === "multiple") ? "true" : "false",
|
|
718
|
+
orientation: (box.layout === "horizontal") ? "horizontal" : null, // (the default of a listbox: vertical)
|
|
719
|
+
};
|
|
643
720
|
entries.forEach(createRow);
|
|
644
721
|
endGroup();
|
|
645
722
|
});
|
|
@@ -863,10 +940,71 @@ const ItemList = function (params = {}) {
|
|
|
863
940
|
const before = selectedKeys.join("\n");
|
|
864
941
|
selectedKeys = keys;
|
|
865
942
|
paintAll();
|
|
943
|
+
refreshTabOrder(); // WHY: The Tab order goes to the selection while no row was focused.
|
|
866
944
|
if (silent || before === selectedKeys.join("\n")) return;
|
|
867
945
|
box.onChange(box, getSelectedItems());
|
|
868
946
|
};
|
|
869
947
|
|
|
948
|
+
// A click, Enter or Space on a row: the pressed flash, onItemClick and the selection. With Shift in a multiple
|
|
949
|
+
// list: the rows from the anchor to this one (selectRange).
|
|
950
|
+
// WHY: Enter and Space did not call onItemClick: a list without selection (a menu) could not be used with keys.
|
|
951
|
+
const activateEntry = function (entry, event) {
|
|
952
|
+
if (!isEntryChoosable(entry)) return;
|
|
953
|
+
flashRow(entry);
|
|
954
|
+
focusedKey = entry.key;
|
|
955
|
+
refreshTabOrder();
|
|
956
|
+
box.onItemClick(box, entry.item, indexOf(entry), event);
|
|
957
|
+
if (isRangeEvent(event)) {
|
|
958
|
+
selectRange(entry, entry);
|
|
959
|
+
return;
|
|
960
|
+
}
|
|
961
|
+
toggleEntry(entry, 0);
|
|
962
|
+
setAnchor(entry);
|
|
963
|
+
};
|
|
964
|
+
|
|
965
|
+
const isRangeEvent = function (event) {
|
|
966
|
+
return box.selection === "multiple" && !!event && event.shiftKey;
|
|
967
|
+
};
|
|
968
|
+
|
|
969
|
+
// multiple: a Shift range starts at this row and is added to the selection of this time.
|
|
970
|
+
const setAnchor = function (entry) {
|
|
971
|
+
anchorKey = entry.key;
|
|
972
|
+
rangeBaseKeys = selectedKeys.slice();
|
|
973
|
+
};
|
|
974
|
+
|
|
975
|
+
// WHY: A selection changed by code: the next Shift range must not bring its old keys back.
|
|
976
|
+
const forgetAnchor = function () {
|
|
977
|
+
anchorKey = null;
|
|
978
|
+
rangeBaseKeys = [];
|
|
979
|
+
};
|
|
980
|
+
|
|
981
|
+
// multiple: the enabled shown rows from the anchor to this one are selected, over the selection of the anchor
|
|
982
|
+
// time. A Shift move back makes the range shorter (the rows it leaves are not selected any more).
|
|
983
|
+
// startEntry: the anchor when there is none yet (the row the Shift move started from).
|
|
984
|
+
const selectRange = function (entry, startEntry) {
|
|
985
|
+
const shown = getShownEntries();
|
|
986
|
+
const anchor = findEntry(anchorKey);
|
|
987
|
+
if (!anchor || !anchor.isShown) setAnchor(startEntry);
|
|
988
|
+
const from = shown.indexOf(findEntry(anchorKey));
|
|
989
|
+
const to = shown.indexOf(entry);
|
|
990
|
+
const rangeKeys = shown.slice(Math.min(from, to), Math.max(from, to) + 1)
|
|
991
|
+
.filter(isEntryEnabled)
|
|
992
|
+
.map(function (e) { return e.key; });
|
|
993
|
+
const newKeys = rangeKeys.filter(function (key) { return !rangeBaseKeys.includes(key); });
|
|
994
|
+
setSelectedKeys(rangeBaseKeys.concat(newKeys), 0);
|
|
995
|
+
};
|
|
996
|
+
|
|
997
|
+
// multiple: Ctrl / Cmd + A selects every shown enabled item; when they are all selected, none of them.
|
|
998
|
+
// The hidden ones (a search) keep their selection.
|
|
999
|
+
const toggleAllShown = function (shown) {
|
|
1000
|
+
const keys = shown.filter(isEntryEnabled).map(function (e) { return e.key; });
|
|
1001
|
+
const isAllSelected = keys.every(function (key) { return selectedKeys.includes(key); });
|
|
1002
|
+
const otherKeys = selectedKeys.filter(function (key) { return !keys.includes(key); });
|
|
1003
|
+
const newKeys = keys.filter(function (key) { return !selectedKeys.includes(key); });
|
|
1004
|
+
setSelectedKeys(isAllSelected ? otherKeys : selectedKeys.concat(newKeys), 0);
|
|
1005
|
+
forgetAnchor();
|
|
1006
|
+
};
|
|
1007
|
+
|
|
870
1008
|
// A click, Enter or Space on a row.
|
|
871
1009
|
const toggleEntry = function (entry, silent) {
|
|
872
1010
|
if (box.selection === "none" || entry.isSection) return;
|
|
@@ -986,34 +1124,118 @@ const ItemList = function (params = {}) {
|
|
|
986
1124
|
return shown[Math.max(0, Math.min(shown.length - 1, position + step))];
|
|
987
1125
|
};
|
|
988
1126
|
|
|
1127
|
+
// PageDown / PageUp: as many rows (in a grid: lines) as the list shows, less one. null: an "auto" height list
|
|
1128
|
+
// (it does not scroll in itself: the key scrolls the page).
|
|
1129
|
+
const getPageTarget = function (entry, shown, direction) {
|
|
1130
|
+
if (isAutoHeight) return null;
|
|
1131
|
+
const isHorizontal = (box.layout === "horizontal");
|
|
1132
|
+
const visibleSize = isHorizontal ? box.scrollBox.elem.clientWidth : box.scrollBox.elem.clientHeight;
|
|
1133
|
+
const rowSize = isHorizontal ? entry.row.elem.offsetWidth : entry.row.elem.offsetHeight;
|
|
1134
|
+
const count = Math.max(1, Math.floor(visibleSize / Math.max(1, rowSize)) - 1);
|
|
1135
|
+
if (box.layout === "grid") {
|
|
1136
|
+
let target = entry;
|
|
1137
|
+
for (let i = 0; i < count; i++) target = getGridNeighbor(target, shown, direction);
|
|
1138
|
+
return target;
|
|
1139
|
+
}
|
|
1140
|
+
const position = shown.indexOf(entry) + direction * count;
|
|
1141
|
+
return shown[Math.max(0, Math.min(shown.length - 1, position))];
|
|
1142
|
+
};
|
|
1143
|
+
|
|
1144
|
+
// The row a key moves the focus to: an arrow, Home / End, PageUp / PageDown. null: the key does not move it.
|
|
1145
|
+
const getMoveTarget = function (entry, key, shown) {
|
|
1146
|
+
if (key === "Home") return shown[0];
|
|
1147
|
+
if (key === "End") return shown[shown.length - 1];
|
|
1148
|
+
if (key === "PageDown") return getPageTarget(entry, shown, 1);
|
|
1149
|
+
if (key === "PageUp") return getPageTarget(entry, shown, -1);
|
|
1150
|
+
return getArrowTarget(entry, key, shown);
|
|
1151
|
+
};
|
|
1152
|
+
|
|
1153
|
+
// WHY: The arrow up from the first line of the list goes back to the search box over it.
|
|
1154
|
+
const isOnFirstLine = function (entry, shown) {
|
|
1155
|
+
if (box.layout === "horizontal") return true;
|
|
1156
|
+
return entry.row.elem.offsetTop === shown[0].row.elem.offsetTop;
|
|
1157
|
+
};
|
|
1158
|
+
|
|
1159
|
+
const isSelectAllKey = function (event) {
|
|
1160
|
+
const isCommand = event.ctrlKey || event.metaKey;
|
|
1161
|
+
return box.selection === "multiple" && isCommand && event.key.toLowerCase() === "a";
|
|
1162
|
+
};
|
|
1163
|
+
|
|
1164
|
+
// A letter of a word (type-ahead): not a key with Ctrl, Cmd or Alt.
|
|
1165
|
+
const isTypedLetter = function (event) {
|
|
1166
|
+
return event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey;
|
|
1167
|
+
};
|
|
1168
|
+
|
|
1169
|
+
// Type-ahead: the letters typed one after the other move the focus to the next item whose text starts with them
|
|
1170
|
+
// (Turkish letters without their marks). The same letter again goes on to the next item with that letter.
|
|
1171
|
+
const typeAhead = function (entry, letter, shown) {
|
|
1172
|
+
if (cancelTypedText) cancelTypedText();
|
|
1173
|
+
typedText += normalizeText(letter);
|
|
1174
|
+
cancelTypedText = box.after(TYPE_AHEAD_TIME, function () {
|
|
1175
|
+
typedText = "";
|
|
1176
|
+
cancelTypedText = null;
|
|
1177
|
+
});
|
|
1178
|
+
const isOneLetter = typedText.split("").every(function (c) { return c === typedText[0]; });
|
|
1179
|
+
const word = isOneLetter ? typedText[0] : typedText;
|
|
1180
|
+
// WHY: One letter starts after the focused row (the same letter goes on); a word may stay on it.
|
|
1181
|
+
const start = shown.indexOf(entry) + (isOneLetter ? 1 : 0);
|
|
1182
|
+
const ordered = shown.slice(start).concat(shown.slice(0, start));
|
|
1183
|
+
const target = ordered.find(function (e) { return normalizeText(e.data.text).startsWith(word); });
|
|
1184
|
+
if (target) focusEntry(target);
|
|
1185
|
+
};
|
|
1186
|
+
|
|
989
1187
|
const onRowKeyDown = function (entry, event) {
|
|
1188
|
+
// WHY: the keys of a field inside the row (createItemView) are its own: a space could not be typed in it
|
|
1189
|
+
if (event.target !== entry.row.elem) return;
|
|
990
1190
|
if (box.enabled != 1 || entry.isLeaving) return;
|
|
991
1191
|
const shown = getShownEntries();
|
|
992
1192
|
|
|
993
|
-
if (event
|
|
1193
|
+
if (isSelectAllKey(event)) {
|
|
1194
|
+
event.preventDefault();
|
|
1195
|
+
toggleAllShown(shown);
|
|
1196
|
+
return;
|
|
1197
|
+
}
|
|
1198
|
+
// WHY: A space while a word is typed is a letter of the word (type-ahead).
|
|
1199
|
+
const isSpace = (event.key === " " && typedText === "");
|
|
1200
|
+
if (event.key === "Enter" || isSpace) {
|
|
994
1201
|
event.preventDefault();
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
1202
|
+
// WHY: A key held down repeats: it would open an item again and again, or turn its selection on and off.
|
|
1203
|
+
if (event.repeat) return;
|
|
1204
|
+
activateEntry(entry, event);
|
|
998
1205
|
return;
|
|
999
1206
|
}
|
|
1000
|
-
if (event.key === "
|
|
1207
|
+
if (event.key === "ArrowUp" && box.searchInput && isOnFirstLine(entry, shown)) {
|
|
1001
1208
|
event.preventDefault();
|
|
1002
|
-
|
|
1209
|
+
box.searchInput.focus();
|
|
1003
1210
|
return;
|
|
1004
1211
|
}
|
|
1212
|
+
const target = getMoveTarget(entry, event.key, shown);
|
|
1213
|
+
if (target) {
|
|
1214
|
+
event.preventDefault();
|
|
1215
|
+
focusEntry(target);
|
|
1216
|
+
if (isRangeEvent(event)) selectRange(target, entry);
|
|
1217
|
+
return;
|
|
1218
|
+
}
|
|
1219
|
+
if (isTypedLetter(event)) {
|
|
1220
|
+
event.preventDefault();
|
|
1221
|
+
typeAhead(entry, event.key, shown);
|
|
1222
|
+
}
|
|
1223
|
+
};
|
|
1005
1224
|
|
|
1006
|
-
|
|
1007
|
-
|
|
1225
|
+
// The arrow down in the search box goes into the list: to its row of the Tab order (getTabEntry).
|
|
1226
|
+
const onSearchKeyDown = function (self, event) {
|
|
1227
|
+
if (event.key !== "ArrowDown") return;
|
|
1228
|
+
const tabEntry = getTabEntry();
|
|
1229
|
+
if (!tabEntry) return;
|
|
1008
1230
|
event.preventDefault();
|
|
1009
|
-
focusEntry(
|
|
1231
|
+
focusEntry(tabEntry);
|
|
1010
1232
|
};
|
|
1011
1233
|
|
|
1012
1234
|
// The search box over the list (showSearch: 1). Returns its height with its padding (0: no search box).
|
|
1013
1235
|
const createSearch = function () {
|
|
1014
1236
|
if (box.showSearch != 1) return 0;
|
|
1015
1237
|
if (typeof SearchInput === "undefined") {
|
|
1016
|
-
console.warn("ItemList: showSearch needs comp/search-input
|
|
1238
|
+
console.warn("ItemList: showSearch needs comp/search-input.js (SearchInput).");
|
|
1017
1239
|
return 0;
|
|
1018
1240
|
}
|
|
1019
1241
|
const search = _s.search;
|
|
@@ -1022,12 +1244,14 @@ const ItemList = function (params = {}) {
|
|
|
1022
1244
|
// GROUP: Search area
|
|
1023
1245
|
box.searchArea = HGroup({ width: "100%", height: search.height + padding[1] + padding[3], align: "left top", padding: padding });
|
|
1024
1246
|
if (isAutoHeight) box.searchArea.position = "relative";
|
|
1025
|
-
|
|
1247
|
+
// WHY clearOnEscape: Escape clears the search (as the clear icon); searchParams can turn it off.
|
|
1248
|
+
const searchParams = Object.assign({ clearOnEscape: 1 }, search, box.searchParams);
|
|
1026
1249
|
delete searchParams.padding;
|
|
1027
1250
|
searchParams.width = "100%";
|
|
1028
1251
|
searchParams.position = "relative";
|
|
1029
|
-
searchParams.
|
|
1252
|
+
searchParams.onChange = function (self) { box.search(self.getSearchText()); };
|
|
1030
1253
|
box.searchInput = SearchInput(searchParams);
|
|
1254
|
+
box.searchInput.txtSearch.on("keydown", onSearchKeyDown);
|
|
1031
1255
|
endGroup();
|
|
1032
1256
|
|
|
1033
1257
|
return search.height + padding[1] + padding[3];
|
|
@@ -1037,8 +1261,8 @@ const ItemList = function (params = {}) {
|
|
|
1037
1261
|
// WHY: Only when it is another text: the box gives a lower case text to search(); it must not change what is typed.
|
|
1038
1262
|
const syncSearchInput = function (text) {
|
|
1039
1263
|
if (!box.searchInput) return;
|
|
1040
|
-
if (normalizeText(box.searchInput.
|
|
1041
|
-
box.searchInput.
|
|
1264
|
+
if (normalizeText(box.searchInput.value).trim() === normalizeText(text).trim()) return;
|
|
1265
|
+
box.searchInput.setValue(String(text || ""), 1);
|
|
1042
1266
|
};
|
|
1043
1267
|
|
|
1044
1268
|
// *** PUBLIC FUNCTIONS:
|
|
@@ -1047,9 +1271,10 @@ const ItemList = function (params = {}) {
|
|
|
1047
1271
|
entries = (Array.isArray(items) ? items : []).map(toEntry);
|
|
1048
1272
|
selectedKeys = selectedKeys.filter(isSelectableKey);
|
|
1049
1273
|
if (!findEntry(focusedKey)) focusedKey = null;
|
|
1274
|
+
forgetAnchor();
|
|
1050
1275
|
createRows();
|
|
1051
1276
|
};
|
|
1052
|
-
// USAGE: list.setItems([{ key: "a",
|
|
1277
|
+
// USAGE: list.setItems([{ key: "a", text: "A" }, "B"]) // onChange is not called. Selected keys that are still there stay selected.
|
|
1053
1278
|
|
|
1054
1279
|
box.getItems = function () {
|
|
1055
1280
|
return entries.map(function (e) { return e.item; });
|
|
@@ -1092,7 +1317,7 @@ const ItemList = function (params = {}) {
|
|
|
1092
1317
|
applySearch(isMotionOn());
|
|
1093
1318
|
});
|
|
1094
1319
|
};
|
|
1095
|
-
// USAGE: list.addItem({ key: "x",
|
|
1320
|
+
// USAGE: list.addItem({ key: "x", text: "X" }) or list.addItem({ key: "y", text: "Y" }, 0)
|
|
1096
1321
|
|
|
1097
1322
|
// silent: 1 -> onChange is not called (when the removed item was selected). Returns the removed item.
|
|
1098
1323
|
// animated: 1 -> its row fades out, then it leaves and the rows under it move up. (The data changes at once.)
|
|
@@ -1126,7 +1351,7 @@ const ItemList = function (params = {}) {
|
|
|
1126
1351
|
oldRow.remove();
|
|
1127
1352
|
applySearch();
|
|
1128
1353
|
};
|
|
1129
|
-
// USAGE: list.updateItem("tomato", {
|
|
1354
|
+
// USAGE: list.updateItem("tomato", { description: "Fruit", iconFile: "tomato.png" })
|
|
1130
1355
|
|
|
1131
1356
|
box.getSelectedKeys = function () {
|
|
1132
1357
|
return selectedKeys.slice();
|
|
@@ -1140,6 +1365,7 @@ const ItemList = function (params = {}) {
|
|
|
1140
1365
|
// silent: 1 -> onChange is not called.
|
|
1141
1366
|
box.setSelected = function (keys, silent = 0) {
|
|
1142
1367
|
setSelectedKeys(cleanKeys(keys), silent);
|
|
1368
|
+
forgetAnchor();
|
|
1143
1369
|
scrollToFirstSelected();
|
|
1144
1370
|
};
|
|
1145
1371
|
// USAGE: list.setSelected("broccoli") or list.setSelected(["a", "b"], 1)
|
|
@@ -1148,15 +1374,18 @@ const ItemList = function (params = {}) {
|
|
|
1148
1374
|
const entry = findEntry(key);
|
|
1149
1375
|
if (!entry || entry.isSection || isSelected(entry)) return;
|
|
1150
1376
|
toggleEntry(entry, silent);
|
|
1377
|
+
forgetAnchor();
|
|
1151
1378
|
if (box.scrollToSelected == 1) scrollRowIntoView(entry);
|
|
1152
1379
|
};
|
|
1153
1380
|
|
|
1154
1381
|
box.unselect = function (key, silent = 0) {
|
|
1155
1382
|
setSelectedKeys(selectedKeys.filter(function (k) { return k !== String(key); }), silent);
|
|
1383
|
+
forgetAnchor();
|
|
1156
1384
|
};
|
|
1157
1385
|
|
|
1158
1386
|
box.clearSelection = function (silent = 0) {
|
|
1159
1387
|
setSelectedKeys([], silent);
|
|
1388
|
+
forgetAnchor();
|
|
1160
1389
|
};
|
|
1161
1390
|
|
|
1162
1391
|
// Shows only the matching items (and the sections over them). Returns the count of the shown items. "": all of them.
|
|
@@ -1166,7 +1395,7 @@ const ItemList = function (params = {}) {
|
|
|
1166
1395
|
applySearch();
|
|
1167
1396
|
return getShownEntries().length;
|
|
1168
1397
|
};
|
|
1169
|
-
// USAGE: searchInput.
|
|
1398
|
+
// USAGE: searchInput.onChange = function (self) { list.search(self.getSearchText()); };
|
|
1170
1399
|
|
|
1171
1400
|
box.setLayout = function (layout) {
|
|
1172
1401
|
box.layout = normalizeLayout(layout);
|
|
@@ -1178,6 +1407,7 @@ const ItemList = function (params = {}) {
|
|
|
1178
1407
|
box.setSelection = function (selection) {
|
|
1179
1408
|
box.selection = selection;
|
|
1180
1409
|
selectedKeys = cleanKeys(selectedKeys);
|
|
1410
|
+
forgetAnchor();
|
|
1181
1411
|
createRows(); // WHY: The check marks are made (or not) with the rows.
|
|
1182
1412
|
};
|
|
1183
1413
|
// USAGE: list.setSelection("multiple")
|
|
@@ -1214,6 +1444,22 @@ const ItemList = function (params = {}) {
|
|
|
1214
1444
|
refreshEmptyText();
|
|
1215
1445
|
};
|
|
1216
1446
|
|
|
1447
|
+
// The active row of a combobox (SelectBox: the row of its arrow keys) gets the look of the mouse (style.hover),
|
|
1448
|
+
// also when it is selected. It is then the only row with that look. null: none.
|
|
1449
|
+
// WHY: The keyboard stays in the field of the combobox: the list does not get the focus, it only shows the row.
|
|
1450
|
+
// The mouse makes its row active itself (SelectBox: mousemove), so the row under the mouse loses its look
|
|
1451
|
+
// when the arrow keys move the active row: two rows were white.
|
|
1452
|
+
box.setActiveKey = function (key) {
|
|
1453
|
+
const oldEntries = entries.filter(function (e) { return e.isHover || e.key === activeKey; });
|
|
1454
|
+
activeKey = (key === null || key === undefined) ? null : String(key);
|
|
1455
|
+
oldEntries.forEach(function (e) {
|
|
1456
|
+
e.isHover = 0;
|
|
1457
|
+
paintRow(e);
|
|
1458
|
+
});
|
|
1459
|
+
const entry = findEntry(activeKey);
|
|
1460
|
+
if (entry) paintRow(entry);
|
|
1461
|
+
};
|
|
1462
|
+
|
|
1217
1463
|
// *** OBJECT VIEW:
|
|
1218
1464
|
|
|
1219
1465
|
box.color = _s.box.color;
|
|
@@ -1270,40 +1516,52 @@ ItemList.getCheckSvg = function (color, size) {
|
|
|
1270
1516
|
};
|
|
1271
1517
|
|
|
1272
1518
|
// *** STYLE PACKAGES:
|
|
1273
|
-
// USAGE: ItemList({ styleName: "
|
|
1519
|
+
// USAGE: ItemList({ styleName: "light" })
|
|
1274
1520
|
// USAGE: ItemList({ styleName: "dark", style: { row: { round: 4 } } }) // Change only some keys.
|
|
1275
1521
|
// USAGE: ItemList({ style: ItemList.styles.dark }) // The same as styleName: "dark". (The package is copied, never changed.)
|
|
1276
|
-
// NOTE: A new package needs only the keys that differ from the default (
|
|
1522
|
+
// NOTE: A new package needs only the keys that differ from the default (ozden) style.
|
|
1277
1523
|
// USAGE: ItemList.styles.myStyle = { row: { color: "ivory" } };
|
|
1278
1524
|
ItemList.styles = {
|
|
1279
1525
|
|
|
1280
|
-
// The rows
|
|
1281
|
-
//
|
|
1526
|
+
// The rows: white under the mouse, the selected one half transparent. The tiles: a grey icon in a circle that
|
|
1527
|
+
// grows when it is selected.
|
|
1528
|
+
ozden: ItemListDefaults.style,
|
|
1529
|
+
|
|
1530
|
+
// WHY: The old name of ozden: a page written with styleName: "classic" gets the same look without a warning.
|
|
1282
1531
|
classic: ItemListDefaults.style,
|
|
1283
1532
|
|
|
1284
|
-
//
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
},
|
|
1299
|
-
|
|
1533
|
+
// The dark theme of ozden: the same shapes on a dark page (#1A1A19). A row gets a lighter
|
|
1534
|
+
// gray with a thin light line above and under it under the mouse, the selected one is half transparent, the
|
|
1535
|
+
// search box is the ozdenDark SearchInput in the gray of the mouse.
|
|
1536
|
+
ozdenDark: {
|
|
1537
|
+
box: { color: "#1A1A19", borderColor: White(0.22) },
|
|
1538
|
+
hover: { color: "#262624", lineColor: White(0.14) },
|
|
1539
|
+
focus: { ringColor: White(0.5) },
|
|
1540
|
+
title: { textColor: White(0.88) },
|
|
1541
|
+
desc: { textColor: White(0.45) },
|
|
1542
|
+
section: { textColor: White(0.4) },
|
|
1543
|
+
check: { color: "#E6E6E4", iconColor: "#1A1A19", borderColor: White(0.3) },
|
|
1544
|
+
empty: { textColor: White(0.4) },
|
|
1545
|
+
tile: { frameColor: White(0.06), selectedColor: "#262624" },
|
|
1546
|
+
search: { styleName: "ozdenDark", color: "#262624" },
|
|
1547
|
+
scrollBar: { bar_color: "#CFCFCD", bar_mouseOverColor: "#CFCFCD" },
|
|
1548
|
+
},
|
|
1549
|
+
|
|
1550
|
+
// The light look of the kit (_designs/item-list.htm): a white box with one thin line and round 10 corners, flat
|
|
1551
|
+
// rows of 56 px; the row under the mouse in a soft gray, the selected one in a tint of the accent with a full
|
|
1552
|
+
// mark (an empty circle on the other rows).
|
|
1553
|
+
light: {
|
|
1554
|
+
box: { color: "#FFFFFF", border: 1, borderColor: Black(0.12), round: 10, padding: 6 },
|
|
1555
|
+
list: { gap: 2 }, // WHY: the colors of two rows never meet
|
|
1556
|
+
row: { height: 56, padding: [12, 10], gap: 12, color: "transparent", round: 8 },
|
|
1557
|
+
// WHY: The effects of the ozden tiles (a grey icon in a circle that grows) are turned off.
|
|
1300
1558
|
tile: {
|
|
1301
1559
|
width: 132,
|
|
1302
1560
|
height: "auto",
|
|
1303
1561
|
padding: [12, 14],
|
|
1304
1562
|
gap: 8,
|
|
1305
1563
|
spacing: 8,
|
|
1306
|
-
listPadding:
|
|
1564
|
+
listPadding: 6, // as box.padding
|
|
1307
1565
|
iconSize: 56,
|
|
1308
1566
|
frameSize: 0,
|
|
1309
1567
|
iconFilter: "",
|
|
@@ -1311,53 +1569,42 @@ ItemList.styles = {
|
|
|
1311
1569
|
selectedIconFilter: "",
|
|
1312
1570
|
selectedFontFamily: "",
|
|
1313
1571
|
selectedColor: "",
|
|
1314
|
-
hover: { color: "#
|
|
1572
|
+
hover: { color: "#F2F3F0" },
|
|
1315
1573
|
},
|
|
1316
|
-
section: { padding: [
|
|
1317
|
-
hover: { color: "#
|
|
1318
|
-
selected: { color: "#
|
|
1319
|
-
focus: { ringColor: "rgba(61, 122, 107, 0.
|
|
1320
|
-
icon: { size:
|
|
1321
|
-
title: { fontSize: 15, textColor: Black(0.
|
|
1322
|
-
desc: { fontSize: 13, textColor: Black(0.
|
|
1323
|
-
check: { visible: 1, size: 20, color: "#3D7A6B", iconColor: "
|
|
1324
|
-
empty: { fontSize: 14, textColor: Black(0.
|
|
1574
|
+
section: { padding: [12, 6], fontSize: 13, textColor: Black(0.55) }, // WHY 12: over the icons of the rows
|
|
1575
|
+
hover: { color: "#F2F3F0", lineColor: "" }, // WHY: "": the lines of ozden are not filled in.
|
|
1576
|
+
selected: { color: "#E4EFEB", opacity: 1, canSelectAgain: 1 }, // WHY 1: a click on it is an onItemClick again (the rule of ozden is its own)
|
|
1577
|
+
focus: { ringColor: "rgba(61, 122, 107, 0.5)" },
|
|
1578
|
+
icon: { size: 36, round: 8, color: "#F2F3F0" },
|
|
1579
|
+
title: { fontSize: 15, textColor: Black(0.88), fontFamily: "opensans" },
|
|
1580
|
+
desc: { fontSize: 13, textColor: Black(0.55), marginTop: 0 },
|
|
1581
|
+
check: { visible: 1, size: 20, color: "#3D7A6B", iconColor: "#FFFFFF", borderColor: Black(0.25) },
|
|
1582
|
+
empty: { fontSize: 14, textColor: Black(0.55) },
|
|
1583
|
+
// The search field of the light look: SearchInput light, round 8 as the rows.
|
|
1584
|
+
// WHY border and round: the search box of ozden (the default) has border 0 and round 2, and its keys fill
|
|
1585
|
+
// this package.
|
|
1325
1586
|
search: {
|
|
1326
|
-
|
|
1327
|
-
padding: [
|
|
1328
|
-
fontSize: 15,
|
|
1329
|
-
color: "white",
|
|
1587
|
+
styleName: "light", // A package of SearchInput.styles
|
|
1588
|
+
padding: [6, 6, 6, 0], // left, top, right, bottom: as box.padding (the rows have their own 6 under it)
|
|
1330
1589
|
border: 1,
|
|
1331
|
-
|
|
1332
|
-
borderBottomStyle: "1px solid " + Black(0.1),
|
|
1333
|
-
round: 10,
|
|
1334
|
-
searchIconSize: 18,
|
|
1590
|
+
round: 8,
|
|
1335
1591
|
},
|
|
1336
1592
|
scrollBar: { bar_color: "#A0A0A0", bar_mouseOverColor: "#6E6E6C", neverHide: 0, showDots: 0 },
|
|
1337
1593
|
},
|
|
1338
1594
|
|
|
1339
|
-
// The dark
|
|
1595
|
+
// The dark look of the kit: the same shapes on the dark surface (#232322, on a #1A1A19 page).
|
|
1340
1596
|
dark: {
|
|
1341
|
-
box: { padding:
|
|
1342
|
-
list: { gap:
|
|
1343
|
-
row: {
|
|
1344
|
-
|
|
1345
|
-
padding: [14, 10],
|
|
1346
|
-
gap: 14,
|
|
1347
|
-
color: "#1A1A19", // surface: a card
|
|
1348
|
-
border: 1,
|
|
1349
|
-
borderColor: White(0.08),
|
|
1350
|
-
round: 10,
|
|
1351
|
-
motion: "background-color 0.2s, border-color 0.2s",
|
|
1352
|
-
},
|
|
1353
|
-
// WHY: The effects of the classic tiles (a grey icon in a circle that grows) are turned off.
|
|
1597
|
+
box: { color: "#232322", border: 1, borderColor: White(0.12), round: 10, padding: 6 },
|
|
1598
|
+
list: { gap: 2 },
|
|
1599
|
+
row: { height: 56, padding: [12, 10], gap: 12, color: "transparent", round: 8 },
|
|
1600
|
+
// WHY: The effects of the ozden tiles (a grey icon in a circle that grows) are turned off.
|
|
1354
1601
|
tile: {
|
|
1355
1602
|
width: 132,
|
|
1356
1603
|
height: "auto",
|
|
1357
1604
|
padding: [12, 14],
|
|
1358
1605
|
gap: 8,
|
|
1359
1606
|
spacing: 8,
|
|
1360
|
-
listPadding:
|
|
1607
|
+
listPadding: 6, // as box.padding
|
|
1361
1608
|
iconSize: 56,
|
|
1362
1609
|
frameSize: 0,
|
|
1363
1610
|
iconFilter: "",
|
|
@@ -1365,32 +1612,129 @@ ItemList.styles = {
|
|
|
1365
1612
|
selectedIconFilter: "",
|
|
1366
1613
|
selectedFontFamily: "",
|
|
1367
1614
|
selectedColor: "",
|
|
1368
|
-
hover: { color:
|
|
1615
|
+
hover: { color: White(0.07) },
|
|
1369
1616
|
},
|
|
1370
|
-
section: { padding: [
|
|
1371
|
-
hover: { color: "
|
|
1372
|
-
selected: { color: "
|
|
1373
|
-
focus: { ringColor: "
|
|
1374
|
-
icon: { size:
|
|
1375
|
-
title: { fontSize: 15, textColor: White(0.9), fontFamily: "opensans
|
|
1376
|
-
desc: { fontSize: 13, textColor: White(0.
|
|
1377
|
-
check: { visible: 1, size: 20, color: "#65A293", iconColor: "#
|
|
1378
|
-
empty: { fontSize: 14, textColor: White(0.
|
|
1617
|
+
section: { padding: [12, 6], fontSize: 13, textColor: White(0.55) }, // WHY 12: over the icons of the rows
|
|
1618
|
+
hover: { color: White(0.07), lineColor: "" }, // WHY: "": the lines of ozden are not filled in.
|
|
1619
|
+
selected: { color: "rgba(101, 162, 147, 0.2)", opacity: 1, canSelectAgain: 1 }, // WHY 1: as light
|
|
1620
|
+
focus: { ringColor: "rgba(101, 162, 147, 0.55)" },
|
|
1621
|
+
icon: { size: 36, round: 8, color: White(0.07) },
|
|
1622
|
+
title: { fontSize: 15, textColor: White(0.9), fontFamily: "opensans" },
|
|
1623
|
+
desc: { fontSize: 13, textColor: White(0.55), marginTop: 0 },
|
|
1624
|
+
check: { visible: 1, size: 20, color: "#65A293", iconColor: "#0F1F1B", borderColor: White(0.3) },
|
|
1625
|
+
empty: { fontSize: 14, textColor: White(0.55) },
|
|
1626
|
+
// The search field of the dark look: SearchInput dark, round 8 as the rows.
|
|
1627
|
+
// WHY color, border and round: the search box of ozden (the default) is white with border 0 and round 2, and
|
|
1628
|
+
// its keys fill this package.
|
|
1379
1629
|
search: {
|
|
1380
|
-
|
|
1381
|
-
padding: [
|
|
1382
|
-
|
|
1383
|
-
color: "#232322", // surface2: a field
|
|
1384
|
-
textColor: White(0.9),
|
|
1385
|
-
placeholderColor: White(0.35),
|
|
1630
|
+
styleName: "dark", // A package of SearchInput.styles
|
|
1631
|
+
padding: [6, 6, 6, 0], // left, top, right, bottom: as box.padding (the rows have their own 6 under it)
|
|
1632
|
+
color: "#232322",
|
|
1386
1633
|
border: 1,
|
|
1387
|
-
borderColor: White(0.1),
|
|
1388
|
-
borderBottomStyle: "1px solid " + White(0.1),
|
|
1389
1634
|
round: 8,
|
|
1390
|
-
searchIconSize: 18,
|
|
1391
|
-
invertIconColor: 1,
|
|
1392
1635
|
},
|
|
1393
1636
|
scrollBar: { bar_color: "#8A8A88", bar_mouseOverColor: "#BFBFBD", neverHide: 0, showDots: 0 },
|
|
1394
1637
|
},
|
|
1395
1638
|
|
|
1639
|
+
// Pictures (layout "grid"): a big photo in its square with no filter, its title and description under it, a ring
|
|
1640
|
+
// around the selected one. A picture of any shape fills its square (cover).
|
|
1641
|
+
gallery: {
|
|
1642
|
+
box: { color: "transparent", border: 0, padding: 0 },
|
|
1643
|
+
tile: {
|
|
1644
|
+
width: 132, // WHY: two in a row on a phone too
|
|
1645
|
+
height: "auto",
|
|
1646
|
+
padding: [8, 8],
|
|
1647
|
+
gap: 6,
|
|
1648
|
+
spacing: 8,
|
|
1649
|
+
listPadding: 6,
|
|
1650
|
+
iconSize: 116,
|
|
1651
|
+
frameSize: 0,
|
|
1652
|
+
iconFilter: "",
|
|
1653
|
+
iconFit: "cover",
|
|
1654
|
+
iconMotion: "",
|
|
1655
|
+
selectedIconScale: 1,
|
|
1656
|
+
selectedIconFilter: "",
|
|
1657
|
+
selectedFontFamily: "",
|
|
1658
|
+
selectedColor: "",
|
|
1659
|
+
hover: { color: Black(0.05) },
|
|
1660
|
+
},
|
|
1661
|
+
row: { round: 10, border: 1, borderColor: "transparent", motion: "background-color 0.2s, border-color 0.2s" },
|
|
1662
|
+
hover: { color: Black(0.05), lineColor: "" }, // WHY: "": the lines of ozden are not filled in.
|
|
1663
|
+
selected: { color: "rgba(63, 141, 148, 0.1)", borderColor: "#3F8D94", opacity: 1, canSelectAgain: 1 },
|
|
1664
|
+
focus: { ringColor: "rgba(63, 141, 148, 0.8)" },
|
|
1665
|
+
icon: { round: 6, color: Black(0.05) },
|
|
1666
|
+
title: { fontSize: 14, textColor: Black(0.82), fontFamily: "" },
|
|
1667
|
+
desc: { fontSize: 12, textColor: Black(0.5), marginTop: 0 },
|
|
1668
|
+
empty: { fontSize: 14, textColor: Black(0.45) },
|
|
1669
|
+
},
|
|
1670
|
+
|
|
1671
|
+
// The pictures on a dark page.
|
|
1672
|
+
galleryDark: {
|
|
1673
|
+
box: { color: "transparent", border: 0, padding: 0 },
|
|
1674
|
+
tile: {
|
|
1675
|
+
width: 132, // WHY: two in a row on a phone too
|
|
1676
|
+
height: "auto",
|
|
1677
|
+
padding: [8, 8],
|
|
1678
|
+
gap: 6,
|
|
1679
|
+
spacing: 8,
|
|
1680
|
+
listPadding: 6,
|
|
1681
|
+
iconSize: 116,
|
|
1682
|
+
frameSize: 0,
|
|
1683
|
+
iconFilter: "",
|
|
1684
|
+
iconFit: "cover",
|
|
1685
|
+
iconMotion: "",
|
|
1686
|
+
selectedIconScale: 1,
|
|
1687
|
+
selectedIconFilter: "",
|
|
1688
|
+
selectedFontFamily: "",
|
|
1689
|
+
selectedColor: "",
|
|
1690
|
+
hover: { color: White(0.06) },
|
|
1691
|
+
},
|
|
1692
|
+
row: { round: 10, border: 1, borderColor: "transparent", motion: "background-color 0.2s, border-color 0.2s" },
|
|
1693
|
+
hover: { color: White(0.06), lineColor: "" },
|
|
1694
|
+
selected: { color: "rgba(91, 186, 193, 0.14)", borderColor: "#5BBAC1", opacity: 1, canSelectAgain: 1 },
|
|
1695
|
+
focus: { ringColor: "rgba(111, 198, 205, 0.8)" },
|
|
1696
|
+
icon: { round: 6, color: White(0.06) },
|
|
1697
|
+
title: { fontSize: 14, textColor: White(0.88), fontFamily: "" },
|
|
1698
|
+
desc: { fontSize: 12, textColor: White(0.5), marginTop: 0 },
|
|
1699
|
+
empty: { fontSize: 14, textColor: White(0.45) },
|
|
1700
|
+
check: { color: "#E6E6E4", iconColor: "#1A1A19", borderColor: White(0.3) },
|
|
1701
|
+
search: { styleName: "ozdenDark", color: "#262624" },
|
|
1702
|
+
scrollBar: { bar_color: "#CFCFCD", bar_mouseOverColor: "#CFCFCD" },
|
|
1703
|
+
},
|
|
1704
|
+
|
|
1705
|
+
};
|
|
1706
|
+
|
|
1707
|
+
// The minimal theme (_designs/minimal-theme.htm): no fill (the window shows through: its states are lines, so it
|
|
1708
|
+
// reads on any ground), a line around the list; 28 px rows with a 13 px title and a 14 px icon; a line around the
|
|
1709
|
+
// row under the mouse, an ink line, an ink title and a tick on the selected one; 2 px between the rows, so the lines
|
|
1710
|
+
// of two rows never meet. The search box is the head of the list, a line under it. A row with a description needs
|
|
1711
|
+
// more room: style: { row: { height: 44 } }. minimalDark: the same on a dark window.
|
|
1712
|
+
ItemList.createMinimalStyle = function (colors) {
|
|
1713
|
+
return {
|
|
1714
|
+
box: { color: "transparent", border: 1, borderColor: colors.line, round: 4, padding: 4 },
|
|
1715
|
+
list: { gap: 2 },
|
|
1716
|
+
row: { height: 28, padding: [8, 0], gap: 8, color: "transparent", border: 1, borderColor: "transparent", round: 3, lineColor: "" },
|
|
1717
|
+
section: { padding: [8, 6], fontSize: 11, fontFamily: "opensans-bold", textColor: colors.faintText },
|
|
1718
|
+
hover: { color: "transparent", lineColor: "", borderColor: colors.lineHover },
|
|
1719
|
+
selected: { color: "transparent", lineColor: "", borderColor: colors.ink, opacity: 1, canSelectAgain: 0 },
|
|
1720
|
+
disabled: { opacity: 0.4 },
|
|
1721
|
+
focus: { ringColor: colors.focus },
|
|
1722
|
+
icon: { size: 14, round: 0, color: "transparent" },
|
|
1723
|
+
title: { fontSize: 13, textColor: colors.text, selectedTextColor: colors.ink },
|
|
1724
|
+
desc: { fontSize: 12, textColor: colors.softText, marginTop: 0 },
|
|
1725
|
+
check: { visible: 1, size: 14, color: "transparent", iconColor: colors.ink, borderColor: "transparent" },
|
|
1726
|
+
empty: { fontSize: 12, textColor: colors.softText },
|
|
1727
|
+
search: { styleName: colors.searchStyleName, height: 30, padding: [0, 0, 0, 0], color: "transparent", border: 0, round: 0, borderBottomStyle: "1px solid " + colors.line, searchIconLeft: 13 },
|
|
1728
|
+
scrollBar: { bar_color: colors.scrollBar, bar_mouseOverColor: colors.scrollBar, bar_width: 3, bar_mouseOverWidth: 4, showDots: 0 },
|
|
1729
|
+
};
|
|
1730
|
+
};
|
|
1731
|
+
ItemList.MINIMAL_COLORS = {
|
|
1732
|
+
text: Black(0.85), softText: Black(0.55), faintText: Black(0.54), line: Black(0.2), lineHover: Black(0.45),
|
|
1733
|
+
ink: "#1F1F1F", focus: "#3D8BD9", searchStyleName: "minimal", scrollBar: "#373836",
|
|
1734
|
+
};
|
|
1735
|
+
ItemList.styles.minimal = ItemList.createMinimalStyle(ItemList.MINIMAL_COLORS);
|
|
1736
|
+
ItemList.MINIMAL_DARK_COLORS = {
|
|
1737
|
+
text: White(0.88), softText: White(0.55), faintText: White(0.48), line: White(0.18), lineHover: White(0.42),
|
|
1738
|
+
ink: "#EDEDEB", focus: "#7FB6DE", searchStyleName: "minimalDark", scrollBar: "#CFCFCD",
|
|
1396
1739
|
};
|
|
1740
|
+
ItemList.styles.minimalDark = ItemList.createMinimalStyle(ItemList.MINIMAL_DARK_COLORS);
|