create-basicjs 0.0.1 → 0.1.1
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 +27 -2
- package/bin/create-basicjs.js +104 -1
- package/bin/verify-package.js +16 -0
- package/package.json +27 -6
- package/payload/starter/AGENTS.md +82 -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 +318 -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 +26 -0
- package/payload/templates/panel/module10/greenhouse.htm +1361 -0
- package/payload/templates/panel/module11/arduino-projects.htm +1124 -0
- package/payload/templates/panel/module2/empty-full.htm +26 -0
- package/payload/templates/panel/module3/empty-right.htm +26 -0
- package/payload/templates/panel/module4/empty-main-topbar.htm +26 -0
- package/payload/templates/panel/module5/empty-right-topbar.htm +26 -0
- package/payload/templates/panel/module6/energy-hub.htm +1507 -0
- package/payload/templates/panel/module7/3d-printers.htm +1258 -0
- package/payload/templates/panel/module8/cold-rooms.htm +1250 -0
- package/payload/templates/panel/module9/elevator-fleet.htm +1488 -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,1138 @@
|
|
|
1
|
+
/* Bismillah */
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
|
|
5
|
+
Reports Page (Sales Report Template) - v26.09
|
|
6
|
+
|
|
7
|
+
- A sample report page for the admin panel: filters, summary, charts and a detail table.
|
|
8
|
+
- Test data: 2 years of daily sales (5 categories x 4 regions). It is created one time with a fixed seed,
|
|
9
|
+
so the numbers are the same every time.
|
|
10
|
+
- Replace ReportsPage.getTestData() and buildReport() with your service (Supabase, SQL view, API...) calls.
|
|
11
|
+
|
|
12
|
+
COMPONENTS:
|
|
13
|
+
- Tabs (comp-m4): Quick date ranges
|
|
14
|
+
- SelectDate (comp-m4): Date range
|
|
15
|
+
- TinySelect (comp-m2): Region and group by
|
|
16
|
+
- CheckBox (comp-m3): Compare with the previous period
|
|
17
|
+
- SmartButton (comp-m4) + ContextMenu (comp-m4): Export menu
|
|
18
|
+
- MiniGraphBox / SparkLineBox (comp-m4): Summary boxes (bars for counts, a line for money and rates)
|
|
19
|
+
- ChartBox (comp-m4): Revenue, regions, orders by category, refund rates
|
|
20
|
+
- SmartTable (comp-m3): Report details (sort, filter)
|
|
21
|
+
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
ReportsPageDefaults = {
|
|
25
|
+
color: "transparent",
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const ReportsPage = function(params = {}) {
|
|
29
|
+
|
|
30
|
+
// BOX: Page container
|
|
31
|
+
let box = startPage(params, ReportsPageDefaults, mainView);
|
|
32
|
+
|
|
33
|
+
mainView.setKey(ReportsPage.KEY);
|
|
34
|
+
|
|
35
|
+
// *** PRIVATE VARIABLES:
|
|
36
|
+
|
|
37
|
+
const ASSETS = "assets/";
|
|
38
|
+
const LIB_PATH = "_basic/";
|
|
39
|
+
|
|
40
|
+
const CARD_COLOR = T.surface; // Same with ChartBox dark theme background
|
|
41
|
+
const CARD_BORDER_COLOR = Ink(0.1);
|
|
42
|
+
const FIELD_COLOR = T.surface2;
|
|
43
|
+
const PRIMARY_COLOR = T.primary;
|
|
44
|
+
const ACCENT_COLOR = T.accent;
|
|
45
|
+
const PREVIOUS_COLOR = "#898781";
|
|
46
|
+
const GOOD_COLOR = ACCENT_COLOR;
|
|
47
|
+
const BAD_COLOR = T.danger;
|
|
48
|
+
// One color for each category (same order with CATEGORIES)
|
|
49
|
+
const CATEGORY_COLORS = [ACCENT_COLOR, T.info, T.warning, "#D55181", "#9085E9"];
|
|
50
|
+
|
|
51
|
+
const CATEGORIES = ReportsPage.CATEGORIES;
|
|
52
|
+
const REGIONS = ReportsPage.REGIONS;
|
|
53
|
+
const HIGH_REFUND_RATE = 8; // %: Shown in red in the table
|
|
54
|
+
|
|
55
|
+
const GROUPS = [
|
|
56
|
+
{ id: "day", label: "Day" },
|
|
57
|
+
{ id: "week", label: "Week" },
|
|
58
|
+
{ id: "month", label: "Month" },
|
|
59
|
+
];
|
|
60
|
+
|
|
61
|
+
const QUICK_RANGES = [
|
|
62
|
+
{ text: "7 Days", days: 7, group: "day" },
|
|
63
|
+
{ text: "30 Days", days: 30, group: "day" },
|
|
64
|
+
{ text: "90 Days", days: 90, group: "week" },
|
|
65
|
+
{ text: "This Year", days: 0, group: "month" }, // 0: From January 1
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
const DEFAULT_RANGE_INDEX = 1;
|
|
69
|
+
|
|
70
|
+
const today = ReportsPage.startOfDay(new Date());
|
|
71
|
+
// WHY: The previous period of the oldest selectable date must have data too.
|
|
72
|
+
const minSelectableDate = ReportsPage.addDays(today, -365);
|
|
73
|
+
|
|
74
|
+
// Current filter
|
|
75
|
+
const filter = {
|
|
76
|
+
from: null,
|
|
77
|
+
to: null,
|
|
78
|
+
regionIndex: -1, // -1: All regions
|
|
79
|
+
group: "day",
|
|
80
|
+
compare: 1,
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
let isReady = 0;
|
|
84
|
+
let reportTimer = null;
|
|
85
|
+
|
|
86
|
+
// Components
|
|
87
|
+
let quickTabs, fromDate, toDate, regionSelect, groupSelect, compareCheckBox;
|
|
88
|
+
let exportMenu;
|
|
89
|
+
let lblSubtitle, lblTableInfo;
|
|
90
|
+
let kpiBoxList = [];
|
|
91
|
+
let chartRevenue, chartRegion, chartCategory, chartRefund;
|
|
92
|
+
let smartTable;
|
|
93
|
+
|
|
94
|
+
// *** PRIVATE FUNCTIONS:
|
|
95
|
+
|
|
96
|
+
const compactNumber = new Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: 1 });
|
|
97
|
+
|
|
98
|
+
const formatMoneyShort = function(value) {
|
|
99
|
+
return "$" + compactNumber.format(value);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const formatMoney = function(value, digits = 0) {
|
|
103
|
+
return "$" + value.toLocaleString("en-US", { minimumFractionDigits: digits, maximumFractionDigits: digits });
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const formatDate = function(date) {
|
|
107
|
+
return date.toLocaleDateString("en-GB", { day: "numeric", month: "short", year: "numeric" }); // 16 Sep 2026
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
// "Revenue ▲ 12.4%" (higherIsBetter: 0 for refund rate)
|
|
111
|
+
const getChangeText = function(current, previous, higherIsBetter = 1) {
|
|
112
|
+
if (!previous) return "";
|
|
113
|
+
const change = (current - previous) / previous * 100;
|
|
114
|
+
const isUp = change >= 0;
|
|
115
|
+
const color = (isUp == (higherIsBetter == 1)) ? GOOD_COLOR : BAD_COLOR;
|
|
116
|
+
return " <span style='color:" + color + "'>" + ((isUp) ? "▲ " : "▼ ") + Math.abs(change).toFixed(1) + "%</span>";
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// *** REPORT (DATA):
|
|
120
|
+
|
|
121
|
+
// Period of a day: { key, label }. Keys are sortable texts.
|
|
122
|
+
const getPeriod = function(date, group) {
|
|
123
|
+
|
|
124
|
+
if (group == "week") {
|
|
125
|
+
// WHY: Weeks start on Monday.
|
|
126
|
+
const monday = ReportsPage.addDays(date, -((date.getDay() + 6) % 7));
|
|
127
|
+
return { key: ReportsPage.toISODate(monday), label: monday.toLocaleDateString("en-GB", { day: "numeric", month: "short" }) };
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (group == "month") {
|
|
131
|
+
return { key: ReportsPage.toISODate(date).slice(0, 7), label: date.toLocaleDateString("en-GB", { month: "short", year: "2-digit" }) };
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return { key: ReportsPage.toISODate(date), label: date.toLocaleDateString("en-GB", { day: "numeric", month: "short" }) };
|
|
135
|
+
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
// Sums the records of a date range. (Region filter is used, except byRegion.)
|
|
139
|
+
const buildReport = function(from, to, regionIndex, group) {
|
|
140
|
+
|
|
141
|
+
const report = {
|
|
142
|
+
periods: [], // [{ key, label }]
|
|
143
|
+
total: { orders: 0, revenue: 0, refunds: 0 },
|
|
144
|
+
series: { orders: [], revenue: [], refunds: [] }, // One value for each period
|
|
145
|
+
categories: CATEGORIES.map(function() { return { orders: [], total: { orders: 0, revenue: 0, refunds: 0 } }; }),
|
|
146
|
+
byRegion: REGIONS.map(function() { return 0; }), // Revenue of each region (all regions)
|
|
147
|
+
rows: [], // Table rows: one for each period and category
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
// Periods of the range (also the periods without data)
|
|
151
|
+
const periodIndexByTime = new Map();
|
|
152
|
+
for (let date = new Date(from); date <= to; date = ReportsPage.addDays(date, 1)) {
|
|
153
|
+
const period = getPeriod(date, group);
|
|
154
|
+
const last = report.periods[report.periods.length - 1];
|
|
155
|
+
if (!last || last.key != period.key) report.periods.push(period);
|
|
156
|
+
periodIndexByTime.set(date.getTime(), report.periods.length - 1);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const periodCount = report.periods.length;
|
|
160
|
+
["orders", "revenue", "refunds"].forEach(function(key) {
|
|
161
|
+
report.series[key] = new Array(periodCount).fill(0);
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
// [periodIndex][categoryIndex] -> { orders, revenue, refunds }
|
|
165
|
+
const cells = report.periods.map(function() {
|
|
166
|
+
return CATEGORIES.map(function() { return { orders: 0, revenue: 0, refunds: 0 }; });
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
ReportsPage.getTestData().forEach(function(record) {
|
|
170
|
+
|
|
171
|
+
const periodIndex = periodIndexByTime.get(record.time);
|
|
172
|
+
if (periodIndex === undefined) return; // Out of the range
|
|
173
|
+
|
|
174
|
+
report.byRegion[record.region] += record.revenue;
|
|
175
|
+
if (regionIndex >= 0 && record.region != regionIndex) return;
|
|
176
|
+
|
|
177
|
+
const cell = cells[periodIndex][record.category];
|
|
178
|
+
const category = report.categories[record.category];
|
|
179
|
+
|
|
180
|
+
["orders", "revenue", "refunds"].forEach(function(key) {
|
|
181
|
+
cell[key] += record[key];
|
|
182
|
+
category.total[key] += record[key];
|
|
183
|
+
report.total[key] += record[key];
|
|
184
|
+
report.series[key][periodIndex] += record[key];
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
report.categories.forEach(function(category, categoryIndex) {
|
|
190
|
+
category.orders = cells.map(function(periodCells) { return periodCells[categoryIndex].orders; });
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
cells.forEach(function(periodCells, periodIndex) {
|
|
194
|
+
periodCells.forEach(function(cell, categoryIndex) {
|
|
195
|
+
report.rows.push({
|
|
196
|
+
period: report.periods[periodIndex].key,
|
|
197
|
+
category: CATEGORIES[categoryIndex].name,
|
|
198
|
+
orders: cell.orders,
|
|
199
|
+
revenue: Math.round(cell.revenue * 100) / 100,
|
|
200
|
+
avgOrder: (cell.orders) ? Math.round(cell.revenue / cell.orders * 100) / 100 : 0,
|
|
201
|
+
refunds: cell.refunds,
|
|
202
|
+
refundRate: (cell.orders) ? Math.round(cell.refunds / cell.orders * 1000) / 10 : 0,
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
return report;
|
|
208
|
+
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
// Current and previous period reports
|
|
212
|
+
const runReport = function() {
|
|
213
|
+
|
|
214
|
+
const days = Math.round((filter.to - filter.from) / 86400000) + 1;
|
|
215
|
+
const previousTo = ReportsPage.addDays(filter.from, -1);
|
|
216
|
+
const previousFrom = ReportsPage.addDays(filter.from, -days);
|
|
217
|
+
|
|
218
|
+
const current = buildReport(filter.from, filter.to, filter.regionIndex, filter.group);
|
|
219
|
+
const previous = buildReport(previousFrom, previousTo, filter.regionIndex, filter.group);
|
|
220
|
+
|
|
221
|
+
renderReport(current, previous, previousFrom, previousTo);
|
|
222
|
+
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
// Waits for more filter changes, then runs the report.
|
|
226
|
+
const scheduleReport = function() {
|
|
227
|
+
|
|
228
|
+
if (!isReady) return;
|
|
229
|
+
|
|
230
|
+
reportTimer = waitAndRun(reportTimer, function() {
|
|
231
|
+
if (!box) return;
|
|
232
|
+
runReport();
|
|
233
|
+
}, 50);
|
|
234
|
+
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
// *** RENDER:
|
|
238
|
+
|
|
239
|
+
const renderReport = function(report, previous, previousFrom, previousTo) {
|
|
240
|
+
|
|
241
|
+
const regionText = (filter.regionIndex < 0) ? "All regions" : REGIONS[filter.regionIndex].name;
|
|
242
|
+
const groupText = GROUPS.find(function(g) { return g.id == filter.group; }).label;
|
|
243
|
+
lblSubtitle.text = formatDate(filter.from) + " – " + formatDate(filter.to) + " · " + regionText + " · by " + groupText.toLowerCase();
|
|
244
|
+
|
|
245
|
+
// SUMMARY
|
|
246
|
+
const t = report.total;
|
|
247
|
+
const p = previous.total;
|
|
248
|
+
const aov = (t.orders) ? t.revenue / t.orders : 0;
|
|
249
|
+
const previousAov = (p.orders) ? p.revenue / p.orders : 0;
|
|
250
|
+
const refundRate = (t.orders) ? t.refunds / t.orders * 100 : 0;
|
|
251
|
+
const previousRefundRate = (p.orders) ? p.refunds / p.orders * 100 : 0;
|
|
252
|
+
|
|
253
|
+
const kpiTexts = [
|
|
254
|
+
{ title: "Revenue" + getChangeText(t.revenue, p.revenue), value: formatMoneyShort(t.revenue) },
|
|
255
|
+
{ title: "Orders" + getChangeText(t.orders, p.orders), value: t.orders.toLocaleString("en-US") },
|
|
256
|
+
{ title: "Avg. Order Value" + getChangeText(aov, previousAov), value: formatMoney(aov, 2) },
|
|
257
|
+
{ title: "Refund Rate" + getChangeText(refundRate, previousRefundRate, 0), value: refundRate.toFixed(1) + "%" },
|
|
258
|
+
];
|
|
259
|
+
|
|
260
|
+
const kpiSeries = [
|
|
261
|
+
report.series.revenue,
|
|
262
|
+
report.series.orders,
|
|
263
|
+
report.series.revenue.map(function(revenue, i) { return (report.series.orders[i]) ? revenue / report.series.orders[i] : 0; }),
|
|
264
|
+
report.series.refunds.map(function(refunds, i) { return (report.series.orders[i]) ? refunds / report.series.orders[i] * 100 : 0; }),
|
|
265
|
+
];
|
|
266
|
+
|
|
267
|
+
kpiBoxList.forEach(function(kpiBox, i) {
|
|
268
|
+
kpiBox.setTitle(kpiTexts[i].title);
|
|
269
|
+
kpiBox.setValueText(kpiTexts[i].value);
|
|
270
|
+
kpiBox.setValues(kpiSeries[i]);
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
// REVENUE: Current and previous period
|
|
274
|
+
// WHY: Datasets are not created again. So they keep their colors and options.
|
|
275
|
+
const labels = report.periods.map(function(period) { return period.label; });
|
|
276
|
+
const previousRevenue = labels.map(function(label, i) { return previous.series.revenue[i] ?? null; });
|
|
277
|
+
|
|
278
|
+
chartRevenue.data.labels = labels;
|
|
279
|
+
chartRevenue.data.datasets[0].data = report.series.revenue.map(Math.round);
|
|
280
|
+
chartRevenue.data.datasets[1].data = previousRevenue.map(function(value) { return (value === null) ? null : Math.round(value); });
|
|
281
|
+
chartRevenue.data.datasets[1].label = "Previous (" + formatDate(previousFrom) + " – " + formatDate(previousTo) + ")";
|
|
282
|
+
chartRevenue.data.datasets[1].hidden = !filter.compare;
|
|
283
|
+
if (chartRevenue.chart) chartRevenue.chart.setDatasetVisibility(1, filter.compare == 1); // WHY: After a legend click, Chart.js does not read dataset.hidden.
|
|
284
|
+
chartRevenue.update();
|
|
285
|
+
|
|
286
|
+
// REGIONS
|
|
287
|
+
chartRegion.data.datasets[0].data = report.byRegion.map(Math.round);
|
|
288
|
+
chartRegion.update();
|
|
289
|
+
|
|
290
|
+
// ORDERS BY CATEGORY
|
|
291
|
+
chartCategory.data.labels = labels;
|
|
292
|
+
report.categories.forEach(function(category, i) {
|
|
293
|
+
chartCategory.data.datasets[i].data = category.orders;
|
|
294
|
+
});
|
|
295
|
+
chartCategory.update();
|
|
296
|
+
|
|
297
|
+
// REFUND RATES
|
|
298
|
+
chartRefund.data.datasets[0].data = report.categories.map(function(category) {
|
|
299
|
+
const c = category.total;
|
|
300
|
+
return (c.orders) ? Math.round(c.refunds / c.orders * 1000) / 10 : 0;
|
|
301
|
+
});
|
|
302
|
+
chartRefund.update();
|
|
303
|
+
|
|
304
|
+
// TABLE
|
|
305
|
+
smartTable.setItemDataList(report.rows);
|
|
306
|
+
lblTableInfo.text = report.rows.length.toLocaleString("en-US") + " rows (" + report.periods.length + " periods x " + CATEGORIES.length + " categories). Click a column title to sort.";
|
|
307
|
+
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
const setDateRange = function(from, to) {
|
|
311
|
+
|
|
312
|
+
filter.from = from;
|
|
313
|
+
filter.to = to;
|
|
314
|
+
|
|
315
|
+
// WHY: setDate() does not accept a date out of min/max. Open the limits first.
|
|
316
|
+
fromDate.setMaxDate(today);
|
|
317
|
+
toDate.setMinDate(minSelectableDate);
|
|
318
|
+
fromDate.setDate(from, 1);
|
|
319
|
+
toDate.setDate(to, 1);
|
|
320
|
+
fromDate.setMaxDate(to);
|
|
321
|
+
toDate.setMinDate(from);
|
|
322
|
+
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
const selectQuickRange = function(index) {
|
|
326
|
+
|
|
327
|
+
const range = QUICK_RANGES[index];
|
|
328
|
+
const from = (range.days) ? ReportsPage.addDays(today, -(range.days - 1)) : new Date(today.getFullYear(), 0, 1);
|
|
329
|
+
|
|
330
|
+
setDateRange(from, today);
|
|
331
|
+
|
|
332
|
+
// Group select calls scheduleReport() with onSelect.
|
|
333
|
+
filter.group = range.group;
|
|
334
|
+
groupSelect.setSelectedIndex(GROUPS.findIndex(function(g) { return g.id == range.group; }));
|
|
335
|
+
|
|
336
|
+
scheduleReport();
|
|
337
|
+
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
// Dates are changed by hand: no quick range is selected.
|
|
341
|
+
const clearQuickRange = function() {
|
|
342
|
+
if (quickTabs.value === null) return;
|
|
343
|
+
// WHY: Tabs always has an active tab; with no value it shows none (and every tab can be clicked).
|
|
344
|
+
quickTabs.value = null;
|
|
345
|
+
quickTabs.refresh();
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
const downloadTableAsCSV = function() {
|
|
349
|
+
|
|
350
|
+
const lines = ["period,category,orders,revenue,avg_order,refunds,refund_rate"];
|
|
351
|
+
smartTable.visibleItemDataList.forEach(function(row) {
|
|
352
|
+
lines.push([row.period, row.category, row.orders, row.revenue, row.avgOrder, row.refunds, row.refundRate].join(","));
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
const link = document.createElement("a");
|
|
356
|
+
link.href = URL.createObjectURL(new Blob([lines.join("\n")], { type: "text/csv" }));
|
|
357
|
+
link.download = "sales-report-" + ReportsPage.toISODate(filter.from) + "_" + ReportsPage.toISODate(filter.to) + ".csv";
|
|
358
|
+
link.click();
|
|
359
|
+
URL.revokeObjectURL(link.href);
|
|
360
|
+
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
// *** VIEW HELPERS:
|
|
364
|
+
|
|
365
|
+
// GROUP: Cards side by side (wraps on small screens)
|
|
366
|
+
const startRow = function() {
|
|
367
|
+
HGroup({
|
|
368
|
+
width: "100%",
|
|
369
|
+
height: "auto",
|
|
370
|
+
align: "left top",
|
|
371
|
+
gap: 16,
|
|
372
|
+
});
|
|
373
|
+
that.elem.style.flexWrap = "wrap";
|
|
374
|
+
that.elem.style.alignItems = "stretch"; // WHY: Cards in the same row have the same height.
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
// flex: "1 1 320px" (grow, shrink, min width before wrap)
|
|
378
|
+
const setFlex = function(obj, flex) {
|
|
379
|
+
obj.elem.style.flex = flex;
|
|
380
|
+
obj.elem.style.minWidth = "0";
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
const startCard = function(title, subtitle, flex) {
|
|
384
|
+
|
|
385
|
+
const card = VGroup({
|
|
386
|
+
height: "auto",
|
|
387
|
+
align: "left top",
|
|
388
|
+
gap: 14,
|
|
389
|
+
padding: 16,
|
|
390
|
+
color: CARD_COLOR,
|
|
391
|
+
border: 1,
|
|
392
|
+
borderColor: CARD_BORDER_COLOR,
|
|
393
|
+
round: 12,
|
|
394
|
+
});
|
|
395
|
+
setFlex(card, flex);
|
|
396
|
+
|
|
397
|
+
VGroup({ width: "100%", height: "auto", align: "left top", gap: 0 });
|
|
398
|
+
|
|
399
|
+
Label({
|
|
400
|
+
text: title,
|
|
401
|
+
fontSize: 16,
|
|
402
|
+
textColor: Ink(0.95),
|
|
403
|
+
});
|
|
404
|
+
that.elem.style.fontFamily = "opensans-bold";
|
|
405
|
+
|
|
406
|
+
card.lblSubtitle = Label({
|
|
407
|
+
text: subtitle,
|
|
408
|
+
fontSize: 12,
|
|
409
|
+
textColor: Ink(0.45),
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
endGroup();
|
|
413
|
+
|
|
414
|
+
return card;
|
|
415
|
+
|
|
416
|
+
};
|
|
417
|
+
|
|
418
|
+
const endCard = function() {
|
|
419
|
+
endGroup();
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
const createChartBox = function(flex, params) {
|
|
423
|
+
|
|
424
|
+
const chart = ChartBox({
|
|
425
|
+
theme: T.chartTheme,
|
|
426
|
+
style: {
|
|
427
|
+
box: { color: CARD_COLOR, borderColor: CARD_BORDER_COLOR, round: 12, padding: 16 },
|
|
428
|
+
chart: { colors: CATEGORY_COLORS },
|
|
429
|
+
},
|
|
430
|
+
...params,
|
|
431
|
+
});
|
|
432
|
+
setFlex(chart, flex);
|
|
433
|
+
// WHY: The chart gets the row height, if a card in the same row is taller.
|
|
434
|
+
chart.elem.style.height = "auto";
|
|
435
|
+
chart.elem.style.minHeight = params.height + "px";
|
|
436
|
+
|
|
437
|
+
return chart;
|
|
438
|
+
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
// GROUP: Small title and a field
|
|
442
|
+
const startField = function(title) {
|
|
443
|
+
VGroup({ width: "auto", height: "auto", align: "left top", gap: 6 });
|
|
444
|
+
Label({ text: title.toUpperCase(), fontSize: 11, textColor: Ink(0.45) });
|
|
445
|
+
that.elem.style.letterSpacing = "1px";
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
const endField = function() {
|
|
449
|
+
endGroup();
|
|
450
|
+
};
|
|
451
|
+
|
|
452
|
+
// Dark style for SelectDate
|
|
453
|
+
const DATE_STYLE = {
|
|
454
|
+
field: { color: FIELD_COLOR, border: 1, borderColor: CARD_BORDER_COLOR, round: 8 },
|
|
455
|
+
fieldHover: { borderColor: Ink(0.3) },
|
|
456
|
+
fieldFocus: { borderColor: ACCENT_COLOR },
|
|
457
|
+
fieldText: { fontSize: 14, textColor: Ink(0.9) },
|
|
458
|
+
placeholder: { textColor: Ink(0.4) },
|
|
459
|
+
icon: { color: Ink(0.55) },
|
|
460
|
+
panel: { color: FIELD_COLOR, borderColor: Ink(0.12), shadow: "0 8px 24px " + Black(0.5) },
|
|
461
|
+
title: { textColor: Ink(0.9) },
|
|
462
|
+
arrow: { color: Ink(0.6), hoverColor: Ink(0.08) },
|
|
463
|
+
weekDay: { textColor: Ink(0.45) },
|
|
464
|
+
day: { textColor: Ink(0.85), hoverColor: Ink(0.08) },
|
|
465
|
+
today: { borderColor: Ink(0.35) },
|
|
466
|
+
selectedDay: { color: PRIMARY_COLOR, textColor: Ink(1) },
|
|
467
|
+
disabledDay: { textColor: Ink(0.2) },
|
|
468
|
+
footerButton: { textColor: ACCENT_COLOR },
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
const createTinySelect = function(list, onSelect) {
|
|
472
|
+
|
|
473
|
+
const select = TinySelect({
|
|
474
|
+
list: list,
|
|
475
|
+
height: 40,
|
|
476
|
+
fontSize: 14,
|
|
477
|
+
color: FIELD_COLOR,
|
|
478
|
+
border: 1,
|
|
479
|
+
borderColor: CARD_BORDER_COLOR,
|
|
480
|
+
round: 8,
|
|
481
|
+
labelBoldFont: 0,
|
|
482
|
+
labelTextColor: Ink(0.9),
|
|
483
|
+
arrowIcon: LIB_PATH + "comp/tiny-select/arrow.svg",
|
|
484
|
+
arrowSize: 18,
|
|
485
|
+
invertIconColor: T.invertIcon,
|
|
486
|
+
listFontSize: 14,
|
|
487
|
+
listTextColor: Ink(0.85),
|
|
488
|
+
listOverTextColor: ACCENT_COLOR,
|
|
489
|
+
listBackgroundColor: FIELD_COLOR,
|
|
490
|
+
listBorderColor: Ink(0.15),
|
|
491
|
+
onSelect: onSelect,
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
return select;
|
|
495
|
+
|
|
496
|
+
};
|
|
497
|
+
|
|
498
|
+
// *** PUBLIC FUNCTIONS:
|
|
499
|
+
|
|
500
|
+
box.destroy = function() {
|
|
501
|
+
|
|
502
|
+
clearTimeout(reportTimer);
|
|
503
|
+
|
|
504
|
+
// WHY: ChartBox keeps a Chart.js instance with resize listeners. remove() cleans it.
|
|
505
|
+
[chartRevenue, chartRegion, chartCategory, chartRefund].forEach(function(chart) {
|
|
506
|
+
if (chart) chart.remove();
|
|
507
|
+
});
|
|
508
|
+
|
|
509
|
+
// WHY: These components have objects or events on the page. box.remove() does not remove them.
|
|
510
|
+
if (smartTable) smartTable.remove();
|
|
511
|
+
if (exportMenu) exportMenu.remove();
|
|
512
|
+
if (fromDate) fromDate.remove();
|
|
513
|
+
if (toDate) toDate.remove();
|
|
514
|
+
|
|
515
|
+
box.remove();
|
|
516
|
+
box = null;
|
|
517
|
+
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
// *** PAGE VIEW:
|
|
521
|
+
|
|
522
|
+
const initHeader = function() {
|
|
523
|
+
|
|
524
|
+
HGroup({ width: "100%", height: "auto", align: "left center", gap: 16 });
|
|
525
|
+
that.elem.style.flexWrap = "wrap";
|
|
526
|
+
that.elem.style.justifyContent = "space-between";
|
|
527
|
+
|
|
528
|
+
VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
|
|
529
|
+
|
|
530
|
+
Label({
|
|
531
|
+
text: "Sales Report",
|
|
532
|
+
fontSize: 26,
|
|
533
|
+
textColor: Ink(0.95),
|
|
534
|
+
});
|
|
535
|
+
that.elem.style.fontFamily = "opensans-bold";
|
|
536
|
+
|
|
537
|
+
lblSubtitle = Label({
|
|
538
|
+
text: "",
|
|
539
|
+
fontSize: 14,
|
|
540
|
+
textColor: Ink(0.5),
|
|
541
|
+
});
|
|
542
|
+
|
|
543
|
+
endGroup();
|
|
544
|
+
|
|
545
|
+
HGroup({ width: "auto", height: "auto", align: "right center", gap: 10 });
|
|
546
|
+
|
|
547
|
+
const btnExport = SmartButton({
|
|
548
|
+
styleName: "classic",
|
|
549
|
+
labelText: "Export",
|
|
550
|
+
iconFile: ASSETS + "arrow_down.png",
|
|
551
|
+
style: {
|
|
552
|
+
layout: { gap: 10, padding: [14, 8] },
|
|
553
|
+
icon: { width: 20, height: 20 },
|
|
554
|
+
label: { fontSize: 14, textColor: Ink(0.95) },
|
|
555
|
+
box: { color: PRIMARY_COLOR, border: 1, borderColor: CARD_BORDER_COLOR, round: 8 },
|
|
556
|
+
hover: { color: T.primaryHover },
|
|
557
|
+
active: { color: T.primaryActive },
|
|
558
|
+
},
|
|
559
|
+
});
|
|
560
|
+
btnExport.icon.elem.style.filter = T.iconFilter; // WHY: Panel icons are black.
|
|
561
|
+
|
|
562
|
+
// MENU: Export
|
|
563
|
+
exportMenu = ContextMenu({
|
|
564
|
+
items: [
|
|
565
|
+
{ text: "Table as CSV", key: "csv" },
|
|
566
|
+
"-",
|
|
567
|
+
{ text: "Revenue chart (PNG)", key: "revenue" },
|
|
568
|
+
{ text: "Orders chart (PNG)", key: "orders" },
|
|
569
|
+
{ text: "Refund chart (PNG)", key: "refund" },
|
|
570
|
+
],
|
|
571
|
+
onClick: function(self, item) {
|
|
572
|
+
const dates = ReportsPage.toISODate(filter.from) + "_" + ReportsPage.toISODate(filter.to);
|
|
573
|
+
switch (item.key) {
|
|
574
|
+
case "csv": downloadTableAsCSV(); break;
|
|
575
|
+
case "revenue": chartRevenue.download("revenue-" + dates + ".png"); break;
|
|
576
|
+
case "orders": chartCategory.download("orders-by-category-" + dates + ".png"); break;
|
|
577
|
+
case "refund": chartRefund.download("refund-rates-" + dates + ".png"); break;
|
|
578
|
+
}
|
|
579
|
+
},
|
|
580
|
+
style: {
|
|
581
|
+
menu: { color: FIELD_COLOR, borderColor: Ink(0.12), shadow: "0px 8px 24px " + Black(0.5) },
|
|
582
|
+
item: { textColor: Ink(0.85) },
|
|
583
|
+
itemHover: { textColor: Ink(1), color: Ink(0.08) },
|
|
584
|
+
separator: { color: Ink(0.1) },
|
|
585
|
+
},
|
|
586
|
+
});
|
|
587
|
+
exportMenu.attachTo(btnExport, "click");
|
|
588
|
+
|
|
589
|
+
endGroup();
|
|
590
|
+
|
|
591
|
+
endGroup();
|
|
592
|
+
|
|
593
|
+
};
|
|
594
|
+
|
|
595
|
+
const initFilterBar = function() {
|
|
596
|
+
|
|
597
|
+
const card = VGroup({
|
|
598
|
+
width: "100%",
|
|
599
|
+
height: "auto",
|
|
600
|
+
align: "left top",
|
|
601
|
+
padding: 16,
|
|
602
|
+
color: CARD_COLOR,
|
|
603
|
+
border: 1,
|
|
604
|
+
borderColor: CARD_BORDER_COLOR,
|
|
605
|
+
round: 12,
|
|
606
|
+
});
|
|
607
|
+
|
|
608
|
+
HGroup({ width: "100%", height: "auto", align: "left bottom", gap: 16 });
|
|
609
|
+
that.elem.style.flexWrap = "wrap";
|
|
610
|
+
|
|
611
|
+
startField("Range");
|
|
612
|
+
|
|
613
|
+
quickTabs = Tabs({
|
|
614
|
+
variant: "pill",
|
|
615
|
+
styleName: T.compStyle,
|
|
616
|
+
tabs: Theme.indexTabs(QUICK_RANGES.map(function(range) { return range.text; })), // (the key of a tab is its index: self.value)
|
|
617
|
+
onChange: function(self) {
|
|
618
|
+
selectQuickRange(self.value);
|
|
619
|
+
},
|
|
620
|
+
style: Theme.tabsStyle({ height: 40, barColor: FIELD_COLOR, borderColor: CARD_BORDER_COLOR, padding: [12, 6], activeColor: PRIMARY_COLOR }),
|
|
621
|
+
});
|
|
622
|
+
|
|
623
|
+
endField();
|
|
624
|
+
|
|
625
|
+
startField("From");
|
|
626
|
+
|
|
627
|
+
fromDate = SelectDate({
|
|
628
|
+
width: 150,
|
|
629
|
+
height: 40,
|
|
630
|
+
format: "DD MMM YYYY",
|
|
631
|
+
minDate: minSelectableDate,
|
|
632
|
+
maxDate: today,
|
|
633
|
+
showClearButton: 0,
|
|
634
|
+
style: DATE_STYLE,
|
|
635
|
+
onChange: function(self) {
|
|
636
|
+
if (!self.date) return;
|
|
637
|
+
filter.from = self.date;
|
|
638
|
+
toDate.setMinDate(self.date);
|
|
639
|
+
clearQuickRange();
|
|
640
|
+
scheduleReport();
|
|
641
|
+
},
|
|
642
|
+
});
|
|
643
|
+
|
|
644
|
+
endField();
|
|
645
|
+
|
|
646
|
+
startField("To");
|
|
647
|
+
|
|
648
|
+
toDate = SelectDate({
|
|
649
|
+
width: 150,
|
|
650
|
+
height: 40,
|
|
651
|
+
format: "DD MMM YYYY",
|
|
652
|
+
minDate: minSelectableDate,
|
|
653
|
+
maxDate: today,
|
|
654
|
+
showClearButton: 0,
|
|
655
|
+
style: DATE_STYLE,
|
|
656
|
+
onChange: function(self) {
|
|
657
|
+
if (!self.date) return;
|
|
658
|
+
filter.to = self.date;
|
|
659
|
+
fromDate.setMaxDate(self.date);
|
|
660
|
+
clearQuickRange();
|
|
661
|
+
scheduleReport();
|
|
662
|
+
},
|
|
663
|
+
});
|
|
664
|
+
|
|
665
|
+
endField();
|
|
666
|
+
|
|
667
|
+
startField("Region");
|
|
668
|
+
|
|
669
|
+
regionSelect = createTinySelect(
|
|
670
|
+
[{ id: "-1", label: "All regions" }].concat(REGIONS.map(function(region, i) { return { id: String(i), label: region.name }; })),
|
|
671
|
+
function(index, id) {
|
|
672
|
+
filter.regionIndex = Number(id);
|
|
673
|
+
scheduleReport();
|
|
674
|
+
}
|
|
675
|
+
);
|
|
676
|
+
|
|
677
|
+
endField();
|
|
678
|
+
|
|
679
|
+
startField("Group by");
|
|
680
|
+
|
|
681
|
+
groupSelect = createTinySelect(
|
|
682
|
+
GROUPS.map(function(group) { return { id: group.id, label: group.label }; }),
|
|
683
|
+
function(index, id) {
|
|
684
|
+
filter.group = id;
|
|
685
|
+
scheduleReport();
|
|
686
|
+
}
|
|
687
|
+
);
|
|
688
|
+
|
|
689
|
+
endField();
|
|
690
|
+
|
|
691
|
+
// Compare
|
|
692
|
+
HGroup({ width: "auto", height: 40, align: "left center" });
|
|
693
|
+
|
|
694
|
+
compareCheckBox = CheckBox({
|
|
695
|
+
labelText: "Compare with the previous period",
|
|
696
|
+
checked: filter.compare,
|
|
697
|
+
style: {
|
|
698
|
+
mark: { width: 20, height: 20, color: "transparent", borderColor: Ink(0.35) },
|
|
699
|
+
checkedMark: { color: PRIMARY_COLOR, borderColor: PRIMARY_COLOR },
|
|
700
|
+
hoverMark: { borderColor: Ink(0.7) },
|
|
701
|
+
tick: { color: Ink(1) },
|
|
702
|
+
label: { fontSize: 14, textColor: Ink(0.9) },
|
|
703
|
+
},
|
|
704
|
+
onChange: function(self) {
|
|
705
|
+
filter.compare = self.checked;
|
|
706
|
+
scheduleReport();
|
|
707
|
+
},
|
|
708
|
+
});
|
|
709
|
+
|
|
710
|
+
endGroup();
|
|
711
|
+
|
|
712
|
+
endGroup();
|
|
713
|
+
|
|
714
|
+
endGroup();
|
|
715
|
+
|
|
716
|
+
return card;
|
|
717
|
+
|
|
718
|
+
};
|
|
719
|
+
|
|
720
|
+
const initKpiRow = function() {
|
|
721
|
+
|
|
722
|
+
// graphType: "bar" -> MiniGraphBox, "line" -> SparkLineBox.
|
|
723
|
+
// WHY: Bars for things you can count, a line for money, averages and rates.
|
|
724
|
+
const KPI_LIST = [
|
|
725
|
+
{ title: "Revenue", color: ACCENT_COLOR, graphType: "line" },
|
|
726
|
+
{ title: "Orders", color: T.info, graphType: "bar" },
|
|
727
|
+
{ title: "Avg. Order Value", color: T.warning, graphType: "line" },
|
|
728
|
+
{ title: "Refund Rate", color: "#D55181", graphType: "line" },
|
|
729
|
+
];
|
|
730
|
+
|
|
731
|
+
const createKpiBox = function(kpi) {
|
|
732
|
+
|
|
733
|
+
const params = {
|
|
734
|
+
height: 100,
|
|
735
|
+
title: kpi.title,
|
|
736
|
+
valueText: "",
|
|
737
|
+
iconFile: "",
|
|
738
|
+
style: {
|
|
739
|
+
box: { color: CARD_COLOR, border: 1, borderColor: CARD_BORDER_COLOR, round: 12 },
|
|
740
|
+
text: { padding: 14 },
|
|
741
|
+
title: { fontSize: 13, textColor: Ink(0.5) },
|
|
742
|
+
valueText: { fontSize: 24, textColor: Ink(0.95) },
|
|
743
|
+
trend: { flatColor: Ink(0.45) }, // WHY: The default flat color is made for light cards.
|
|
744
|
+
},
|
|
745
|
+
};
|
|
746
|
+
|
|
747
|
+
if (kpi.graphType == "bar") {
|
|
748
|
+
params.barColor = kpi.color;
|
|
749
|
+
params.style.bars = { height: 34, barWidth: 4, gap: 2, padding: 14, round: 2 };
|
|
750
|
+
return MiniGraphBox(params);
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
params.lineColor = kpi.color;
|
|
754
|
+
params.style.graph = { height: 34, padding: 14 };
|
|
755
|
+
// WHY: showTrend 0 -> The title already shows the change against the previous period
|
|
756
|
+
// (getChangeText). Two up / down percentages on one box were confusing.
|
|
757
|
+
params.showTrend = 0;
|
|
758
|
+
return SparkLineBox(params);
|
|
759
|
+
|
|
760
|
+
};
|
|
761
|
+
|
|
762
|
+
startRow();
|
|
763
|
+
|
|
764
|
+
KPI_LIST.forEach(function(kpi) {
|
|
765
|
+
|
|
766
|
+
const kpiBox = createKpiBox(kpi);
|
|
767
|
+
setFlex(kpiBox, "1 1 220px");
|
|
768
|
+
|
|
769
|
+
kpiBoxList.push(kpiBox);
|
|
770
|
+
|
|
771
|
+
});
|
|
772
|
+
|
|
773
|
+
endGroup();
|
|
774
|
+
|
|
775
|
+
// WHY: Bar count was calculated with the default width (before flex). setValues() keeps only the values that fit.
|
|
776
|
+
kpiBoxList.forEach(function(kpiBox) { kpiBox.refresh(); });
|
|
777
|
+
|
|
778
|
+
};
|
|
779
|
+
|
|
780
|
+
const initChartRows = function() {
|
|
781
|
+
|
|
782
|
+
startRow();
|
|
783
|
+
|
|
784
|
+
// LINE: Revenue (current and previous period)
|
|
785
|
+
chartRevenue = createChartBox("2 1 520px", {
|
|
786
|
+
height: 340,
|
|
787
|
+
type: "line",
|
|
788
|
+
title: "Revenue",
|
|
789
|
+
subtitle: "Selected period compared with the previous period of the same length",
|
|
790
|
+
labels: [],
|
|
791
|
+
datasets: [
|
|
792
|
+
{
|
|
793
|
+
label: "Revenue",
|
|
794
|
+
data: [],
|
|
795
|
+
fill: true,
|
|
796
|
+
tension: 0.3,
|
|
797
|
+
backgroundColor: ChartBox.gradient("rgba(101, 162, 147, 0.3)", "rgba(101, 162, 147, 0)"),
|
|
798
|
+
},
|
|
799
|
+
{
|
|
800
|
+
label: "Previous",
|
|
801
|
+
data: [],
|
|
802
|
+
tension: 0.3,
|
|
803
|
+
borderDash: [5, 5],
|
|
804
|
+
borderColor: PREVIOUS_COLOR,
|
|
805
|
+
pointBackgroundColor: PREVIOUS_COLOR,
|
|
806
|
+
},
|
|
807
|
+
],
|
|
808
|
+
legend: "top",
|
|
809
|
+
formatValue: formatMoneyShort,
|
|
810
|
+
options: {
|
|
811
|
+
elements: { point: { radius: 0 } },
|
|
812
|
+
scales: { x: { ticks: { maxTicksLimit: 10 } } },
|
|
813
|
+
// WHY: "Previous" is not shown in the legend when compare is off. (Other items can still be hidden with a click.)
|
|
814
|
+
plugins: { legend: { labels: { filter: function(item) { return !(item.datasetIndex == 1 && !filter.compare); } } } },
|
|
815
|
+
},
|
|
816
|
+
});
|
|
817
|
+
|
|
818
|
+
// DOUGHNUT: Regions
|
|
819
|
+
chartRegion = createChartBox("1 1 320px", {
|
|
820
|
+
height: 340,
|
|
821
|
+
type: "doughnut",
|
|
822
|
+
title: "Revenue by Region",
|
|
823
|
+
subtitle: "All regions in the date range",
|
|
824
|
+
legend: "bottom",
|
|
825
|
+
labels: REGIONS.map(function(region) { return region.name; }),
|
|
826
|
+
values: REGIONS.map(function() { return 0; }),
|
|
827
|
+
formatValue: formatMoneyShort,
|
|
828
|
+
options: {
|
|
829
|
+
cutout: "68%",
|
|
830
|
+
},
|
|
831
|
+
onClick: function(self, item) {
|
|
832
|
+
// Filter the report by the clicked region.
|
|
833
|
+
regionSelect.setSelectedIndex(item.index + 1);
|
|
834
|
+
},
|
|
835
|
+
});
|
|
836
|
+
|
|
837
|
+
endGroup();
|
|
838
|
+
|
|
839
|
+
startRow();
|
|
840
|
+
|
|
841
|
+
// BAR: Orders by category (stacked)
|
|
842
|
+
chartCategory = createChartBox("2 1 520px", {
|
|
843
|
+
height: 340,
|
|
844
|
+
type: "bar",
|
|
845
|
+
stacked: 1,
|
|
846
|
+
title: "Orders by Category",
|
|
847
|
+
subtitle: "Number of orders in each period",
|
|
848
|
+
legend: "top",
|
|
849
|
+
labels: [],
|
|
850
|
+
datasets: CATEGORIES.map(function(category) { return { label: category.name, data: [] }; }),
|
|
851
|
+
options: {
|
|
852
|
+
datasets: { bar: { maxBarThickness: 36 } },
|
|
853
|
+
scales: { x: { ticks: { maxTicksLimit: 12 } } },
|
|
854
|
+
},
|
|
855
|
+
});
|
|
856
|
+
|
|
857
|
+
// BAR: Refund rate by category (horizontal)
|
|
858
|
+
chartRefund = createChartBox("1 1 320px", {
|
|
859
|
+
height: 340,
|
|
860
|
+
type: "bar",
|
|
861
|
+
horizontal: 1,
|
|
862
|
+
title: "Refund Rate",
|
|
863
|
+
subtitle: "Refunds / orders, by category",
|
|
864
|
+
labels: CATEGORIES.map(function(category) { return category.name; }),
|
|
865
|
+
datasets: [{
|
|
866
|
+
label: "Refund rate",
|
|
867
|
+
data: [],
|
|
868
|
+
backgroundColor: CATEGORY_COLORS, // Same colors with "Orders by Category"
|
|
869
|
+
hoverBackgroundColor: CATEGORY_COLORS,
|
|
870
|
+
}],
|
|
871
|
+
formatValue: function(value) { return value + "%"; },
|
|
872
|
+
});
|
|
873
|
+
|
|
874
|
+
endGroup();
|
|
875
|
+
|
|
876
|
+
};
|
|
877
|
+
|
|
878
|
+
const initTable = function() {
|
|
879
|
+
|
|
880
|
+
const titleDataList = [
|
|
881
|
+
{ name: "PERIOD", dataTitle: "period", dataType: "string", width: 130, shortable: 1 },
|
|
882
|
+
{ name: "CATEGORY", dataTitle: "category", dataType: "string", width: 150, shortable: 1 },
|
|
883
|
+
{ name: "ORDERS", dataTitle: "orders", dataType: "integer", width: 110, shortable: 1 },
|
|
884
|
+
{ name: "REVENUE", dataTitle: "revenue", dataType: "float", width: 140, shortable: 1 },
|
|
885
|
+
{ name: "AVG. ORDER", dataTitle: "avgOrder", dataType: "float", width: 130, shortable: 1 },
|
|
886
|
+
{ name: "REFUNDS", dataTitle: "refunds", dataType: "integer", width: 110, shortable: 1 },
|
|
887
|
+
{ name: "REFUND RATE", dataTitle: "refundRate", dataType: "float", width: 140, shortable: 1 },
|
|
888
|
+
];
|
|
889
|
+
|
|
890
|
+
const card = startCard("Report Details", "", "1 1 100%");
|
|
891
|
+
lblTableInfo = card.lblSubtitle;
|
|
892
|
+
|
|
893
|
+
HGroup({ width: "100%", height: 520, align: "left top" });
|
|
894
|
+
|
|
895
|
+
smartTable = SmartTable({
|
|
896
|
+
titleDataList: titleDataList,
|
|
897
|
+
itemDataList: [],
|
|
898
|
+
titleHeight: 44,
|
|
899
|
+
itemHeight: 40,
|
|
900
|
+
infoHeight: 56,
|
|
901
|
+
itemLineCount: 10,
|
|
902
|
+
sortByTitleIndex: 0,
|
|
903
|
+
sortDirection: "Z-A", // Newest period first
|
|
904
|
+
// WHY: SmartTable writes the raw value (numbers sort right). Money and percent texts are written here.
|
|
905
|
+
updateCustomItemCell: function(cell, titleDataIndex, data) {
|
|
906
|
+
switch (titleDataList[titleDataIndex].dataTitle) {
|
|
907
|
+
case "orders":
|
|
908
|
+
case "refunds":
|
|
909
|
+
cell.label.text = (data === "") ? "" : data.toLocaleString("en-US");
|
|
910
|
+
break;
|
|
911
|
+
case "revenue":
|
|
912
|
+
case "avgOrder":
|
|
913
|
+
cell.label.text = (data === "") ? "" : formatMoney(data, 2);
|
|
914
|
+
break;
|
|
915
|
+
case "refundRate":
|
|
916
|
+
cell.label.text = (data === "") ? "" : data.toFixed(1) + "%";
|
|
917
|
+
cell.label.textColor = (data > HIGH_REFUND_RATE) ? BAD_COLOR : Ink(0.75);
|
|
918
|
+
break;
|
|
919
|
+
}
|
|
920
|
+
},
|
|
921
|
+
scrollBarParams: {
|
|
922
|
+
bar_border: 0,
|
|
923
|
+
bar_round: 3,
|
|
924
|
+
bar_borderColor: Ink(0.15),
|
|
925
|
+
bar_width: 4,
|
|
926
|
+
bar_mouseOverWidth: 4,
|
|
927
|
+
bar_mouseOverColor: T.scrollBar,
|
|
928
|
+
bar_opacity: 0.4,
|
|
929
|
+
bar_mouseOverOpacity: 0.9,
|
|
930
|
+
bar_padding: 2,
|
|
931
|
+
bar_color: T.scrollBar,
|
|
932
|
+
neverHide: 0,
|
|
933
|
+
showDots: 0,
|
|
934
|
+
},
|
|
935
|
+
// WHY: Filtre kutusu ile alt bar aynı renkti, kutu görünmüyordu. Bar kart rengine, kutu ise alan rengine (FIELD_COLOR) alındı.
|
|
936
|
+
searchInputParams: {
|
|
937
|
+
width: "50%",
|
|
938
|
+
height: 34,
|
|
939
|
+
border: 1,
|
|
940
|
+
round: 8,
|
|
941
|
+
color: FIELD_COLOR,
|
|
942
|
+
borderColor: CARD_BORDER_COLOR,
|
|
943
|
+
borderBottomStyle: "1px solid " + CARD_BORDER_COLOR,
|
|
944
|
+
textColor: Ink(0.9),
|
|
945
|
+
placeholderColor: Ink(0.4),
|
|
946
|
+
searchIconSize: 15,
|
|
947
|
+
searchIconOpacity: 0.55,
|
|
948
|
+
placeholderText: "Filter (Ex: Books, 2026-09)",
|
|
949
|
+
fontSize: 14,
|
|
950
|
+
invertIconColor: T.invertIcon,
|
|
951
|
+
searchIconFile: LIB_PATH + "comp/search-input-v2/filter.png",
|
|
952
|
+
clearIconFile: LIB_PATH + "comp/search-input-v2/clear.svg",
|
|
953
|
+
},
|
|
954
|
+
// Filtre kutusundaki sütun seçim listesi (ALL) de koyu tema ile açılsın.
|
|
955
|
+
searchTitleMenuParams: {
|
|
956
|
+
minWidth: 170,
|
|
957
|
+
style: {
|
|
958
|
+
menu: { color: FIELD_COLOR, border: 1, borderColor: Ink(0.12), round: 8, padding: 4, shadow: "0 8px 24px " + Black(0.5) },
|
|
959
|
+
item: { height: 30, fontSize: 13, textColor: Ink(0.75), color: "transparent", round: 6, padding: 10, gap: 10 },
|
|
960
|
+
itemHover: { textColor: "white", color: Ink(0.08) },
|
|
961
|
+
disabled: { textColor: Ink(0.3), opacity: 0.4 },
|
|
962
|
+
icon: { width: 14, height: 14 },
|
|
963
|
+
separator: { color: Ink(0.1), space: 4 },
|
|
964
|
+
},
|
|
965
|
+
},
|
|
966
|
+
style: {
|
|
967
|
+
width: "100%",
|
|
968
|
+
height: "100%",
|
|
969
|
+
round: 8,
|
|
970
|
+
line1Color: CARD_COLOR,
|
|
971
|
+
line2Color: T.tableRow2,
|
|
972
|
+
highlightItemCellColor: T.tableHighlight,
|
|
973
|
+
highlightTitleCellColor: Ink(0.08),
|
|
974
|
+
verticalScrollWidth: 20,
|
|
975
|
+
verticalScrollMargin: 2,
|
|
976
|
+
btnScrollDownIconFile: LIB_PATH + "comp/smart-table/down.png",
|
|
977
|
+
btnScrollUpIconFile: LIB_PATH + "comp/smart-table/up.png",
|
|
978
|
+
btnScrollCenterIconFile: LIB_PATH + "comp/smart-table/scroll.png",
|
|
979
|
+
sortIconFile: LIB_PATH + "comp/smart-table/sort.png",
|
|
980
|
+
// WHY: Varsayılan tik ikonu koyu renkli; koyu menüde görünmüyordu.
|
|
981
|
+
searchTitleCheckIconFile: "data:image/svg+xml," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="' + ACCENT_COLOR + '" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12.5 10 17.5 19 7"/></svg>'),
|
|
982
|
+
loadingIconFile: LIB_PATH + "comp/smart-table/clock.png",
|
|
983
|
+
invertIconColor: T.invertIcon,
|
|
984
|
+
|
|
985
|
+
box: { color: CARD_COLOR },
|
|
986
|
+
boxBorder: { border: 1, borderColor: CARD_BORDER_COLOR },
|
|
987
|
+
boxTitleLine: { color: FIELD_COLOR },
|
|
988
|
+
boxTitleCell: { padding: [10, 0], borderRight: "1px solid " + Ink(0.06), borderBottom: "1px solid " + Ink(0.12) },
|
|
989
|
+
lblTitleCell: { fontSize: 13, fontFamily: "opensans", textColor: Ink(0.6) },
|
|
990
|
+
boxItemCell: { borderBottom: "1px solid " + Ink(0.05), borderRight: "1px solid " + Ink(0.03), padding: [10, 0] },
|
|
991
|
+
lblItemCell: { fontSize: 14, textColor: Ink(0.75), fontFamily: "opensans" },
|
|
992
|
+
boxInfoLine: { color: CARD_COLOR, borderTop: "1px solid " + Ink(0.08) },
|
|
993
|
+
lblBoxInfoLine: { fontSize: 13, textColor: Ink(0.55) },
|
|
994
|
+
lblNoDataFound: { color: T.surface3, textColor: Ink(0.6), padding: [8, 2], fontSize: 13, round: 8, border: 1, borderColor: Ink(0.15) },
|
|
995
|
+
// Filtre kutusunun içindeki sütun etiketi: Kutunun içinde durduğu için daha hafif bir chip.
|
|
996
|
+
lblSearchTitle: { color: Ink(0.08), textColor: Ink(0.6), padding: [8, 1], fontSize: 12, round: 6, border: 1, borderColor: Ink(0.14) },
|
|
997
|
+
btnScrollCenter: { color: T.surface3, round: 100, borderColor: Ink(0.2), border: 1 },
|
|
998
|
+
btnScrollUp: { color: T.surface4, round: 100, border: 1, borderColor: Ink(0.3) },
|
|
999
|
+
btnScrollDown: { color: T.surface4, round: 100, border: 1, borderColor: Ink(0.3) },
|
|
1000
|
+
boxSort: { color: PRIMARY_COLOR },
|
|
1001
|
+
},
|
|
1002
|
+
});
|
|
1003
|
+
|
|
1004
|
+
endGroup();
|
|
1005
|
+
|
|
1006
|
+
endCard();
|
|
1007
|
+
|
|
1008
|
+
};
|
|
1009
|
+
|
|
1010
|
+
// *** PAGE INIT CODE:
|
|
1011
|
+
|
|
1012
|
+
// BOX: Scrollable container
|
|
1013
|
+
// WHY: page does not scroll. Scrollable content must be inside a Box with scrollY: 1.
|
|
1014
|
+
startBox(0, 0, "100%", "100%", {
|
|
1015
|
+
color: "transparent",
|
|
1016
|
+
scrollY: 1,
|
|
1017
|
+
});
|
|
1018
|
+
|
|
1019
|
+
VGroup({
|
|
1020
|
+
width: "100%",
|
|
1021
|
+
height: "auto", // Grows with content, so the Box can scroll.
|
|
1022
|
+
align: "left top",
|
|
1023
|
+
gap: 16,
|
|
1024
|
+
padding: 24,
|
|
1025
|
+
});
|
|
1026
|
+
|
|
1027
|
+
initHeader();
|
|
1028
|
+
initFilterBar();
|
|
1029
|
+
initKpiRow();
|
|
1030
|
+
initChartRows();
|
|
1031
|
+
|
|
1032
|
+
startRow();
|
|
1033
|
+
initTable();
|
|
1034
|
+
endGroup();
|
|
1035
|
+
|
|
1036
|
+
endGroup();
|
|
1037
|
+
|
|
1038
|
+
endBox();
|
|
1039
|
+
|
|
1040
|
+
isReady = 1;
|
|
1041
|
+
|
|
1042
|
+
quickTabs.setValue(DEFAULT_RANGE_INDEX, 1);
|
|
1043
|
+
selectQuickRange(DEFAULT_RANGE_INDEX);
|
|
1044
|
+
|
|
1045
|
+
// WHY: The first report is not waited for (scheduleReport() runs it 50 ms later). The subtitle under
|
|
1046
|
+
// the title was written in renderReport(), so the header grew after the page was shown and
|
|
1047
|
+
// the whole content slid down. Now the page is complete before it is shown.
|
|
1048
|
+
clearTimeout(reportTimer);
|
|
1049
|
+
reportTimer = null;
|
|
1050
|
+
runReport();
|
|
1051
|
+
|
|
1052
|
+
return box.endPage();
|
|
1053
|
+
|
|
1054
|
+
};
|
|
1055
|
+
|
|
1056
|
+
ReportsPage.KEY = "Reports";
|
|
1057
|
+
|
|
1058
|
+
// *** TEST DATA:
|
|
1059
|
+
|
|
1060
|
+
ReportsPage.CATEGORIES = [
|
|
1061
|
+
{ name: "Electronics", price: 240, orders: 9, refundRate: 0.06 },
|
|
1062
|
+
{ name: "Clothing", price: 55, orders: 22, refundRate: 0.11 },
|
|
1063
|
+
{ name: "Home", price: 85, orders: 11, refundRate: 0.04 },
|
|
1064
|
+
{ name: "Cosmetics", price: 32, orders: 17, refundRate: 0.03 },
|
|
1065
|
+
{ name: "Books", price: 18, orders: 13, refundRate: 0.02 },
|
|
1066
|
+
];
|
|
1067
|
+
|
|
1068
|
+
ReportsPage.REGIONS = [
|
|
1069
|
+
{ name: "Europe", factor: 1 },
|
|
1070
|
+
{ name: "North America", factor: 1.3 },
|
|
1071
|
+
{ name: "Asia", factor: 0.9 },
|
|
1072
|
+
{ name: "Middle East", factor: 0.45 },
|
|
1073
|
+
];
|
|
1074
|
+
|
|
1075
|
+
ReportsPage._testData = null;
|
|
1076
|
+
|
|
1077
|
+
// Daily sales of the last 2 years: [{ time, category, region, orders, revenue, refunds }]
|
|
1078
|
+
// WHY: Created one time and kept. The page is created again every time it is opened.
|
|
1079
|
+
ReportsPage.getTestData = function() {
|
|
1080
|
+
|
|
1081
|
+
if (ReportsPage._testData) return ReportsPage._testData;
|
|
1082
|
+
|
|
1083
|
+
// Random numbers with a seed: the same data every time. (mulberry32)
|
|
1084
|
+
let seed = 20260916;
|
|
1085
|
+
const rnd = function() {
|
|
1086
|
+
seed = (seed + 0x6D2B79F5) | 0;
|
|
1087
|
+
let t = seed;
|
|
1088
|
+
t = Math.imul(t ^ (t >>> 15), t | 1);
|
|
1089
|
+
t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
|
|
1090
|
+
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
|
|
1091
|
+
};
|
|
1092
|
+
|
|
1093
|
+
const DAY_COUNT = 730;
|
|
1094
|
+
const today = ReportsPage.startOfDay(new Date());
|
|
1095
|
+
const list = [];
|
|
1096
|
+
|
|
1097
|
+
for (let i = DAY_COUNT; i >= 0; i--) {
|
|
1098
|
+
|
|
1099
|
+
const date = ReportsPage.addDays(today, -i);
|
|
1100
|
+
const growth = 1 + (DAY_COUNT - i) / DAY_COUNT * 0.35; // Sales grow in 2 years
|
|
1101
|
+
const season = 1 + 0.25 * Math.sin((date.getMonth() + 1) / 12 * Math.PI * 2 - 1.2); // Busy months
|
|
1102
|
+
const weekend = (date.getDay() == 0 || date.getDay() == 6) ? 1.3 : 1;
|
|
1103
|
+
|
|
1104
|
+
ReportsPage.CATEGORIES.forEach(function(category, categoryIndex) {
|
|
1105
|
+
ReportsPage.REGIONS.forEach(function(region, regionIndex) {
|
|
1106
|
+
|
|
1107
|
+
const orders = Math.round(category.orders * region.factor * growth * season * weekend * (0.6 + rnd() * 0.8));
|
|
1108
|
+
const revenue = Math.round(orders * category.price * (0.85 + rnd() * 0.3) * 100) / 100;
|
|
1109
|
+
const refunds = Math.floor(orders * category.refundRate * (0.4 + rnd() * 1.2) + rnd());
|
|
1110
|
+
|
|
1111
|
+
list.push({ time: date.getTime(), category: categoryIndex, region: regionIndex, orders: orders, revenue: revenue, refunds: refunds });
|
|
1112
|
+
|
|
1113
|
+
});
|
|
1114
|
+
});
|
|
1115
|
+
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
ReportsPage._testData = list;
|
|
1119
|
+
return list;
|
|
1120
|
+
|
|
1121
|
+
};
|
|
1122
|
+
|
|
1123
|
+
// *** DATE HELPERS:
|
|
1124
|
+
|
|
1125
|
+
ReportsPage.startOfDay = function(date) {
|
|
1126
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
1127
|
+
};
|
|
1128
|
+
|
|
1129
|
+
// WHY: new Date(y, m, d + days) is safe on daylight saving days. (Adding 24 hours is not.)
|
|
1130
|
+
ReportsPage.addDays = function(date, days) {
|
|
1131
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate() + days);
|
|
1132
|
+
};
|
|
1133
|
+
|
|
1134
|
+
// Local date: "2026-09-16"
|
|
1135
|
+
ReportsPage.toISODate = function(date) {
|
|
1136
|
+
const pad = function(n) { return String(n).padStart(2, "0"); };
|
|
1137
|
+
return date.getFullYear() + "-" + pad(date.getMonth() + 1) + "-" + pad(date.getDate());
|
|
1138
|
+
};
|