create-basicjs 0.1.0 → 0.1.2
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 +1 -1
- package/bin/create-basicjs.js +2 -2
- package/bin/verify-package.js +16 -0
- package/package.json +4 -1
- package/payload/starter/AGENTS.md +84 -0
- package/payload/starter/CLAUDE.md +1 -0
- package/payload/starter/README.md +45 -0
- package/payload/starter/_basic/VERSION +1 -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-cup.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/data-table/palette.svg +2 -0
- package/payload/starter/_basic/assets/data-table/people.js +104 -0
- package/payload/starter/_basic/assets/data-table/trash.svg +2 -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/assets/icons/alert-black.png +0 -0
- package/payload/starter/_basic/assets/icons/alert.png +0 -0
- package/payload/starter/_basic/assets/icons/arrow-drop.svg +3 -0
- package/payload/starter/_basic/assets/icons/arrow-rise.svg +3 -0
- package/payload/starter/_basic/assets/icons/close.svg +1 -0
- package/payload/starter/_basic/assets/icons/lamp-on.png +0 -0
- package/payload/starter/_basic/assets/icons/lamp.png +0 -0
- package/payload/starter/_basic/assets/icons/lock.png +0 -0
- package/payload/starter/_basic/assets/icons/panel.png +0 -0
- package/payload/starter/_basic/assets/icons/plant.png +0 -0
- package/payload/starter/_basic/assets/icons/trash.png +0 -0
- package/payload/starter/_basic/assets/icons/trash.svg +2 -0
- package/payload/starter/_basic/assets/tab-bar/settings.png +0 -0
- package/payload/starter/_basic/assets/tab-bar/status.png +0 -0
- package/payload/starter/_basic/assets/tab-bar/transactions.png +0 -0
- package/payload/starter/_basic/assets/tutorial/blueberries.png +0 -0
- package/payload/starter/_basic/assets/tutorial/carrot.png +0 -0
- package/payload/starter/_basic/assets/tutorial/olives.png +0 -0
- package/payload/starter/_basic/assets/tutorial/strawberry.png +0 -0
- package/payload/starter/_basic/assets/ui-bottom-bar/setting.svg +11 -0
- package/payload/starter/_basic/basic/LICENSE +14 -0
- package/payload/starter/_basic/basic/basic.css +277 -0
- package/payload/starter/_basic/basic/basic.js +3767 -0
- package/payload/starter/_basic/basic/basic.min.css +1 -0
- package/payload/starter/_basic/basic/basic.min.js +65 -0
- package/payload/starter/_basic/basic/font/open-sans/LICENSE.txt +206 -0
- package/payload/starter/_basic/basic/font/open-sans/OpenSans-Bold.ttf +0 -0
- package/payload/starter/_basic/basic/font/open-sans/OpenSans-Regular.ttf +0 -0
- package/payload/starter/_basic/basic/scroll-bar.js +536 -0
- package/payload/starter/_basic/basic/scroll-bar.min.js +2 -0
- package/payload/starter/_basic/comp/action-button/add.png +0 -0
- package/payload/starter/_basic/comp/action-button.js +522 -0
- package/payload/starter/_basic/comp/action-tab-bar.js +383 -0
- package/payload/starter/_basic/comp/app-bar.js +236 -0
- package/payload/starter/_basic/comp/badge-v2.js +246 -0
- package/payload/starter/_basic/comp/bottom-bar.js +547 -0
- package/payload/starter/_basic/comp/breadcrumbs.js +522 -0
- package/payload/starter/_basic/comp/chart-box/chart-4.5.1.umd.min.js +13 -0
- package/payload/starter/_basic/comp/chart-box/chart-js-LICENSE.md +9 -0
- package/payload/starter/_basic/comp/chart-box.js +868 -0
- package/payload/starter/_basic/comp/check-box.js +374 -0
- package/payload/starter/_basic/comp/context-menu.js +634 -0
- package/payload/starter/_basic/comp/currency-input-b.js +190 -0
- package/payload/starter/_basic/comp/data-table/arrow.svg +2 -0
- package/payload/starter/_basic/comp/data-table.js +865 -0
- package/payload/starter/_basic/comp/dialog.js +854 -0
- package/payload/starter/_basic/comp/email-input-b.js +57 -0
- package/payload/starter/_basic/comp/filters.js +493 -0
- package/payload/starter/_basic/comp/form.js +590 -0
- package/payload/starter/_basic/comp/full-screen-select/arrow.svg +2 -0
- package/payload/starter/_basic/comp/full-screen-select/cancel.svg +2 -0
- package/payload/starter/_basic/comp/full-screen-select.js +611 -0
- package/payload/starter/_basic/comp/gauge.js +435 -0
- package/payload/starter/_basic/comp/hold-to-confirm-button/trash-red.png +0 -0
- package/payload/starter/_basic/comp/hold-to-confirm-button/trash.png +0 -0
- package/payload/starter/_basic/comp/hold-to-confirm-button.js +280 -0
- package/payload/starter/_basic/comp/input-b.js +759 -0
- package/payload/starter/_basic/comp/item-list.js +1396 -0
- package/payload/starter/_basic/comp/label-editor.js +1137 -0
- package/payload/starter/_basic/comp/left-menu/_Material Symbols & Icons - Google Fonts.webloc +8 -0
- package/payload/starter/_basic/comp/left-menu/data-table.png +0 -0
- package/payload/starter/_basic/comp/left-menu/home.png +0 -0
- package/payload/starter/_basic/comp/left-menu/reports.png +0 -0
- package/payload/starter/_basic/comp/left-menu/setting.png +0 -0
- package/payload/starter/_basic/comp/left-menu.js +476 -0
- package/payload/starter/_basic/comp/line-progress-bar.js +192 -0
- package/payload/starter/_basic/comp/loading-screen.js +382 -0
- package/payload/starter/_basic/comp/login-page-v2.js +586 -0
- package/payload/starter/_basic/comp/mini-graph-box.js +483 -0
- package/payload/starter/_basic/comp/notice.js +227 -0
- package/payload/starter/_basic/comp/number-input-b.js +121 -0
- package/payload/starter/_basic/comp/numeric-keyboard.js +296 -0
- package/payload/starter/_basic/comp/page-control.js +745 -0
- package/payload/starter/_basic/comp/page-header.js +190 -0
- package/payload/starter/_basic/comp/password-input-b/hide-btn.png +0 -0
- package/payload/starter/_basic/comp/password-input-b/hide-btn2.png +0 -0
- package/payload/starter/_basic/comp/password-input-b/show-btn.png +0 -0
- package/payload/starter/_basic/comp/password-input-b/show-btn2.png +0 -0
- package/payload/starter/_basic/comp/password-input-b.js +164 -0
- package/payload/starter/_basic/comp/period-bar.js +435 -0
- package/payload/starter/_basic/comp/phone-input-b.js +287 -0
- package/payload/starter/_basic/comp/progress-bar.js +676 -0
- package/payload/starter/_basic/comp/property-panel.js +2740 -0
- package/payload/starter/_basic/comp/radio-button.js +467 -0
- package/payload/starter/_basic/comp/rich-text-editor.js +1061 -0
- package/payload/starter/_basic/comp/scrolling-text.js +296 -0
- package/payload/starter/_basic/comp/search-input-v2/clear-round.svg +1 -0
- package/payload/starter/_basic/comp/search-input-v2/clear.svg +1 -0
- package/payload/starter/_basic/comp/search-input-v2/filter.png +0 -0
- package/payload/starter/_basic/comp/search-input-v2/filter.svg +1 -0
- package/payload/starter/_basic/comp/search-input-v2/search.svg +1 -0
- package/payload/starter/_basic/comp/search-input-v2.js +427 -0
- package/payload/starter/_basic/comp/search-results.js +560 -0
- package/payload/starter/_basic/comp/select-box.js +1740 -0
- package/payload/starter/_basic/comp/select-color.js +603 -0
- package/payload/starter/_basic/comp/select-date.js +1003 -0
- package/payload/starter/_basic/comp/select-file.js +732 -0
- package/payload/starter/_basic/comp/select-time.js +979 -0
- package/payload/starter/_basic/comp/settings-row.js +298 -0
- package/payload/starter/_basic/comp/side-panel.js +573 -0
- package/payload/starter/_basic/comp/slider-field.js +776 -0
- package/payload/starter/_basic/comp/slider.js +368 -0
- package/payload/starter/_basic/comp/smart-button/alert-black.png +0 -0
- package/payload/starter/_basic/comp/smart-button/clock.png +0 -0
- package/payload/starter/_basic/comp/smart-button.js +896 -0
- package/payload/starter/_basic/comp/smart-table/clock.png +0 -0
- package/payload/starter/_basic/comp/smart-table/down.png +0 -0
- package/payload/starter/_basic/comp/smart-table/scroll.png +0 -0
- package/payload/starter/_basic/comp/smart-table/sort.png +0 -0
- package/payload/starter/_basic/comp/smart-table/up.png +0 -0
- package/payload/starter/_basic/comp/smart-table.js +1321 -0
- package/payload/starter/_basic/comp/sortable-list.js +1172 -0
- package/payload/starter/_basic/comp/spark-line-box.js +729 -0
- package/payload/starter/_basic/comp/stepper.js +699 -0
- package/payload/starter/_basic/comp/tabs.js +1317 -0
- package/payload/starter/_basic/comp/tag-input.js +1067 -0
- package/payload/starter/_basic/comp/tap-effect.js +168 -0
- package/payload/starter/_basic/comp/textarea-b.js +184 -0
- package/payload/starter/_basic/comp/time-line.js +324 -0
- package/payload/starter/_basic/comp/tiny-select/arrow.svg +1 -0
- package/payload/starter/_basic/comp/tiny-select.js +282 -0
- package/payload/starter/_basic/comp/tiny-table.js +279 -0
- package/payload/starter/_basic/comp/toast.js +838 -0
- package/payload/starter/_basic/comp/toggle.js +636 -0
- package/payload/starter/_basic/comp/tooltip.js +471 -0
- package/payload/starter/_basic/comp/tree-view.js +1096 -0
- package/payload/starter/_basic/comp/ui-effects.js +1091 -0
- package/payload/starter/_basic/comp/ui-standards.js +402 -0
- package/payload/starter/_basic/comp/url-input-b.js +145 -0
- package/payload/starter/_basic/comp/web-view.js +534 -0
- package/payload/starter/_basic/docs/basic-js-animated-rules.md +90 -0
- package/payload/starter/_basic/docs/basic-js-code-rules.md +91 -0
- package/payload/starter/_basic/docs/basic-js-components.md +134 -0
- package/payload/starter/_basic/docs/basic-js-core.md +131 -0
- package/payload/starter/_basic/docs/component-index.md +522 -0
- package/payload/starter/_basic/docs/component-template.js +416 -0
- package/payload/starter/_basic/docs/handbook/00-introduction.md +125 -0
- package/payload/starter/_basic/docs/handbook/00-what-is-new.md +96 -0
- package/payload/starter/_basic/docs/handbook/01-label.md +104 -0
- package/payload/starter/_basic/docs/handbook/02-box.md +166 -0
- package/payload/starter/_basic/docs/handbook/03-image.md +81 -0
- package/payload/starter/_basic/docs/handbook/04-common-properties.md +159 -0
- package/payload/starter/_basic/docs/handbook/05-autolayout.md +332 -0
- package/payload/starter/_basic/docs/handbook/06-button.md +103 -0
- package/payload/starter/_basic/docs/handbook/07-input.md +78 -0
- package/payload/starter/_basic/docs/handbook/08-page.md +120 -0
- package/payload/starter/_basic/docs/handbook/09-useful-examples.md +309 -0
- package/payload/starter/_basic/docs/handbook/10-motion.md +132 -0
- package/payload/starter/_basic/docs/handbook/11-other-functions.md +92 -0
- package/payload/starter/_basic/docs/handbook/12-utilities.md +123 -0
- package/payload/starter/_basic/docs/handbook/13-sound.md +88 -0
- package/payload/starter/_basic/docs/what-is-new.md +402 -0
- package/payload/starter/_basic/examples/action-button.htm +81 -0
- package/payload/starter/_basic/examples/action-tab-bar.htm +97 -0
- package/payload/starter/_basic/examples/app-bar.htm +140 -0
- package/payload/starter/_basic/examples/badgeV2.htm +68 -0
- package/payload/starter/_basic/examples/bottom-bar/grid.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/grids.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/home.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/homes.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/icon1.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/icon1s.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/icon2.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/icon2s.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/icon3.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/icon3s.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/icon4.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/icon4s.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/search.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/searchs.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/settings.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/settingss.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/tasks.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/taskss.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar-2.htm +187 -0
- package/payload/starter/_basic/examples/bottom-bar.htm +46 -0
- package/payload/starter/_basic/examples/breadcrumbs.htm +284 -0
- package/payload/starter/_basic/examples/chart-box.htm +287 -0
- package/payload/starter/_basic/examples/check-box-1.htm +220 -0
- package/payload/starter/_basic/examples/check-box-2.htm +212 -0
- package/payload/starter/_basic/examples/check-box-3.htm +179 -0
- package/payload/starter/_basic/examples/context-menu.htm +269 -0
- package/payload/starter/_basic/examples/currency-input-b.htm +71 -0
- package/payload/starter/_basic/examples/data-table-2.htm +67 -0
- package/payload/starter/_basic/examples/data-table-3.htm +72 -0
- package/payload/starter/_basic/examples/data-table-4.htm +144 -0
- package/payload/starter/_basic/examples/data-table-5.htm +152 -0
- package/payload/starter/_basic/examples/data-table.htm +178 -0
- package/payload/starter/_basic/examples/dialog-centered.htm +130 -0
- package/payload/starter/_basic/examples/dialog.htm +209 -0
- package/payload/starter/_basic/examples/email-input-b.htm +67 -0
- package/payload/starter/_basic/examples/filters.htm +115 -0
- package/payload/starter/_basic/examples/form-1.htm +123 -0
- package/payload/starter/_basic/examples/full-screen-select.htm +114 -0
- package/payload/starter/_basic/examples/gauge.htm +133 -0
- package/payload/starter/_basic/examples/hold-to-confirm-button.htm +144 -0
- package/payload/starter/_basic/examples/input-b-ex1.htm +132 -0
- package/payload/starter/_basic/examples/input-b-ex2.htm +136 -0
- package/payload/starter/_basic/examples/input-b-ex3-style.htm +113 -0
- package/payload/starter/_basic/examples/input-b-ex4-custom-unit.htm +112 -0
- package/payload/starter/_basic/examples/input-b-ex5-warning-icon.htm +80 -0
- package/payload/starter/_basic/examples/input-b-ex6-dark.htm +108 -0
- package/payload/starter/_basic/examples/input-b-ex7-ozden.htm +153 -0
- package/payload/starter/_basic/examples/item-list-2.htm +253 -0
- package/payload/starter/_basic/examples/item-list.htm +176 -0
- package/payload/starter/_basic/examples/label-editor.htm +196 -0
- package/payload/starter/_basic/examples/left-menu.htm +81 -0
- package/payload/starter/_basic/examples/line-progress-bar.htm +145 -0
- package/payload/starter/_basic/examples/loading-screen.htm +217 -0
- package/payload/starter/_basic/examples/login-page-dark-v2.htm +269 -0
- package/payload/starter/_basic/examples/login-page-v2.htm +269 -0
- package/payload/starter/_basic/examples/mini-graph-box.htm +229 -0
- package/payload/starter/_basic/examples/notice.htm +79 -0
- package/payload/starter/_basic/examples/number-input-b.htm +68 -0
- package/payload/starter/_basic/examples/numeric-keyboard.htm +100 -0
- package/payload/starter/_basic/examples/page-control.htm +262 -0
- package/payload/starter/_basic/examples/page-header.htm +117 -0
- package/payload/starter/_basic/examples/password-input-b.htm +70 -0
- package/payload/starter/_basic/examples/period-bar.htm +94 -0
- package/payload/starter/_basic/examples/phone-input-b-select-country.htm +298 -0
- package/payload/starter/_basic/examples/phone-input-b.htm +72 -0
- package/payload/starter/_basic/examples/progress-bar-ozden.htm +168 -0
- package/payload/starter/_basic/examples/progress-bar.htm +296 -0
- package/payload/starter/_basic/examples/property-panel.htm +216 -0
- package/payload/starter/_basic/examples/radio-button-1.htm +264 -0
- package/payload/starter/_basic/examples/radio-button-2.htm +256 -0
- package/payload/starter/_basic/examples/radio-button-3.htm +168 -0
- package/payload/starter/_basic/examples/rich-text-editor.htm +228 -0
- package/payload/starter/_basic/examples/scrolling-text.htm +75 -0
- package/payload/starter/_basic/examples/search-input-v2-ozden.htm +128 -0
- package/payload/starter/_basic/examples/search-input-v2-place.htm +80 -0
- package/payload/starter/_basic/examples/search-input-v2.htm +65 -0
- package/payload/starter/_basic/examples/search-results.htm +193 -0
- package/payload/starter/_basic/examples/select-box-ozden-item.htm +114 -0
- package/payload/starter/_basic/examples/select-box-ozden-text.htm +64 -0
- package/payload/starter/_basic/examples/select-box.htm +254 -0
- package/payload/starter/_basic/examples/select-color.htm +215 -0
- package/payload/starter/_basic/examples/select-date.htm +244 -0
- package/payload/starter/_basic/examples/select-file.htm +268 -0
- package/payload/starter/_basic/examples/select-time.htm +249 -0
- package/payload/starter/_basic/examples/settings-row.htm +193 -0
- package/payload/starter/_basic/examples/side-panel-2.htm +270 -0
- package/payload/starter/_basic/examples/side-panel.htm +219 -0
- package/payload/starter/_basic/examples/slider-field.htm +223 -0
- package/payload/starter/_basic/examples/slider.htm +180 -0
- package/payload/starter/_basic/examples/smart-button-2.htm +220 -0
- package/payload/starter/_basic/examples/smart-button-3-ozden.htm +320 -0
- package/payload/starter/_basic/examples/smart-button-4-dark.htm +102 -0
- package/payload/starter/_basic/examples/smart-button-5-features.htm +205 -0
- package/payload/starter/_basic/examples/smart-button.htm +252 -0
- package/payload/starter/_basic/examples/smart-table-1.htm +142 -0
- package/payload/starter/_basic/examples/smart-table-2.htm +191 -0
- package/payload/starter/_basic/examples/smart-table-3.htm +359 -0
- package/payload/starter/_basic/examples/smart-table-4.htm +158 -0
- package/payload/starter/_basic/examples/sortable-list.htm +250 -0
- package/payload/starter/_basic/examples/spark-line-box.htm +285 -0
- package/payload/starter/_basic/examples/stepper-2.htm +172 -0
- package/payload/starter/_basic/examples/stepper.htm +255 -0
- package/payload/starter/_basic/examples/tabs-2/coffee.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i1-white.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i1.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i2-white.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i2.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i3-white.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i3.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i4-white.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i4.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i5-white.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i5.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/lamp-on.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/lamp.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/search.svg +2 -0
- package/payload/starter/_basic/examples/tabs-2.htm +188 -0
- package/payload/starter/_basic/examples/tabs.htm +300 -0
- package/payload/starter/_basic/examples/tag-input.htm +242 -0
- package/payload/starter/_basic/examples/tap-effect.htm +100 -0
- package/payload/starter/_basic/examples/textarea-b.htm +76 -0
- package/payload/starter/_basic/examples/time-line.htm +226 -0
- package/payload/starter/_basic/examples/tiny-select.htm +86 -0
- package/payload/starter/_basic/examples/tiny-table.htm +109 -0
- package/payload/starter/_basic/examples/toast.htm +262 -0
- package/payload/starter/_basic/examples/toggle-2.htm +163 -0
- package/payload/starter/_basic/examples/toggle-3.htm +218 -0
- package/payload/starter/_basic/examples/toggle.htm +93 -0
- package/payload/starter/_basic/examples/tooltip-2.htm +177 -0
- package/payload/starter/_basic/examples/tooltip-3.htm +212 -0
- package/payload/starter/_basic/examples/tooltip.htm +124 -0
- package/payload/starter/_basic/examples/tree-view.htm +285 -0
- package/payload/starter/_basic/examples/ui-effects.htm +463 -0
- package/payload/starter/_basic/examples/ui-standards.htm +261 -0
- package/payload/starter/_basic/examples/unfinished-login-page-dark-supabase.htm +221 -0
- package/payload/starter/_basic/examples/unfinished-login-page-supabase.htm +221 -0
- package/payload/starter/_basic/examples/url-input-b.htm +85 -0
- package/payload/starter/_basic/examples/web-view.htm +241 -0
- package/payload/starter/_basic/min/action-button.min.js +2 -0
- package/payload/starter/_basic/min/action-tab-bar.min.js +2 -0
- package/payload/starter/_basic/min/app-bar.min.js +2 -0
- package/payload/starter/_basic/min/badge-v2.min.js +2 -0
- package/payload/starter/_basic/min/bottom-bar.min.js +2 -0
- package/payload/starter/_basic/min/breadcrumbs.min.js +2 -0
- package/payload/starter/_basic/min/chart-box.min.js +2 -0
- package/payload/starter/_basic/min/check-box.min.js +2 -0
- package/payload/starter/_basic/min/context-menu.min.js +2 -0
- package/payload/starter/_basic/min/currency-input-b.min.js +2 -0
- package/payload/starter/_basic/min/data-table.min.js +2 -0
- package/payload/starter/_basic/min/dialog.min.js +2 -0
- package/payload/starter/_basic/min/email-input-b.min.js +2 -0
- package/payload/starter/_basic/min/filters.min.js +2 -0
- package/payload/starter/_basic/min/form.min.js +2 -0
- package/payload/starter/_basic/min/full-screen-select.min.js +2 -0
- package/payload/starter/_basic/min/gauge.min.js +2 -0
- package/payload/starter/_basic/min/hold-to-confirm-button.min.js +2 -0
- package/payload/starter/_basic/min/input-b.min.js +2 -0
- package/payload/starter/_basic/min/item-list.min.js +2 -0
- package/payload/starter/_basic/min/label-editor.min.js +2 -0
- package/payload/starter/_basic/min/left-menu.min.js +2 -0
- package/payload/starter/_basic/min/line-progress-bar.min.js +2 -0
- package/payload/starter/_basic/min/loading-screen.min.js +2 -0
- package/payload/starter/_basic/min/login-page-v2.min.js +2 -0
- package/payload/starter/_basic/min/mini-graph-box.min.js +2 -0
- package/payload/starter/_basic/min/notice.min.js +2 -0
- package/payload/starter/_basic/min/number-input-b.min.js +2 -0
- package/payload/starter/_basic/min/numeric-keyboard.min.js +2 -0
- package/payload/starter/_basic/min/page-control.min.js +2 -0
- package/payload/starter/_basic/min/page-header.min.js +2 -0
- package/payload/starter/_basic/min/password-input-b.min.js +2 -0
- package/payload/starter/_basic/min/period-bar.min.js +2 -0
- package/payload/starter/_basic/min/phone-input-b.min.js +2 -0
- package/payload/starter/_basic/min/progress-bar.min.js +2 -0
- package/payload/starter/_basic/min/property-panel.min.js +2 -0
- package/payload/starter/_basic/min/radio-button.min.js +2 -0
- package/payload/starter/_basic/min/rich-text-editor.min.js +2 -0
- package/payload/starter/_basic/min/scrolling-text.min.js +2 -0
- package/payload/starter/_basic/min/search-input-v2.min.js +2 -0
- package/payload/starter/_basic/min/search-results.min.js +2 -0
- package/payload/starter/_basic/min/select-box.min.js +2 -0
- package/payload/starter/_basic/min/select-color.min.js +2 -0
- package/payload/starter/_basic/min/select-date.min.js +2 -0
- package/payload/starter/_basic/min/select-file.min.js +2 -0
- package/payload/starter/_basic/min/select-time.min.js +2 -0
- package/payload/starter/_basic/min/settings-row.min.js +2 -0
- package/payload/starter/_basic/min/side-panel.min.js +2 -0
- package/payload/starter/_basic/min/slider-field.min.js +2 -0
- package/payload/starter/_basic/min/slider.min.js +2 -0
- package/payload/starter/_basic/min/smart-button.min.js +2 -0
- package/payload/starter/_basic/min/smart-table.min.js +2 -0
- package/payload/starter/_basic/min/sortable-list.min.js +2 -0
- package/payload/starter/_basic/min/spark-line-box.min.js +2 -0
- package/payload/starter/_basic/min/stepper.min.js +2 -0
- package/payload/starter/_basic/min/tabs.min.js +2 -0
- package/payload/starter/_basic/min/tag-input.min.js +2 -0
- package/payload/starter/_basic/min/tap-effect.min.js +2 -0
- package/payload/starter/_basic/min/textarea-b.min.js +2 -0
- package/payload/starter/_basic/min/time-line.min.js +2 -0
- package/payload/starter/_basic/min/tiny-select.min.js +2 -0
- package/payload/starter/_basic/min/tiny-table.min.js +2 -0
- package/payload/starter/_basic/min/toast.min.js +2 -0
- package/payload/starter/_basic/min/toggle.min.js +2 -0
- package/payload/starter/_basic/min/tooltip.min.js +2 -0
- package/payload/starter/_basic/min/tree-view.min.js +2 -0
- package/payload/starter/_basic/min/ui-effects.min.js +2 -0
- package/payload/starter/_basic/min/ui-standards.min.js +2 -0
- package/payload/starter/_basic/min/url-input-b.min.js +2 -0
- package/payload/starter/_basic/min/web-view.min.js +2 -0
- package/payload/starter/_basic/tools/build.js +175 -0
- package/payload/starter/_basic/tools/check.js +336 -0
- package/payload/starter/app/app.js +27 -0
- package/payload/starter/assets/.gitkeep +0 -0
- package/payload/starter/gitignore +3 -0
- package/payload/starter/index.htm +23 -0
- package/payload/templates/booking/TEMPLATE.md +77 -0
- package/payload/templates/booking/app/app.js +722 -0
- package/payload/templates/booking/app/settings.js +52 -0
- package/payload/templates/booking/app/store.js +265 -0
- package/payload/templates/booking/app/texts.js +148 -0
- package/payload/templates/booking/assets/app-icon.svg +1 -0
- package/payload/templates/booking/assets/tabs/account.svg +1 -0
- package/payload/templates/booking/assets/tabs/appointments.svg +1 -0
- package/payload/templates/booking/assets/tabs/home.svg +1 -0
- package/payload/templates/booking/assets/tabs/services.svg +1 -0
- package/payload/templates/booking/components/booking-ui.js +252 -0
- package/payload/templates/booking/index.htm +53 -0
- package/payload/templates/booking/pages/account.js +124 -0
- package/payload/templates/booking/pages/appointments.js +141 -0
- package/payload/templates/booking/pages/book.js +231 -0
- package/payload/templates/booking/pages/home.js +99 -0
- package/payload/templates/booking/pages/services.js +79 -0
- package/payload/templates/classic/TEMPLATE.md +104 -0
- package/payload/templates/classic/app/app.js +779 -0
- package/payload/templates/classic/app/settings.js +77 -0
- package/payload/templates/classic/assets/_attribute.txt +37 -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-cup.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/assets/example-tabs/coffee.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i1-white.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i1.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i2-white.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i2.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i3-white.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i3.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i4-white.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i4.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i5-white.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i5.png +0 -0
- package/payload/templates/classic/assets/example-tabs/lamp-on.png +0 -0
- package/payload/templates/classic/assets/example-tabs/lamp.png +0 -0
- package/payload/templates/classic/assets/example-tabs/search.svg +2 -0
- package/payload/templates/classic/assets/files/ai.png +0 -0
- package/payload/templates/classic/assets/files/doc.png +0 -0
- package/payload/templates/classic/assets/files/folder.png +0 -0
- package/payload/templates/classic/assets/files/js.png +0 -0
- package/payload/templates/classic/assets/files/pdf.png +0 -0
- package/payload/templates/classic/assets/files/txt.png +0 -0
- package/payload/templates/classic/assets/files/xls.png +0 -0
- package/payload/templates/classic/assets/icons/arrow-drop.svg +3 -0
- package/payload/templates/classic/assets/icons/arrow-rise.svg +3 -0
- package/payload/templates/classic/assets/icons/download.svg +18 -0
- package/payload/templates/classic/assets/icons/lamp-on.png +0 -0
- package/payload/templates/classic/assets/icons/lamp.png +0 -0
- package/payload/templates/classic/assets/icons/lock-small.png +0 -0
- package/payload/templates/classic/assets/icons/lock.png +0 -0
- package/payload/templates/classic/assets/icons/logo.png +0 -0
- package/payload/templates/classic/assets/icons/trash-red.svg +2 -0
- package/payload/templates/classic/assets/icons/trash.svg +2 -0
- package/payload/templates/classic/assets/menu/t1.png +0 -0
- package/payload/templates/classic/assets/menu/t10.png +0 -0
- package/payload/templates/classic/assets/menu/t11.png +0 -0
- package/payload/templates/classic/assets/menu/t2.png +0 -0
- package/payload/templates/classic/assets/menu/t3.png +0 -0
- package/payload/templates/classic/assets/menu/t4.png +0 -0
- package/payload/templates/classic/assets/menu/t5.png +0 -0
- package/payload/templates/classic/assets/menu/t6.png +0 -0
- package/payload/templates/classic/assets/menu/t7.png +0 -0
- package/payload/templates/classic/assets/menu/t8.png +0 -0
- package/payload/templates/classic/assets/menu/t9.png +0 -0
- package/payload/templates/classic/assets/products/brokoli.png +0 -0
- package/payload/templates/classic/assets/products/cilek.png +0 -0
- package/payload/templates/classic/assets/products/domates.png +0 -0
- package/payload/templates/classic/assets/products/elma.png +0 -0
- package/payload/templates/classic/assets/products/havuc.png +0 -0
- package/payload/templates/classic/assets/products/karpuz.png +0 -0
- package/payload/templates/classic/assets/products/limon.png +0 -0
- package/payload/templates/classic/assets/products/muz.png +0 -0
- package/payload/templates/classic/assets/products/nar.png +0 -0
- package/payload/templates/classic/assets/products/patlican.png +0 -0
- package/payload/templates/classic/assets/products/yabanmersini.png +0 -0
- package/payload/templates/classic/assets/products/yesilbiber.png +0 -0
- package/payload/templates/classic/assets/tab-bar/settings.png +0 -0
- package/payload/templates/classic/assets/tab-bar/status.png +0 -0
- package/payload/templates/classic/assets/tab-bar/transactions.png +0 -0
- package/payload/templates/classic/assets/tabs/grid.png +0 -0
- package/payload/templates/classic/assets/tabs/grids.png +0 -0
- package/payload/templates/classic/assets/tabs/home.png +0 -0
- package/payload/templates/classic/assets/tabs/homes.png +0 -0
- package/payload/templates/classic/assets/tabs/search.png +0 -0
- package/payload/templates/classic/assets/tabs/searchs.png +0 -0
- package/payload/templates/classic/assets/tabs/settings.png +0 -0
- package/payload/templates/classic/assets/tabs/settingss.png +0 -0
- package/payload/templates/classic/assets/tabs/tasks.png +0 -0
- package/payload/templates/classic/assets/tabs/taskss.png +0 -0
- package/payload/templates/classic/html/privacy.htm +58 -0
- package/payload/templates/classic/index.htm +70 -0
- package/payload/templates/classic/pages/dialogs.js +205 -0
- package/payload/templates/classic/pages/example.js +296 -0
- package/payload/templates/classic/pages/examples.js +148 -0
- package/payload/templates/classic/pages/home.js +268 -0
- package/payload/templates/classic/pages/info-pages.js +95 -0
- package/payload/templates/classic/pages/lock.js +70 -0
- package/payload/templates/classic/pages/search.js +153 -0
- package/payload/templates/classic/pages/settings.js +184 -0
- package/payload/templates/classic/pages/tasks.js +221 -0
- package/payload/templates/classic/pages/template-pages.js +240 -0
- package/payload/templates/coffee-shop/TEMPLATE.md +63 -0
- package/payload/templates/coffee-shop/app/app.js +713 -0
- package/payload/templates/coffee-shop/app/settings.js +20 -0
- package/payload/templates/coffee-shop/app/store.js +52 -0
- package/payload/templates/coffee-shop/assets/cappuccino.png +0 -0
- package/payload/templates/coffee-shop/assets/chocolate-milk.png +0 -0
- package/payload/templates/coffee-shop/assets/coffee-art/cocoa.svg +1 -0
- package/payload/templates/coffee-shop/assets/coffee-art/filter.svg +1 -0
- package/payload/templates/coffee-shop/assets/coffee-art/frappe.svg +1 -0
- package/payload/templates/coffee-shop/assets/coffee-art/iced.svg +1 -0
- package/payload/templates/coffee-shop/assets/coffee-art/latte.svg +1 -0
- package/payload/templates/coffee-shop/assets/coffee-art/tea.svg +1 -0
- package/payload/templates/coffee-shop/assets/coffee.png +0 -0
- package/payload/templates/coffee-shop/assets/credits.txt +41 -0
- package/payload/templates/coffee-shop/assets/fonts/OFL.txt +93 -0
- package/payload/templates/coffee-shop/assets/fonts/gelasio-OFL.txt +93 -0
- package/payload/templates/coffee-shop/assets/fonts/gelasio.ttf +0 -0
- package/payload/templates/coffee-shop/assets/frappe.png +0 -0
- package/payload/templates/coffee-shop/assets/iced-caffee.png +0 -0
- package/payload/templates/coffee-shop/assets/tabs/cart.svg +1 -0
- package/payload/templates/coffee-shop/assets/tabs/home.svg +1 -0
- package/payload/templates/coffee-shop/assets/tabs/menu.svg +1 -0
- package/payload/templates/coffee-shop/assets/tabs/rewards.svg +1 -0
- package/payload/templates/coffee-shop/assets/tea.png +0 -0
- package/payload/templates/coffee-shop/components/coffee-ui.js +246 -0
- package/payload/templates/coffee-shop/index.htm +55 -0
- package/payload/templates/coffee-shop/pages/cart.js +82 -0
- package/payload/templates/coffee-shop/pages/drink.js +74 -0
- package/payload/templates/coffee-shop/pages/home.js +54 -0
- package/payload/templates/coffee-shop/pages/menu.js +53 -0
- package/payload/templates/coffee-shop/pages/rewards.js +38 -0
- package/payload/templates/forms/TEMPLATE.md +12 -0
- package/payload/templates/forms/app/app.js +30 -0
- package/payload/templates/forms/appointment-form.htm +969 -0
- package/payload/templates/forms/assets/error.png +0 -0
- package/payload/templates/forms/assets/logo.png +0 -0
- package/payload/templates/forms/assets/logo2.png +0 -0
- package/payload/templates/forms/assets/mail.png +0 -0
- package/payload/templates/forms/assets/success.png +0 -0
- package/payload/templates/forms/contact-form-iframe.htm +24 -0
- package/payload/templates/forms/contact-form-table.sql +11 -0
- package/payload/templates/forms/contact-form-to-mail.htm +358 -0
- package/payload/templates/forms/contact-form-to-supabase.htm +396 -0
- package/payload/templates/forms/dark-contact-form.htm +623 -0
- package/payload/templates/forms/event-registration-form.htm +1056 -0
- package/payload/templates/forms/feedback-form.htm +813 -0
- package/payload/templates/forms/order-form.htm +1187 -0
- package/payload/templates/forms/recruitment-form.htm +698 -0
- package/payload/templates/forms/service/PHPMailer/Exception.php +40 -0
- package/payload/templates/forms/service/PHPMailer/LICENSE +502 -0
- package/payload/templates/forms/service/PHPMailer/PHPMailer.php +5586 -0
- package/payload/templates/forms/service/PHPMailer/SMTP.php +1617 -0
- package/payload/templates/forms/service/readme.md +162 -0
- package/payload/templates/forms/service/send-form-mail.php +941 -0
- package/payload/templates/forms/support-ticket-form.htm +908 -0
- package/payload/templates/panel/TEMPLATE.md +16 -0
- package/payload/templates/panel/assets/_Material Symbols & Icons - Google Fonts.webloc +8 -0
- package/payload/templates/panel/assets/arrow_down.png +0 -0
- package/payload/templates/panel/assets/close.png +0 -0
- package/payload/templates/panel/assets/left-menu/bolt.png +0 -0
- package/payload/templates/panel/assets/left-menu/brick.png +0 -0
- package/payload/templates/panel/assets/left-menu/code.png +0 -0
- package/payload/templates/panel/assets/left-menu/dashboard.png +0 -0
- package/payload/templates/panel/assets/left-menu/data-table.png +0 -0
- package/payload/templates/panel/assets/left-menu/extension.png +0 -0
- package/payload/templates/panel/assets/left-menu/home.png +0 -0
- package/payload/templates/panel/assets/left-menu/reports.png +0 -0
- package/payload/templates/panel/assets/left-menu/setting.png +0 -0
- package/payload/templates/panel/assets/left-menu/url.png +0 -0
- package/payload/templates/panel/assets/light.png +0 -0
- package/payload/templates/panel/assets/maybe.png +0 -0
- package/payload/templates/panel/assets/panel-icon.png +0 -0
- package/payload/templates/panel/assets/top-bar/add.png +0 -0
- package/payload/templates/panel/assets/top-bar/add.svg +1 -0
- package/payload/templates/panel/assets/top-bar/apps.png +0 -0
- package/payload/templates/panel/assets/top-bar/apps.svg +1 -0
- package/payload/templates/panel/assets/top-bar/arrow-down.svg +1 -0
- package/payload/templates/panel/assets/top-bar/bell.svg +1 -0
- package/payload/templates/panel/assets/top-bar/bookmark.png +0 -0
- package/payload/templates/panel/assets/top-bar/bookmark.svg +1 -0
- package/payload/templates/panel/assets/top-bar/cancel.png +0 -0
- package/payload/templates/panel/assets/top-bar/close.svg +1 -0
- package/payload/templates/panel/assets/top-bar/comment.png +0 -0
- package/payload/templates/panel/assets/top-bar/filter.png +0 -0
- package/payload/templates/panel/assets/top-bar/keyboard.svg +1 -0
- package/payload/templates/panel/assets/top-bar/notification.png +0 -0
- package/payload/templates/panel/assets/top-bar/search.png +0 -0
- package/payload/templates/panel/assets/top-bar/search.svg +1 -0
- package/payload/templates/panel/assets/top-bar/user.png +0 -0
- package/payload/templates/panel/assets/top-bar/user.svg +1 -0
- package/payload/templates/panel/assets/warning.png +0 -0
- package/payload/templates/panel/common/bridge.js +1 -0
- package/payload/templates/panel/common/bridge.min.js +0 -0
- package/payload/templates/panel/common/components.js +12 -0
- package/payload/templates/panel/common/full-view.js +107 -0
- package/payload/templates/panel/common/full-view.min.js +1 -0
- package/payload/templates/panel/common/main-view.js +53 -0
- package/payload/templates/panel/common/main-view.min.js +1 -0
- package/payload/templates/panel/common/module-page.js +46 -0
- package/payload/templates/panel/common/module-page.min.js +1 -0
- package/payload/templates/panel/common/right-view.js +77 -0
- package/payload/templates/panel/common/right-view.min.js +1 -0
- package/payload/templates/panel/common/start-page.js +31 -0
- package/payload/templates/panel/common/start-page.min.js +1 -0
- package/payload/templates/panel/common/theme.js +491 -0
- package/payload/templates/panel/common/top-bar-v25-07-29-1.js +330 -0
- package/payload/templates/panel/common/top-bar-v25-07-29-2.js +265 -0
- package/payload/templates/panel/common/top-bar.js +855 -0
- package/payload/templates/panel/common/top-bar.min.js +1 -0
- package/payload/templates/panel/common/ui-standards.css +77 -0
- package/payload/templates/panel/common/ui-standards.js +133 -0
- package/payload/templates/panel/common/ui-standards.min.css +1 -0
- package/payload/templates/panel/common/ui-standards.min.js +1 -0
- package/payload/templates/panel/index.htm +642 -0
- package/payload/templates/panel/managers/database.js +1 -0
- package/payload/templates/panel/managers/database.min.js +1 -0
- package/payload/templates/panel/managers/login.js +2 -0
- package/payload/templates/panel/managers/login.min.js +1 -0
- package/payload/templates/panel/module1/empty-main.htm +27 -0
- package/payload/templates/panel/module10/greenhouse.htm +1362 -0
- package/payload/templates/panel/module11/arduino-projects.htm +1125 -0
- package/payload/templates/panel/module2/empty-full.htm +27 -0
- package/payload/templates/panel/module3/empty-right.htm +27 -0
- package/payload/templates/panel/module4/empty-main-topbar.htm +27 -0
- package/payload/templates/panel/module5/empty-right-topbar.htm +27 -0
- package/payload/templates/panel/module6/energy-hub.htm +1508 -0
- package/payload/templates/panel/module7/3d-printers.htm +1259 -0
- package/payload/templates/panel/module8/cold-rooms.htm +1251 -0
- package/payload/templates/panel/module9/elevator-fleet.htm +1489 -0
- package/payload/templates/panel/pages/_page-template.js +36 -0
- package/payload/templates/panel/pages/_page-template.min.js +1 -0
- package/payload/templates/panel/pages/activity.js +1072 -0
- package/payload/templates/panel/pages/contents.js +1555 -0
- package/payload/templates/panel/pages/contents.min.js +1 -0
- package/payload/templates/panel/pages/customers.js +1171 -0
- package/payload/templates/panel/pages/edit-user.js +381 -0
- package/payload/templates/panel/pages/edit-user.min.js +1 -0
- package/payload/templates/panel/pages/edit-users-table.min.js +1 -0
- package/payload/templates/panel/pages/home.js +637 -0
- package/payload/templates/panel/pages/home.min.js +1 -0
- package/payload/templates/panel/pages/media.js +1538 -0
- package/payload/templates/panel/pages/notifications.js +542 -0
- package/payload/templates/panel/pages/notifications.min.js +1 -0
- package/payload/templates/panel/pages/orders.js +1147 -0
- package/payload/templates/panel/pages/products.js +1281 -0
- package/payload/templates/panel/pages/reports.js +1138 -0
- package/payload/templates/panel/pages/reports.min.js +1 -0
- package/payload/templates/panel/pages/roles.js +1096 -0
- package/payload/templates/panel/pages/settings.js +1462 -0
- package/payload/templates/panel/pages/settings.min.js +1 -0
- package/payload/templates/panel/pages/user-actions.js +456 -0
- package/payload/templates/panel/pages/user-actions.min.js +2 -0
- package/payload/templates/panel/pages/user-list.js +1113 -0
- package/payload/templates/panel/pages/users.js +334 -0
- package/payload/templates/panel/pages/users.min.js +1 -0
- package/payload/templates/shop/TEMPLATE.md +69 -0
- package/payload/templates/shop/app/app.js +727 -0
- package/payload/templates/shop/app/art.js +89 -0
- package/payload/templates/shop/app/settings.js +45 -0
- package/payload/templates/shop/app/store.js +239 -0
- package/payload/templates/shop/app/texts.js +232 -0
- package/payload/templates/shop/assets/app-icon.svg +1 -0
- package/payload/templates/shop/assets/tabs/account.svg +1 -0
- package/payload/templates/shop/assets/tabs/cart.svg +1 -0
- package/payload/templates/shop/assets/tabs/home.svg +1 -0
- package/payload/templates/shop/assets/tabs/shop.svg +1 -0
- package/payload/templates/shop/components/shop-ui.js +343 -0
- package/payload/templates/shop/index.htm +57 -0
- package/payload/templates/shop/pages/account.js +190 -0
- package/payload/templates/shop/pages/cart.js +116 -0
- package/payload/templates/shop/pages/checkout.js +134 -0
- package/payload/templates/shop/pages/favorites.js +37 -0
- package/payload/templates/shop/pages/home.js +86 -0
- package/payload/templates/shop/pages/orders.js +132 -0
- package/payload/templates/shop/pages/product.js +168 -0
- package/payload/templates/shop/pages/shop.js +113 -0
- package/payload/templates/starter/TEMPLATE.md +107 -0
- package/payload/templates/starter/app/app.js +660 -0
- package/payload/templates/starter/app/settings.js +57 -0
- package/payload/templates/starter/assets/app-icon.svg +5 -0
- package/payload/templates/starter/assets/products/brokoli.png +0 -0
- package/payload/templates/starter/assets/products/cilek.png +0 -0
- package/payload/templates/starter/assets/products/domates.png +0 -0
- package/payload/templates/starter/assets/products/elma.png +0 -0
- package/payload/templates/starter/assets/products/havuc.png +0 -0
- package/payload/templates/starter/assets/products/karpuz.png +0 -0
- package/payload/templates/starter/assets/products/limon.png +0 -0
- package/payload/templates/starter/assets/products/muz.png +0 -0
- package/payload/templates/starter/assets/products/nar.png +0 -0
- package/payload/templates/starter/assets/products/patlican.png +0 -0
- package/payload/templates/starter/assets/products/yabanmersini.png +0 -0
- package/payload/templates/starter/assets/products/yesilbiber.png +0 -0
- package/payload/templates/starter/assets/tabs/grid.png +0 -0
- package/payload/templates/starter/assets/tabs/grids.png +0 -0
- package/payload/templates/starter/assets/tabs/home.png +0 -0
- package/payload/templates/starter/assets/tabs/homes.png +0 -0
- package/payload/templates/starter/assets/tabs/settings.png +0 -0
- package/payload/templates/starter/assets/tabs/settingss.png +0 -0
- package/payload/templates/starter/assets/tabs/tasks.png +0 -0
- package/payload/templates/starter/assets/tabs/taskss.png +0 -0
- package/payload/templates/starter/html/about.htm +54 -0
- package/payload/templates/starter/index.htm +57 -0
- package/payload/templates/starter/pages/about.js +23 -0
- package/payload/templates/starter/pages/home.js +81 -0
- package/payload/templates/starter/pages/product.js +45 -0
- package/payload/templates/starter/pages/products.js +61 -0
- package/payload/templates/starter/pages/settings.js +103 -0
- package/payload/templates/starter/pages/tasks.js +187 -0
- package/payload/templates/starter/pages/website.js +29 -0
|
@@ -0,0 +1,1096 @@
|
|
|
1
|
+
/* Bismillah */
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
|
|
5
|
+
TreeView - v26.10
|
|
6
|
+
|
|
7
|
+
UI COMPONENT TEMPLATE
|
|
8
|
+
- A tree of nested items: a file explorer, a category tree, the menu of an admin panel, the layers of a design tool.
|
|
9
|
+
- One row is one Label (an arrow, an optional icon, the text, a tag and a soft note in it), so a tree of
|
|
10
|
+
thousands of rows stays light.
|
|
11
|
+
- Only the changed branch is drawn again: the children of a closed item are created the first time it opens,
|
|
12
|
+
closing only hides them. updateNode() paints one row, setChildren() draws one branch.
|
|
13
|
+
- Lazy children: hasChildren: 1 and no children -> onLoadChildren(self, node) is called when it opens,
|
|
14
|
+
then the code gives them with self.setChildren(node.key, [...]).
|
|
15
|
+
- Keyboard (the tree takes the focus): ArrowUp / ArrowDown move the selection, ArrowRight opens (or goes to the
|
|
16
|
+
first child), ArrowLeft closes (or goes to the parent), Home, End, PageUp, PageDown, Enter -> onActivate,
|
|
17
|
+
Space opens / closes, typing a letter jumps to the next row that starts with it (typeAhead).
|
|
18
|
+
- Mouse: click selects, a click on the arrow opens / closes, a double click -> onActivate (and opens / closes).
|
|
19
|
+
- Accessibility: tree / treeitem / group roles, aria-level, aria-expanded, aria-selected, aria-activedescendant.
|
|
20
|
+
- onSelect is NOT called when the component is created or when the value is set with silent: 1.
|
|
21
|
+
- Style packages: "classic" (default), "modern", "dark". Select with styleName. (TreeView.styles)
|
|
22
|
+
- Everything is drawn with code (no image files needed).
|
|
23
|
+
|
|
24
|
+
NODE: { key, text, iconFile, tag, tagColor, note, textColor, children, expanded, hasChildren, disabled, data }
|
|
25
|
+
- text: Plain text (never read as HTML).
|
|
26
|
+
- tag: A short second text after the text, in the accent color (Ex: the type of a layer). tagColor: its own color.
|
|
27
|
+
- note: A soft text at the end (Ex: a size, a count, a preview).
|
|
28
|
+
- iconFile: An image (a file or a data:image/svg+xml URI).
|
|
29
|
+
- children: [NODE]. expanded: 1 -> open. hasChildren: 1 -> an arrow without children (lazy, see onLoadChildren).
|
|
30
|
+
- data: Anything of yours. It is kept by reference.
|
|
31
|
+
- A string is also accepted: "Docs" -> { key: "Docs", text: "Docs" }. A node without a key gets one.
|
|
32
|
+
|
|
33
|
+
USAGE:
|
|
34
|
+
const tree = TreeView({
|
|
35
|
+
width: 260,
|
|
36
|
+
height: 400,
|
|
37
|
+
items: [
|
|
38
|
+
{ key: "src", text: "src", expanded: 1, children: [
|
|
39
|
+
{ key: "src/app.js", text: "app.js", note: "4 KB" },
|
|
40
|
+
{ key: "src/lib", text: "lib", children: ["a.js", "b.js"] },
|
|
41
|
+
] },
|
|
42
|
+
{ key: "readme", text: "readme.md" },
|
|
43
|
+
],
|
|
44
|
+
value: "src/app.js",
|
|
45
|
+
onSelect: function (self, node) { println(node.key); },
|
|
46
|
+
onActivate: function (self, node) { println("open " + node.key); },
|
|
47
|
+
});
|
|
48
|
+
tree.setValue("readme"); // onSelect is called
|
|
49
|
+
tree.updateNode("readme", { note: "changed" }); // paints one row
|
|
50
|
+
tree.setChildren("src/lib", ["c.js"]); // draws one branch
|
|
51
|
+
tree.addNode("src", { key: "src/new.js", text: "new.js" });
|
|
52
|
+
tree.removeNode("readme");
|
|
53
|
+
tree.reveal("src/lib"); // opens the parents and scrolls to it
|
|
54
|
+
|
|
55
|
+
Started Date: October 2026
|
|
56
|
+
Developer: Bugra Ozden
|
|
57
|
+
Email: bugra.ozden@gmail.com
|
|
58
|
+
Webpage: https://bug7a.github.io/js-components/
|
|
59
|
+
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
"use strict";
|
|
63
|
+
|
|
64
|
+
// Default values:
|
|
65
|
+
const TreeViewDefaults = {
|
|
66
|
+
key: "0",
|
|
67
|
+
width: 260,
|
|
68
|
+
height: 320, // "auto": no scrolling, the tree grows with its rows.
|
|
69
|
+
items: [], // [NODE] (See NODE above)
|
|
70
|
+
value: null, // Key of the selected node. null: nothing is selected.
|
|
71
|
+
emptyText: "No items",
|
|
72
|
+
typeAhead: 1, // 1: Typing a letter jumps to the next row that starts with it.
|
|
73
|
+
useScrollBar: 1, // basic/scroll-bar.js (when it is loaded). 0: the scrollbar of the browser.
|
|
74
|
+
enabled: 1,
|
|
75
|
+
ariaLabel: "Tree",
|
|
76
|
+
onSelect: function (self, node) { }, // self.value, self.previousValue
|
|
77
|
+
onActivate: function (self, node) { }, // Double click or Enter
|
|
78
|
+
onToggle: function (self, node) { }, // node.expanded: 1 or 0
|
|
79
|
+
onHover: function (self, node) { }, // node: null when the mouse leaves the rows
|
|
80
|
+
onLoadChildren: function (self, node) { }, // hasChildren: 1 and no children. Call self.setChildren(node.key, [...]).
|
|
81
|
+
styleName: "classic", // "classic", "modern", "dark" or a name added to TreeView.styles
|
|
82
|
+
style: { // Classic style package (default)
|
|
83
|
+
box: {
|
|
84
|
+
color: "transparent",
|
|
85
|
+
border: 0,
|
|
86
|
+
borderColor: "transparent",
|
|
87
|
+
round: 0,
|
|
88
|
+
padding: [4, 4], // [x, y] around the rows
|
|
89
|
+
},
|
|
90
|
+
row: {
|
|
91
|
+
height: 28,
|
|
92
|
+
fontSize: 13,
|
|
93
|
+
textColor: Black(0.8),
|
|
94
|
+
indent: 16, // Per level
|
|
95
|
+
paddingLeft: 4,
|
|
96
|
+
paddingRight: 8,
|
|
97
|
+
gap: 6, // Between the arrow, the icon, the text, the tag and the note
|
|
98
|
+
round: 5,
|
|
99
|
+
},
|
|
100
|
+
rowHover: {
|
|
101
|
+
color: Black(0.05),
|
|
102
|
+
},
|
|
103
|
+
rowSelected: {
|
|
104
|
+
color: Black(0.09),
|
|
105
|
+
textColor: "#141414",
|
|
106
|
+
},
|
|
107
|
+
rowFocus: { // Ring of the selected row while the tree has the focus (keyboard)
|
|
108
|
+
outlineColor: Black(0.25),
|
|
109
|
+
},
|
|
110
|
+
arrow: {
|
|
111
|
+
color: Black(0.45),
|
|
112
|
+
size: 12,
|
|
113
|
+
motion: 0.15, // Seconds. 0: No animation
|
|
114
|
+
},
|
|
115
|
+
icon: {
|
|
116
|
+
size: 16,
|
|
117
|
+
},
|
|
118
|
+
tag: {
|
|
119
|
+
textColor: "#3A6EA5",
|
|
120
|
+
fontSize: 12,
|
|
121
|
+
},
|
|
122
|
+
note: {
|
|
123
|
+
textColor: Black(0.4),
|
|
124
|
+
fontSize: 12,
|
|
125
|
+
},
|
|
126
|
+
disabled: {
|
|
127
|
+
opacity: 0.4,
|
|
128
|
+
},
|
|
129
|
+
empty: {
|
|
130
|
+
textColor: Black(0.4),
|
|
131
|
+
fontSize: 13,
|
|
132
|
+
},
|
|
133
|
+
scrollBar: { bar_color: "#9A9A98", bar_mouseOverColor: "#6A6A68", bar_width: 4, bar_round: 3, bar_opacity: 0.4, bar_mouseOverOpacity: 0.9, bar_padding: 2 },
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
const TreeView = function (params = {}) {
|
|
138
|
+
|
|
139
|
+
// Merge style package: params.style > TreeView.styles[styleName] > TreeViewDefaults.style (classic)
|
|
140
|
+
basic.applyStylePackage(params, TreeView.styles, TreeViewDefaults);
|
|
141
|
+
|
|
142
|
+
// Merge params:
|
|
143
|
+
mergeIntoIfMissing(params, TreeViewDefaults);
|
|
144
|
+
|
|
145
|
+
// Edit params, if needed:
|
|
146
|
+
params.color = params.style.box.color;
|
|
147
|
+
const startItems = params.items;
|
|
148
|
+
const startValue = params.value;
|
|
149
|
+
params.items = [];
|
|
150
|
+
params.value = null;
|
|
151
|
+
const isAutoHeight = (String(params.height) === "auto"); // WHY: Read before startObject: box.height gives the measured height (0), never "auto".
|
|
152
|
+
|
|
153
|
+
// BOX: Component container
|
|
154
|
+
let box = startObject(params);
|
|
155
|
+
|
|
156
|
+
// *** PRIVATE VARIABLES:
|
|
157
|
+
const _s = box.style;
|
|
158
|
+
const id = "tree-view-" + (TreeView._counter++);
|
|
159
|
+
let roots = []; // [rec]
|
|
160
|
+
let recs = new Map(); // key -> rec { node, parent, level, row, group, built } (only the rows that were created)
|
|
161
|
+
let nodeIndex = new Map(); // key -> { node, parent } (every node, also inside closed branches)
|
|
162
|
+
let hoverRec = null;
|
|
163
|
+
let hasFocus = 0;
|
|
164
|
+
let typeBuffer = "";
|
|
165
|
+
let cancelTypeTimer = null; // (box.after: the timer is stopped by remove())
|
|
166
|
+
let keyCounter = 1;
|
|
167
|
+
const TYPE_AHEAD_RESET_MS = 600; // The typed letters are forgotten after this pause.
|
|
168
|
+
const SCROLL_SPACE = 4; // Space above / below a row that is scrolled into view.
|
|
169
|
+
const AUTO_HEIGHT_PAGE_SIZE = 10; // PageUp / PageDown step when the tree does not scroll.
|
|
170
|
+
const ARROW_BOX_EXTRA = 4; // The box of the arrow is this much wider than the arrow.
|
|
171
|
+
const TEXT_SPACE_WITHOUT_ICON = 2; // Space between the arrow and the text when there is no icon.
|
|
172
|
+
const EMPTY_TEXT_TOP = 16;
|
|
173
|
+
|
|
174
|
+
// *** PUBLIC VARIABLES:
|
|
175
|
+
box.previousValue = null;
|
|
176
|
+
// NOTE: Default values are also public variables. (box.value, box.enabled)
|
|
177
|
+
|
|
178
|
+
// *** PRIVATE FUNCTIONS:
|
|
179
|
+
|
|
180
|
+
const escapeText = function (text) {
|
|
181
|
+
return basic.escapeHtml(String((text === undefined || text === null) ? "" : text));
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
const isFilled = function (value) {
|
|
185
|
+
return value !== undefined && value !== null && value !== "";
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
// A <span> with inline styles. styles: ["flex:0 0 auto", "color:red"]
|
|
189
|
+
const span = function (styles, content, attributes = "") {
|
|
190
|
+
return "<span" + attributes + ' style="' + styles.join(";") + '">' + content + "</span>";
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
// NODE -> a copy of the node with a key (children are copied too). data is kept by reference.
|
|
194
|
+
const normalize = function (node) {
|
|
195
|
+
if (typeof node === "string" || typeof node === "number") {
|
|
196
|
+
node = { key: String(node), text: String(node) };
|
|
197
|
+
}
|
|
198
|
+
const out = Object.assign({}, node);
|
|
199
|
+
if (!isFilled(out.key)) out.key = "node-" + (keyCounter++);
|
|
200
|
+
out.key = String(out.key);
|
|
201
|
+
if (out.text === undefined) out.text = out.key;
|
|
202
|
+
out.expanded = (out.expanded == 1) ? 1 : 0;
|
|
203
|
+
out.children = Array.isArray(node.children) ? node.children.map(normalize) : null;
|
|
204
|
+
return out;
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
// Has an arrow: children, or lazy children that are not loaded yet.
|
|
208
|
+
const canExpand = function (rec) {
|
|
209
|
+
const node = rec.node;
|
|
210
|
+
if (node.children && node.children.length > 0) return true;
|
|
211
|
+
return node.hasChildren == 1 && !node.children;
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
const isOpen = function (rec) {
|
|
215
|
+
return rec.node.expanded == 1 && canExpand(rec);
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
const getRowId = function (rec) {
|
|
219
|
+
return id + "-" + TreeView.toId(rec.node.key);
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
const getArrowHtml = function (rec) {
|
|
223
|
+
const arrow = _s.arrow;
|
|
224
|
+
const styles = [
|
|
225
|
+
"display:inline-flex",
|
|
226
|
+
"align-items:center",
|
|
227
|
+
"justify-content:center",
|
|
228
|
+
"flex:0 0 " + (arrow.size + ARROW_BOX_EXTRA) + "px",
|
|
229
|
+
"height:100%",
|
|
230
|
+
"transform:rotate(" + (isOpen(rec) ? 90 : 0) + "deg)",
|
|
231
|
+
];
|
|
232
|
+
if (arrow.motion) styles.push("transition:transform " + arrow.motion + "s");
|
|
233
|
+
const svg = (canExpand(rec)) ? TreeView.getChevronSvg(arrow.color, arrow.size) : "";
|
|
234
|
+
return span(styles, svg, ' data-tv-arrow="1"');
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
const getIconHtml = function (node) {
|
|
238
|
+
const size = _s.icon.size + "px";
|
|
239
|
+
const styles = [
|
|
240
|
+
"flex:0 0 " + size,
|
|
241
|
+
"width:" + size,
|
|
242
|
+
"height:" + size,
|
|
243
|
+
"margin-left:" + (_s.row.gap - 4) + "px",
|
|
244
|
+
"object-fit:contain",
|
|
245
|
+
];
|
|
246
|
+
return '<img src="' + escapeText(node.iconFile) + '" alt="" style="' + styles.join(";") + '">';
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
const getTextHtml = function (node) {
|
|
250
|
+
const styles = [
|
|
251
|
+
"margin-left:" + ((node.iconFile) ? _s.row.gap : TEXT_SPACE_WITHOUT_ICON) + "px",
|
|
252
|
+
"flex:0 1 auto",
|
|
253
|
+
"min-width:0",
|
|
254
|
+
"overflow:hidden",
|
|
255
|
+
"text-overflow:ellipsis",
|
|
256
|
+
];
|
|
257
|
+
if (node.textColor) styles.push("color:" + escapeText(node.textColor));
|
|
258
|
+
return span(styles, escapeText(node.text));
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
const getTagHtml = function (node) {
|
|
262
|
+
const styles = [
|
|
263
|
+
"margin-left:" + _s.row.gap + "px",
|
|
264
|
+
"flex:0 0 auto",
|
|
265
|
+
"color:" + escapeText(node.tagColor || _s.tag.textColor),
|
|
266
|
+
"font-size:" + _s.tag.fontSize + "px",
|
|
267
|
+
];
|
|
268
|
+
return span(styles, escapeText(node.tag));
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
const getNoteHtml = function (node) {
|
|
272
|
+
const styles = [
|
|
273
|
+
"margin-left:" + _s.row.gap + "px",
|
|
274
|
+
"flex:0 1 auto",
|
|
275
|
+
"min-width:0",
|
|
276
|
+
"overflow:hidden",
|
|
277
|
+
"text-overflow:ellipsis",
|
|
278
|
+
"color:" + _s.note.textColor,
|
|
279
|
+
"font-size:" + _s.note.fontSize + "px",
|
|
280
|
+
];
|
|
281
|
+
return span(styles, escapeText(node.note));
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
// The inside of a row: arrow, icon, text, tag, note.
|
|
285
|
+
// WHY: One Label with HTML, not one object for each part: a tree of thousands of rows stays light.
|
|
286
|
+
const getRowHtml = function (rec) {
|
|
287
|
+
const node = rec.node;
|
|
288
|
+
let html = getArrowHtml(rec);
|
|
289
|
+
if (node.iconFile) html += getIconHtml(node);
|
|
290
|
+
html += getTextHtml(node);
|
|
291
|
+
if (isFilled(node.tag)) html += getTagHtml(node);
|
|
292
|
+
if (isFilled(node.note)) html += getNoteHtml(node);
|
|
293
|
+
return html;
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
const getRowColor = function (isSelected, isHover) {
|
|
297
|
+
if (isSelected) return _s.rowSelected.color;
|
|
298
|
+
if (isHover) return _s.rowHover.color;
|
|
299
|
+
return "transparent";
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
// Colors and aria of a row. (The text is not drawn again.)
|
|
303
|
+
const paintRow = function (rec) {
|
|
304
|
+
|
|
305
|
+
if (!rec.row) return;
|
|
306
|
+
|
|
307
|
+
const node = rec.node;
|
|
308
|
+
const row = rec.row;
|
|
309
|
+
const isSelected = (node.key === box.value);
|
|
310
|
+
const isHover = (rec === hoverRec) && !isSelected && !node.disabled;
|
|
311
|
+
|
|
312
|
+
row.color = getRowColor(isSelected, isHover);
|
|
313
|
+
row.textColor = (isSelected) ? _s.rowSelected.textColor : _s.row.textColor;
|
|
314
|
+
row.opacity = (node.disabled) ? _s.disabled.opacity : 1;
|
|
315
|
+
row.boxShadow = (isSelected && hasFocus) ? "inset 0 0 0 1px " + _s.rowFocus.outlineColor : "none";
|
|
316
|
+
|
|
317
|
+
row.aria = {
|
|
318
|
+
selected: isSelected,
|
|
319
|
+
disabled: (node.disabled) ? true : false,
|
|
320
|
+
expanded: (canExpand(rec)) ? isOpen(rec) : null, // null: a leaf has no aria-expanded
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
// Text, arrow and colors of a row.
|
|
326
|
+
const drawRow = function (rec) {
|
|
327
|
+
if (!rec.row) return;
|
|
328
|
+
rec.row.text = getRowHtml(rec);
|
|
329
|
+
paintRow(rec);
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
// Creates the row of a node in the current container (and its open children).
|
|
333
|
+
const buildRec = function (node, parent, level) {
|
|
334
|
+
|
|
335
|
+
const rec = { node: node, parent: parent, level: level, row: null, group: null, built: 0 };
|
|
336
|
+
recs.set(node.key, rec);
|
|
337
|
+
|
|
338
|
+
const rowStyle = _s.row;
|
|
339
|
+
|
|
340
|
+
// LABEL: Row
|
|
341
|
+
rec.row = Label({
|
|
342
|
+
width: "100%",
|
|
343
|
+
height: rowStyle.height,
|
|
344
|
+
text: "",
|
|
345
|
+
fontSize: rowStyle.fontSize,
|
|
346
|
+
textColor: rowStyle.textColor,
|
|
347
|
+
color: "transparent",
|
|
348
|
+
round: rowStyle.round,
|
|
349
|
+
shrink: 0,
|
|
350
|
+
cursor: "default",
|
|
351
|
+
css: {
|
|
352
|
+
position: "relative",
|
|
353
|
+
display: "flex",
|
|
354
|
+
alignItems: "center",
|
|
355
|
+
whiteSpace: "nowrap",
|
|
356
|
+
overflow: "hidden",
|
|
357
|
+
boxSizing: "border-box",
|
|
358
|
+
paddingLeft: (rowStyle.paddingLeft + level * rowStyle.indent) + "px",
|
|
359
|
+
paddingRight: rowStyle.paddingRight + "px",
|
|
360
|
+
},
|
|
361
|
+
role: "treeitem",
|
|
362
|
+
aria: { level: level + 1 },
|
|
363
|
+
});
|
|
364
|
+
rec.row.elem.id = getRowId(rec);
|
|
365
|
+
rec.row.elem._treeRec = rec; // WHY: One click listener for all the rows finds the rec of a row with it.
|
|
366
|
+
rec.row.clickable = 1;
|
|
367
|
+
drawRow(rec);
|
|
368
|
+
|
|
369
|
+
if (isOpen(rec)) buildChildren(rec);
|
|
370
|
+
|
|
371
|
+
return rec;
|
|
372
|
+
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
// Creates the group of the children right after the row (the first time the node opens).
|
|
376
|
+
const buildChildren = function (rec) {
|
|
377
|
+
|
|
378
|
+
if (rec.built || !rec.node.children) return;
|
|
379
|
+
rec.built = 1;
|
|
380
|
+
|
|
381
|
+
// GROUP: Children
|
|
382
|
+
createIn(rec.row.containerBox, function () {
|
|
383
|
+
rec.group = VGroup({
|
|
384
|
+
width: "100%",
|
|
385
|
+
height: "auto",
|
|
386
|
+
align: "left top",
|
|
387
|
+
gap: 0,
|
|
388
|
+
color: "transparent",
|
|
389
|
+
position: "relative",
|
|
390
|
+
css: { alignItems: "stretch" },
|
|
391
|
+
role: "group",
|
|
392
|
+
});
|
|
393
|
+
rec.children = rec.node.children.map(function (child) {
|
|
394
|
+
return buildRec(child, rec, rec.level + 1);
|
|
395
|
+
});
|
|
396
|
+
endGroup();
|
|
397
|
+
});
|
|
398
|
+
|
|
399
|
+
// WHY: createIn adds it at the end of the container; it must be right under its row.
|
|
400
|
+
rec.row.elem.after(rec.group.elem);
|
|
401
|
+
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
// Removes a rec and its children from the map (their objects are removed with their group).
|
|
405
|
+
const forget = function (rec) {
|
|
406
|
+
if (rec === hoverRec) hoverRec = null;
|
|
407
|
+
recs.delete(rec.node.key);
|
|
408
|
+
(rec.children || []).forEach(forget);
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
const indexNodes = function (list, parentNode) {
|
|
412
|
+
(list || []).forEach(function (node) {
|
|
413
|
+
nodeIndex.set(node.key, { node: node, parent: parentNode });
|
|
414
|
+
if (node.children) indexNodes(node.children, node);
|
|
415
|
+
});
|
|
416
|
+
};
|
|
417
|
+
|
|
418
|
+
const unindexNode = function (node) {
|
|
419
|
+
nodeIndex.delete(node.key);
|
|
420
|
+
(node.children || []).forEach(unindexNode);
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
// The rec of a key: the closed parents are opened (their rows are created) first.
|
|
424
|
+
const ensureRec = function (key) {
|
|
425
|
+
key = String(key);
|
|
426
|
+
// WHY no early return for a made row: its parent may have been closed since (the row is there but hidden)
|
|
427
|
+
if (!nodeIndex.get(key)) return recs.get(key) || null;
|
|
428
|
+
const path = box.getPath(key);
|
|
429
|
+
for (let i = 0; i < path.length - 1; i++) {
|
|
430
|
+
const rec = recs.get(path[i].key);
|
|
431
|
+
if (!rec) return null;
|
|
432
|
+
setExpanded(rec, 1);
|
|
433
|
+
}
|
|
434
|
+
return recs.get(key) || null;
|
|
435
|
+
};
|
|
436
|
+
|
|
437
|
+
// The selection was removed (it is not in the tree any more).
|
|
438
|
+
const dropLostValue = function () {
|
|
439
|
+
if (box.value === null || nodeIndex.get(box.value)) return;
|
|
440
|
+
box.previousValue = box.value;
|
|
441
|
+
box.value = null;
|
|
442
|
+
box.listArea.aria = { activedescendant: null };
|
|
443
|
+
};
|
|
444
|
+
|
|
445
|
+
const removeRecView = function (rec) {
|
|
446
|
+
if (rec.group) rec.group.remove();
|
|
447
|
+
if (rec.row) rec.row.remove();
|
|
448
|
+
rec.group = null;
|
|
449
|
+
rec.row = null;
|
|
450
|
+
};
|
|
451
|
+
|
|
452
|
+
// Draws the children of a rec again (only that branch).
|
|
453
|
+
const rebuildChildren = function (rec) {
|
|
454
|
+
(rec.children || []).forEach(forget);
|
|
455
|
+
if (rec.group) rec.group.remove();
|
|
456
|
+
rec.group = null;
|
|
457
|
+
rec.children = [];
|
|
458
|
+
rec.built = 0;
|
|
459
|
+
if (isOpen(rec)) buildChildren(rec);
|
|
460
|
+
drawRow(rec);
|
|
461
|
+
};
|
|
462
|
+
|
|
463
|
+
const updateEmpty = function () {
|
|
464
|
+
box.lblEmpty.visible = (roots.length) ? 0 : 1;
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
const refreshScroll = function () {
|
|
468
|
+
if (box && box.scrollBar && box.scrollBar.refreshScroll) box.scrollBar.refreshScroll();
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
// The rows that can be seen (the parents are open), in order.
|
|
472
|
+
const getVisibleRecs = function () {
|
|
473
|
+
const out = [];
|
|
474
|
+
const walk = function (list) {
|
|
475
|
+
list.forEach(function (rec) {
|
|
476
|
+
out.push(rec);
|
|
477
|
+
if (isOpen(rec) && rec.children) walk(rec.children);
|
|
478
|
+
});
|
|
479
|
+
};
|
|
480
|
+
walk(roots);
|
|
481
|
+
return out;
|
|
482
|
+
};
|
|
483
|
+
|
|
484
|
+
const getEnabledVisibleRecs = function () {
|
|
485
|
+
return getVisibleRecs().filter(function (rec) { return !rec.node.disabled; });
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
const scrollRowIntoView = function (rec) {
|
|
489
|
+
if (!rec || !rec.row || isAutoHeight) return;
|
|
490
|
+
const area = box.listArea.elem;
|
|
491
|
+
const areaBox = area.getBoundingClientRect();
|
|
492
|
+
const rowBox = rec.row.elem.getBoundingClientRect();
|
|
493
|
+
if (rowBox.top < areaBox.top) area.scrollTop -= (areaBox.top - rowBox.top) + SCROLL_SPACE;
|
|
494
|
+
else if (rowBox.bottom > areaBox.bottom) area.scrollTop += (rowBox.bottom - areaBox.bottom) + SCROLL_SPACE;
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
const setHover = function (rec) {
|
|
498
|
+
if (rec === hoverRec) return;
|
|
499
|
+
const oldRec = hoverRec;
|
|
500
|
+
hoverRec = rec;
|
|
501
|
+
if (oldRec) paintRow(oldRec);
|
|
502
|
+
if (rec) paintRow(rec);
|
|
503
|
+
box.onHover(box, (rec) ? rec.node : null);
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
const openRec = function (rec) {
|
|
507
|
+
if (rec.node.children && rec.built) {
|
|
508
|
+
rec.group.visible = 1;
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
if (rec.node.children) {
|
|
512
|
+
buildChildren(rec);
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
515
|
+
// Lazy: the code gives the children with setChildren().
|
|
516
|
+
drawRow(rec);
|
|
517
|
+
box.onLoadChildren(box, rec.node);
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
const closeRec = function (rec, fromUser) {
|
|
521
|
+
if (rec.group) rec.group.visible = 0;
|
|
522
|
+
// WHY: The selection must stay where it can be seen (keyboard).
|
|
523
|
+
const selected = recs.get(box.value);
|
|
524
|
+
if (fromUser && selected && isInside(selected, rec)) selectRec(rec, 1);
|
|
525
|
+
};
|
|
526
|
+
|
|
527
|
+
const setExpanded = function (rec, expanded, fromUser) {
|
|
528
|
+
if (!rec || !canExpand(rec)) return;
|
|
529
|
+
expanded = (expanded) ? 1 : 0;
|
|
530
|
+
if (rec.node.expanded == expanded) return;
|
|
531
|
+
rec.node.expanded = expanded;
|
|
532
|
+
|
|
533
|
+
if (expanded) openRec(rec);
|
|
534
|
+
else closeRec(rec, fromUser);
|
|
535
|
+
if (!box) return; // WHY: onLoadChildren can remove the tree.
|
|
536
|
+
|
|
537
|
+
drawRow(rec);
|
|
538
|
+
refreshScroll();
|
|
539
|
+
box.onToggle(box, rec.node);
|
|
540
|
+
};
|
|
541
|
+
|
|
542
|
+
const isInside = function (rec, parent) {
|
|
543
|
+
for (let p = rec.parent; p; p = p.parent) {
|
|
544
|
+
if (p === parent) return true;
|
|
545
|
+
}
|
|
546
|
+
return false;
|
|
547
|
+
};
|
|
548
|
+
|
|
549
|
+
// fromUser: onSelect is called. (Not for silent.)
|
|
550
|
+
const selectRec = function (rec, fromUser) {
|
|
551
|
+
if (!rec || rec.node.disabled) return;
|
|
552
|
+
if (rec.node.key === box.value) return;
|
|
553
|
+
const oldRec = recs.get(box.value);
|
|
554
|
+
box.previousValue = box.value;
|
|
555
|
+
box.value = rec.node.key;
|
|
556
|
+
if (oldRec) paintRow(oldRec);
|
|
557
|
+
paintRow(rec);
|
|
558
|
+
box.listArea.aria = { activedescendant: getRowId(rec) };
|
|
559
|
+
scrollRowIntoView(rec);
|
|
560
|
+
if (fromUser) box.onSelect(box, rec.node);
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
const activateRec = function (rec) {
|
|
564
|
+
if (!rec || rec.node.disabled) return;
|
|
565
|
+
box.onActivate(box, rec.node);
|
|
566
|
+
};
|
|
567
|
+
|
|
568
|
+
// step: +1 down, -1 up; Infinity / -Infinity: the last / the first row.
|
|
569
|
+
const moveSelection = function (step) {
|
|
570
|
+
const list = getEnabledVisibleRecs();
|
|
571
|
+
if (!list.length) return;
|
|
572
|
+
let position = list.indexOf(recs.get(box.value));
|
|
573
|
+
if (position === -1) position = (step > 0) ? -1 : list.length;
|
|
574
|
+
position = basic.clamp(position + step, 0, list.length - 1);
|
|
575
|
+
selectRec(list[position], 1);
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
const getPageSize = function () {
|
|
579
|
+
if (isAutoHeight) return AUTO_HEIGHT_PAGE_SIZE;
|
|
580
|
+
return Math.max(1, Math.floor(box.listArea.elem.clientHeight / _s.row.height) - 1);
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
// ArrowRight: opens a closed node, or goes to the first child of an open one.
|
|
584
|
+
const goRight = function (current) {
|
|
585
|
+
if (!current) {
|
|
586
|
+
moveSelection(1);
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
if (canExpand(current) && !isOpen(current)) {
|
|
590
|
+
setExpanded(current, 1, 1);
|
|
591
|
+
return;
|
|
592
|
+
}
|
|
593
|
+
if (!isOpen(current) || !current.children) return;
|
|
594
|
+
const firstChild = current.children.find(function (child) { return !child.node.disabled; });
|
|
595
|
+
selectRec(firstChild, 1);
|
|
596
|
+
};
|
|
597
|
+
|
|
598
|
+
// ArrowLeft: closes an open node, or goes to the parent.
|
|
599
|
+
const goLeft = function (current) {
|
|
600
|
+
if (!current) return;
|
|
601
|
+
if (isOpen(current)) setExpanded(current, 0, 1);
|
|
602
|
+
else if (current.parent) selectRec(current.parent, 1);
|
|
603
|
+
};
|
|
604
|
+
|
|
605
|
+
const isTypeAheadKey = function (event) {
|
|
606
|
+
if (box.typeAhead != 1 || event.key.length !== 1) return false;
|
|
607
|
+
return !event.ctrlKey && !event.metaKey && !event.altKey;
|
|
608
|
+
};
|
|
609
|
+
|
|
610
|
+
// Returns 1 when the key was used by the tree.
|
|
611
|
+
const handleKey = function (event) {
|
|
612
|
+
|
|
613
|
+
const current = recs.get(box.value);
|
|
614
|
+
|
|
615
|
+
switch (event.key) {
|
|
616
|
+
case "ArrowDown": moveSelection(1); return 1;
|
|
617
|
+
case "ArrowUp": moveSelection(-1); return 1;
|
|
618
|
+
case "PageDown": moveSelection(getPageSize()); return 1;
|
|
619
|
+
case "PageUp": moveSelection(-getPageSize()); return 1;
|
|
620
|
+
case "Home": moveSelection(-Infinity); return 1;
|
|
621
|
+
case "End": moveSelection(Infinity); return 1;
|
|
622
|
+
case "ArrowRight": goRight(current); return 1;
|
|
623
|
+
case "ArrowLeft": goLeft(current); return 1;
|
|
624
|
+
case "Enter": activateRec(current); return 1;
|
|
625
|
+
case " ":
|
|
626
|
+
if (current && canExpand(current)) setExpanded(current, !isOpen(current), 1);
|
|
627
|
+
return 1;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
if (!isTypeAheadKey(event)) return 0;
|
|
631
|
+
typeAhead(event.key);
|
|
632
|
+
return 1;
|
|
633
|
+
|
|
634
|
+
};
|
|
635
|
+
|
|
636
|
+
const onKeyDown = function (event) {
|
|
637
|
+
if (box.enabled != 1) return;
|
|
638
|
+
if (!handleKey(event)) return;
|
|
639
|
+
event.preventDefault();
|
|
640
|
+
event.stopPropagation();
|
|
641
|
+
};
|
|
642
|
+
|
|
643
|
+
// Jumps to the next row whose text starts with the typed letters.
|
|
644
|
+
const typeAhead = function (char) {
|
|
645
|
+
|
|
646
|
+
if (cancelTypeTimer) cancelTypeTimer();
|
|
647
|
+
cancelTypeTimer = box.after(TYPE_AHEAD_RESET_MS, function () {
|
|
648
|
+
typeBuffer = "";
|
|
649
|
+
cancelTypeTimer = null;
|
|
650
|
+
});
|
|
651
|
+
typeBuffer += char.toLocaleLowerCase();
|
|
652
|
+
|
|
653
|
+
const list = getEnabledVisibleRecs();
|
|
654
|
+
if (!list.length) return;
|
|
655
|
+
|
|
656
|
+
const start = Math.max(0, list.indexOf(recs.get(box.value)));
|
|
657
|
+
// WHY: One letter: the next match. More letters: the same row, while it still matches.
|
|
658
|
+
const from = (typeBuffer.length === 1) ? start + 1 : start;
|
|
659
|
+
for (let i = 0; i < list.length; i++) {
|
|
660
|
+
const rec = list[(from + i) % list.length];
|
|
661
|
+
const text = String(rec.node.text).toLocaleLowerCase();
|
|
662
|
+
if (text.indexOf(typeBuffer) !== 0) continue;
|
|
663
|
+
selectRec(rec, 1);
|
|
664
|
+
return;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
};
|
|
668
|
+
|
|
669
|
+
const getRecOfEvent = function (event) {
|
|
670
|
+
for (let element = event.target; element && element !== box.listArea.elem; element = element.parentElement) {
|
|
671
|
+
if (element._treeRec) return element._treeRec;
|
|
672
|
+
}
|
|
673
|
+
return null;
|
|
674
|
+
};
|
|
675
|
+
|
|
676
|
+
const isArrowEvent = function (event) {
|
|
677
|
+
return !!(event.target && event.target.closest && event.target.closest("[data-tv-arrow]"));
|
|
678
|
+
};
|
|
679
|
+
|
|
680
|
+
// Puts the row (and its children group) before the row of next. (No next: it stays at the end.)
|
|
681
|
+
const moveRecTo = function (rec, next) {
|
|
682
|
+
if (!next || !next.row) return;
|
|
683
|
+
next.row.elem.before(rec.row.elem);
|
|
684
|
+
if (rec.group) rec.row.elem.after(rec.group.elem);
|
|
685
|
+
};
|
|
686
|
+
|
|
687
|
+
const getInsertPosition = function (position, length) {
|
|
688
|
+
return (position < 0 || position > length) ? length : position;
|
|
689
|
+
};
|
|
690
|
+
|
|
691
|
+
const addRootNode = function (node, position) {
|
|
692
|
+
const at = getInsertPosition(position, roots.length);
|
|
693
|
+
indexNodes([node], null);
|
|
694
|
+
const rec = createIn(box.list, function () { return buildRec(node, null, 0); });
|
|
695
|
+
roots.splice(at, 0, rec);
|
|
696
|
+
moveRecTo(rec, roots[at + 1]);
|
|
697
|
+
};
|
|
698
|
+
|
|
699
|
+
const addChildNode = function (parentEntry, node, position) {
|
|
700
|
+
|
|
701
|
+
const parentNode = parentEntry.node;
|
|
702
|
+
parentNode.children = parentNode.children || [];
|
|
703
|
+
const at = getInsertPosition(position, parentNode.children.length);
|
|
704
|
+
indexNodes([node], parentNode);
|
|
705
|
+
parentNode.children.splice(at, 0, node);
|
|
706
|
+
|
|
707
|
+
// Not drawn yet (closed or not created): drawn when it opens. Only the arrow of the parent can change.
|
|
708
|
+
const parent = recs.get(parentNode.key);
|
|
709
|
+
if (!parent || !parent.built) {
|
|
710
|
+
if (parent) drawRow(parent);
|
|
711
|
+
return;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
const rec = createIn(parent.group, function () { return buildRec(node, parent, parent.level + 1); });
|
|
715
|
+
parent.children.splice(at, 0, rec);
|
|
716
|
+
moveRecTo(rec, parent.children[at + 1]);
|
|
717
|
+
drawRow(parent);
|
|
718
|
+
|
|
719
|
+
};
|
|
720
|
+
|
|
721
|
+
// *** PUBLIC FUNCTIONS:
|
|
722
|
+
|
|
723
|
+
// The tree again from a NODE list. (Expanded states come from the nodes.)
|
|
724
|
+
box.setItems = function (items, value = box.value) {
|
|
725
|
+
roots.forEach(forget);
|
|
726
|
+
roots.forEach(removeRecView);
|
|
727
|
+
roots = [];
|
|
728
|
+
recs = new Map();
|
|
729
|
+
nodeIndex = new Map();
|
|
730
|
+
hoverRec = null;
|
|
731
|
+
const list = (Array.isArray(items) ? items : []).map(normalize);
|
|
732
|
+
indexNodes(list, null);
|
|
733
|
+
createIn(box.list, function () {
|
|
734
|
+
roots = list.map(function (node) { return buildRec(node, null, 0); });
|
|
735
|
+
});
|
|
736
|
+
box.value = null;
|
|
737
|
+
if (value !== null && value !== undefined) {
|
|
738
|
+
const rec = ensureRec(value);
|
|
739
|
+
if (rec) selectRec(rec, 0);
|
|
740
|
+
}
|
|
741
|
+
updateEmpty();
|
|
742
|
+
refreshScroll();
|
|
743
|
+
};
|
|
744
|
+
|
|
745
|
+
// The nodes with their current expanded states. (A copy; data is kept by reference.)
|
|
746
|
+
box.getItems = function () {
|
|
747
|
+
const copy = function (node) {
|
|
748
|
+
const out = Object.assign({}, node);
|
|
749
|
+
if (node.children) out.children = node.children.map(copy);
|
|
750
|
+
return out;
|
|
751
|
+
};
|
|
752
|
+
return roots.map(function (rec) { return copy(rec.node); });
|
|
753
|
+
};
|
|
754
|
+
|
|
755
|
+
box.getNode = function (key) {
|
|
756
|
+
const entry = nodeIndex.get(String(key));
|
|
757
|
+
return (entry) ? entry.node : null;
|
|
758
|
+
};
|
|
759
|
+
|
|
760
|
+
box.getParent = function (key) {
|
|
761
|
+
const entry = nodeIndex.get(String(key));
|
|
762
|
+
return (entry) ? entry.parent : null;
|
|
763
|
+
};
|
|
764
|
+
|
|
765
|
+
// [root, ..., node]
|
|
766
|
+
box.getPath = function (key) {
|
|
767
|
+
const out = [];
|
|
768
|
+
let entry = nodeIndex.get(String(key));
|
|
769
|
+
while (entry) {
|
|
770
|
+
out.unshift(entry.node);
|
|
771
|
+
entry = (entry.parent) ? nodeIndex.get(entry.parent.key) : null;
|
|
772
|
+
}
|
|
773
|
+
return out;
|
|
774
|
+
};
|
|
775
|
+
|
|
776
|
+
box.getSelectedNode = function () {
|
|
777
|
+
return box.getNode(box.value);
|
|
778
|
+
};
|
|
779
|
+
|
|
780
|
+
// silent: 1 -> onSelect is not called. null: nothing is selected.
|
|
781
|
+
box.setValue = function (key, silent = 0) {
|
|
782
|
+
if (key === null || key === undefined) {
|
|
783
|
+
const oldRec = recs.get(box.value);
|
|
784
|
+
box.previousValue = box.value;
|
|
785
|
+
box.value = null;
|
|
786
|
+
if (oldRec) paintRow(oldRec);
|
|
787
|
+
box.listArea.aria = { activedescendant: null };
|
|
788
|
+
return;
|
|
789
|
+
}
|
|
790
|
+
const rec = ensureRec(key);
|
|
791
|
+
if (!rec) return;
|
|
792
|
+
selectRec(rec, !silent);
|
|
793
|
+
scrollRowIntoView(rec);
|
|
794
|
+
};
|
|
795
|
+
|
|
796
|
+
// NOTE: A node in a closed branch only keeps the state: it is drawn so when its parent opens.
|
|
797
|
+
const setNodeExpanded = function (key, expanded) {
|
|
798
|
+
const rec = recs.get(String(key));
|
|
799
|
+
if (rec) {
|
|
800
|
+
setExpanded(rec, expanded);
|
|
801
|
+
return;
|
|
802
|
+
}
|
|
803
|
+
const entry = nodeIndex.get(String(key));
|
|
804
|
+
if (entry) entry.node.expanded = (expanded) ? 1 : 0;
|
|
805
|
+
};
|
|
806
|
+
|
|
807
|
+
box.expand = function (key) {
|
|
808
|
+
setNodeExpanded(key, 1);
|
|
809
|
+
};
|
|
810
|
+
|
|
811
|
+
box.collapse = function (key) {
|
|
812
|
+
setNodeExpanded(key, 0);
|
|
813
|
+
};
|
|
814
|
+
|
|
815
|
+
box.toggle = function (key) {
|
|
816
|
+
const node = box.getNode(key);
|
|
817
|
+
if (node) setNodeExpanded(key, !(node.expanded == 1));
|
|
818
|
+
};
|
|
819
|
+
|
|
820
|
+
// NOTE: Opens every node that has children (lazy ones are not loaded).
|
|
821
|
+
box.expandAll = function () {
|
|
822
|
+
const walk = function (list) {
|
|
823
|
+
list.forEach(function (rec) {
|
|
824
|
+
if (!rec.node.children || !rec.node.children.length) return;
|
|
825
|
+
setExpanded(rec, 1);
|
|
826
|
+
walk(rec.children || []);
|
|
827
|
+
});
|
|
828
|
+
};
|
|
829
|
+
walk(roots);
|
|
830
|
+
};
|
|
831
|
+
|
|
832
|
+
box.collapseAll = function () {
|
|
833
|
+
recs.forEach(function (rec) { setExpanded(rec, 0); });
|
|
834
|
+
nodeIndex.forEach(function (entry, key) {
|
|
835
|
+
if (!recs.get(key)) entry.node.expanded = 0;
|
|
836
|
+
});
|
|
837
|
+
};
|
|
838
|
+
|
|
839
|
+
// Opens the parents of a node and scrolls to it.
|
|
840
|
+
box.reveal = function (key) {
|
|
841
|
+
scrollRowIntoView(ensureRec(key));
|
|
842
|
+
};
|
|
843
|
+
|
|
844
|
+
// Changes some fields of a node and paints only its row. ("children" -> use setChildren)
|
|
845
|
+
box.updateNode = function (key, props = {}) {
|
|
846
|
+
const entry = nodeIndex.get(String(key));
|
|
847
|
+
if (!entry) return;
|
|
848
|
+
Object.keys(props).forEach(function (name) {
|
|
849
|
+
if (name === "children" || name === "key" || name === "expanded") return;
|
|
850
|
+
entry.node[name] = props[name];
|
|
851
|
+
});
|
|
852
|
+
const rec = recs.get(String(key));
|
|
853
|
+
if (rec) drawRow(rec);
|
|
854
|
+
if (props.expanded !== undefined) setNodeExpanded(key, props.expanded);
|
|
855
|
+
};
|
|
856
|
+
|
|
857
|
+
// New children for a node (lazy loading, a refresh). Only that branch is drawn again.
|
|
858
|
+
box.setChildren = function (key, children) {
|
|
859
|
+
const entry = nodeIndex.get(String(key));
|
|
860
|
+
if (!entry) return;
|
|
861
|
+
(entry.node.children || []).forEach(unindexNode);
|
|
862
|
+
entry.node.children = (Array.isArray(children) ? children : []).map(normalize);
|
|
863
|
+
indexNodes(entry.node.children, entry.node);
|
|
864
|
+
dropLostValue();
|
|
865
|
+
const rec = recs.get(String(key));
|
|
866
|
+
if (rec) rebuildChildren(rec); // Not created yet: drawn when its parent opens.
|
|
867
|
+
refreshScroll();
|
|
868
|
+
};
|
|
869
|
+
|
|
870
|
+
// Adds a node under parentKey (null: a root) at position (-1: the end). Returns the node.
|
|
871
|
+
box.addNode = function (parentKey, node, position = -1) {
|
|
872
|
+
|
|
873
|
+
const isRoot = (parentKey === null || parentKey === undefined);
|
|
874
|
+
const parentEntry = (isRoot) ? null : nodeIndex.get(String(parentKey));
|
|
875
|
+
if (!isRoot && !parentEntry) return null;
|
|
876
|
+
|
|
877
|
+
const newNode = normalize(node);
|
|
878
|
+
if (nodeIndex.get(newNode.key)) {
|
|
879
|
+
console.warn("TreeView: The key is used: " + newNode.key);
|
|
880
|
+
return null;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
if (isRoot) addRootNode(newNode, position);
|
|
884
|
+
else addChildNode(parentEntry, newNode, position);
|
|
885
|
+
|
|
886
|
+
updateEmpty();
|
|
887
|
+
refreshScroll();
|
|
888
|
+
return newNode;
|
|
889
|
+
|
|
890
|
+
};
|
|
891
|
+
|
|
892
|
+
box.removeNode = function (key) {
|
|
893
|
+
|
|
894
|
+
const entry = nodeIndex.get(String(key));
|
|
895
|
+
if (!entry) return;
|
|
896
|
+
|
|
897
|
+
if (entry.parent) {
|
|
898
|
+
const siblings = entry.parent.children;
|
|
899
|
+
const position = siblings.indexOf(entry.node);
|
|
900
|
+
if (position !== -1) siblings.splice(position, 1);
|
|
901
|
+
}
|
|
902
|
+
unindexNode(entry.node);
|
|
903
|
+
|
|
904
|
+
const rec = recs.get(String(key));
|
|
905
|
+
if (rec) {
|
|
906
|
+
const list = (rec.parent) ? rec.parent.children : roots;
|
|
907
|
+
const position = list.indexOf(rec);
|
|
908
|
+
if (position !== -1) list.splice(position, 1);
|
|
909
|
+
forget(rec);
|
|
910
|
+
removeRecView(rec);
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
dropLostValue();
|
|
914
|
+
const parentRec = (entry.parent) ? recs.get(entry.parent.key) : null;
|
|
915
|
+
if (parentRec) drawRow(parentRec);
|
|
916
|
+
updateEmpty();
|
|
917
|
+
refreshScroll();
|
|
918
|
+
|
|
919
|
+
};
|
|
920
|
+
|
|
921
|
+
box.setEnabled = function (enabled) {
|
|
922
|
+
const isEnabled = (enabled) ? 1 : 0;
|
|
923
|
+
box.enabled = isEnabled;
|
|
924
|
+
box.listArea.tabIndex = (isEnabled) ? 0 : -1;
|
|
925
|
+
box.opacity = (isEnabled) ? 1 : _s.disabled.opacity;
|
|
926
|
+
box.listArea.css.pointerEvents = (isEnabled) ? "" : "none";
|
|
927
|
+
};
|
|
928
|
+
|
|
929
|
+
box.focus = function () {
|
|
930
|
+
box.listArea.elem.focus();
|
|
931
|
+
};
|
|
932
|
+
|
|
933
|
+
box.setEmptyText = function (text) {
|
|
934
|
+
box.emptyText = text;
|
|
935
|
+
box.lblEmpty.plainText = text;
|
|
936
|
+
};
|
|
937
|
+
|
|
938
|
+
// NOTE: No remove() of its own: basic.js removes the rows, the ScrollBar (a child) and their events,
|
|
939
|
+
// and stops the timer of box.after().
|
|
940
|
+
|
|
941
|
+
// *** OBJECT VIEW:
|
|
942
|
+
|
|
943
|
+
box.clipContent = 1;
|
|
944
|
+
box.border = _s.box.border;
|
|
945
|
+
box.borderColor = _s.box.borderColor;
|
|
946
|
+
box.round = _s.box.round;
|
|
947
|
+
|
|
948
|
+
// BOX: Scrolling area (it takes the focus)
|
|
949
|
+
box.listArea = startBox(0, 0, "100%", (isAutoHeight) ? "auto" : "100%", {
|
|
950
|
+
color: "transparent",
|
|
951
|
+
scrollY: (isAutoHeight) ? 0 : 1,
|
|
952
|
+
clickable: 1,
|
|
953
|
+
css: { outline: "none" },
|
|
954
|
+
tabIndex: 0,
|
|
955
|
+
role: "tree",
|
|
956
|
+
aria: { label: box.ariaLabel },
|
|
957
|
+
});
|
|
958
|
+
// WHY: With height "auto" the area must be in the flow, so the tree grows with its rows.
|
|
959
|
+
if (isAutoHeight) box.listArea.css.position = "relative";
|
|
960
|
+
|
|
961
|
+
// GROUP: Rows
|
|
962
|
+
box.list = VGroup({
|
|
963
|
+
width: "100%",
|
|
964
|
+
height: "auto",
|
|
965
|
+
align: "left top",
|
|
966
|
+
gap: 0,
|
|
967
|
+
padding: _s.box.padding,
|
|
968
|
+
color: "transparent",
|
|
969
|
+
position: "relative",
|
|
970
|
+
css: { alignItems: "stretch" },
|
|
971
|
+
});
|
|
972
|
+
endGroup();
|
|
973
|
+
|
|
974
|
+
// LABEL: Empty text
|
|
975
|
+
box.lblEmpty = Label({
|
|
976
|
+
plainText: box.emptyText,
|
|
977
|
+
width: "100%",
|
|
978
|
+
top: EMPTY_TEXT_TOP,
|
|
979
|
+
fontSize: _s.empty.fontSize,
|
|
980
|
+
textColor: _s.empty.textColor,
|
|
981
|
+
textAlign: "center",
|
|
982
|
+
visible: 0,
|
|
983
|
+
});
|
|
984
|
+
|
|
985
|
+
endBox();
|
|
986
|
+
|
|
987
|
+
if (!isAutoHeight && box.useScrollBar == 1 && typeof ScrollBar !== "undefined") {
|
|
988
|
+
const scrollBarProps = { scrollableBox: box.listArea, neverHide: 0, showDots: 0 };
|
|
989
|
+
box.scrollBar = ScrollBar(Object.assign(scrollBarProps, _s.scrollBar));
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
// *** OBJECT INIT CODE:
|
|
993
|
+
|
|
994
|
+
const repaintSelected = function () {
|
|
995
|
+
const rec = recs.get(box.value);
|
|
996
|
+
if (rec) paintRow(rec);
|
|
997
|
+
};
|
|
998
|
+
|
|
999
|
+
// EVENTS: One listener for all the rows (the rows are drawn again often).
|
|
1000
|
+
box.listArea.on("click", function (self, event) {
|
|
1001
|
+
if (box.enabled != 1) return;
|
|
1002
|
+
const rec = getRecOfEvent(event);
|
|
1003
|
+
if (!rec) return;
|
|
1004
|
+
if (isArrowEvent(event) && canExpand(rec)) {
|
|
1005
|
+
setExpanded(rec, !isOpen(rec), 1);
|
|
1006
|
+
return;
|
|
1007
|
+
}
|
|
1008
|
+
selectRec(rec, 1);
|
|
1009
|
+
});
|
|
1010
|
+
box.listArea.on("dblclick", function (self, event) {
|
|
1011
|
+
if (box.enabled != 1) return;
|
|
1012
|
+
const rec = getRecOfEvent(event);
|
|
1013
|
+
if (!rec || isArrowEvent(event) || rec.node.disabled) return;
|
|
1014
|
+
if (canExpand(rec)) setExpanded(rec, !isOpen(rec), 1);
|
|
1015
|
+
activateRec(rec);
|
|
1016
|
+
});
|
|
1017
|
+
box.listArea.on("mousemove", function (self, event) {
|
|
1018
|
+
if (box.enabled != 1) return;
|
|
1019
|
+
setHover(getRecOfEvent(event));
|
|
1020
|
+
});
|
|
1021
|
+
box.listArea.on("mouseleave", function () { setHover(null); });
|
|
1022
|
+
box.listArea.on("keydown", function (self, event) { onKeyDown(event); });
|
|
1023
|
+
box.listArea.on("focus", function () {
|
|
1024
|
+
hasFocus = 1;
|
|
1025
|
+
repaintSelected();
|
|
1026
|
+
});
|
|
1027
|
+
box.listArea.on("blur", function () {
|
|
1028
|
+
hasFocus = 0;
|
|
1029
|
+
repaintSelected();
|
|
1030
|
+
});
|
|
1031
|
+
|
|
1032
|
+
box.setItems(startItems, startValue);
|
|
1033
|
+
if (box.enabled != 1) box.setEnabled(0);
|
|
1034
|
+
|
|
1035
|
+
return endObject(box);
|
|
1036
|
+
|
|
1037
|
+
};
|
|
1038
|
+
|
|
1039
|
+
TreeView._counter = 1;
|
|
1040
|
+
|
|
1041
|
+
// A key -> a safe part of an id.
|
|
1042
|
+
TreeView.toId = function (key) {
|
|
1043
|
+
return String(key).replace(/[^A-Za-z0-9_-]/g, function (c) { return "_" + c.charCodeAt(0).toString(16); });
|
|
1044
|
+
};
|
|
1045
|
+
|
|
1046
|
+
// A small right arrow (rotated 90° when the node is open).
|
|
1047
|
+
TreeView.getChevronSvg = function (color, size) {
|
|
1048
|
+
return '<svg xmlns="http://www.w3.org/2000/svg" width="' + size + '" height="' + size + '" viewBox="0 0 12 12"' +
|
|
1049
|
+
' fill="none" stroke="' + color + '" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" style="display:block">' +
|
|
1050
|
+
'<path d="M4.5 2.5 8 6l-3.5 3.5"/></svg>';
|
|
1051
|
+
};
|
|
1052
|
+
|
|
1053
|
+
// *** STYLE PACKAGES:
|
|
1054
|
+
// USAGE: TreeView({ styleName: "modern" })
|
|
1055
|
+
// USAGE: TreeView({ styleName: "dark", style: { rowSelected: { color: "#3D3D3D" } } }) // Change only some keys.
|
|
1056
|
+
// USAGE: TreeView({ style: TreeView.styles.dark }) // The same as styleName: "dark". (The package is copied, never changed.)
|
|
1057
|
+
// NOTE: A new package needs only the keys that differ from the default (classic) style.
|
|
1058
|
+
// USAGE: TreeView.styles.myStyle = { tag: { textColor: "red" } };
|
|
1059
|
+
TreeView.styles = {
|
|
1060
|
+
|
|
1061
|
+
// Dark text, gray hover and selection on a light page.
|
|
1062
|
+
classic: TreeViewDefaults.style,
|
|
1063
|
+
|
|
1064
|
+
// Cadetblue, same colors as the modern Tabs, CheckBox, RadioButton and TagInput.
|
|
1065
|
+
modern: {
|
|
1066
|
+
box: { color: "transparent", border: 0, borderColor: "transparent", round: 0, padding: [6, 6] },
|
|
1067
|
+
row: { height: 32, fontSize: 14, textColor: Black(0.75), indent: 18, paddingLeft: 6, paddingRight: 10, gap: 8, round: 100 },
|
|
1068
|
+
rowHover: { color: "#EEF5F5" },
|
|
1069
|
+
rowSelected: { color: "#DFECEC", textColor: "#2F5F61" },
|
|
1070
|
+
rowFocus: { outlineColor: "cadetblue" },
|
|
1071
|
+
arrow: { color: "cadetblue", size: 12, motion: 0.15 },
|
|
1072
|
+
icon: { size: 16 },
|
|
1073
|
+
tag: { textColor: "cadetblue", fontSize: 12 },
|
|
1074
|
+
note: { textColor: Black(0.4), fontSize: 12 },
|
|
1075
|
+
disabled: { opacity: 0.4 },
|
|
1076
|
+
empty: { textColor: Black(0.4), fontSize: 14 },
|
|
1077
|
+
scrollBar: { bar_color: "#9A9A98", bar_mouseOverColor: "#6A6A68", bar_width: 4, bar_round: 3, bar_opacity: 0.4, bar_mouseOverOpacity: 0.9, bar_padding: 2 },
|
|
1078
|
+
},
|
|
1079
|
+
|
|
1080
|
+
// Dark theme, same colors as PropertyPanel (the layers of a design tool).
|
|
1081
|
+
dark: {
|
|
1082
|
+
box: { color: "#2C2C2C", border: 0, borderColor: "transparent", round: 0, padding: [4, 4] },
|
|
1083
|
+
row: { height: 24, fontSize: 12, textColor: "#E6E6E6", indent: 12, paddingLeft: 2, paddingRight: 8, gap: 6, round: 4 },
|
|
1084
|
+
rowHover: { color: "#383838" },
|
|
1085
|
+
rowSelected: { color: "#34435A", textColor: "#FFFFFF" },
|
|
1086
|
+
rowFocus: { outlineColor: "#0C8CE9" },
|
|
1087
|
+
arrow: { color: "#A5A5A5", size: 10, motion: 0.12 },
|
|
1088
|
+
icon: { size: 14 },
|
|
1089
|
+
tag: { textColor: "#A5A5A5", fontSize: 12 },
|
|
1090
|
+
note: { textColor: "#6E6E6E", fontSize: 12 },
|
|
1091
|
+
disabled: { opacity: 0.4 },
|
|
1092
|
+
empty: { textColor: "#6E6E6E", fontSize: 12 },
|
|
1093
|
+
scrollBar: { bar_color: "#8A8A88", bar_mouseOverColor: "#BFBFBD", bar_width: 4, bar_round: 3, bar_opacity: 0.4, bar_mouseOverOpacity: 0.9, bar_padding: 2 },
|
|
1094
|
+
},
|
|
1095
|
+
|
|
1096
|
+
};
|