create-basicjs 0.1.0 → 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 +1 -1
- package/bin/create-basicjs.js +2 -2
- package/bin/verify-package.js +16 -0
- package/package.json +4 -1
- package/payload/starter/AGENTS.md +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,1147 @@
|
|
|
1
|
+
/* Bismillah */
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
|
|
5
|
+
Orders Page (Template) - v26.09
|
|
6
|
+
|
|
7
|
+
- Order management: status tabs with counts, summary graphs, filters, an order table and
|
|
8
|
+
an order details panel (right view) with items, totals, address, timeline and actions.
|
|
9
|
+
- Status flow: Pending -> Processing -> Shipped (carrier and tracking number) -> Delivered.
|
|
10
|
+
Pending and processing orders can be cancelled. Shipped and delivered orders can be refunded.
|
|
11
|
+
- Internal notes are added to the timeline. The invoice can be printed.
|
|
12
|
+
- Test data: About 600 orders of the last 60 days, created one time with a fixed seed.
|
|
13
|
+
Changes are kept while the panel is open. Replace the "ORDER SERVICE" functions with your service.
|
|
14
|
+
|
|
15
|
+
COMPONENTS:
|
|
16
|
+
- Tabs (comp-m4): Status tabs
|
|
17
|
+
- SparkLineBox (comp-m4): Summary graphs
|
|
18
|
+
- SearchInput, TinySelect (comp-m2): Filters
|
|
19
|
+
- SmartTable (comp-m3): Order list
|
|
20
|
+
- TinyTable (comp-m4): Order items
|
|
21
|
+
- InputB (comp-m2): Tracking number, note
|
|
22
|
+
- SmartButton (comp-m4), HoldToConfirmButton (comp-m3): Actions
|
|
23
|
+
- Dialog, LoadingScreen (comp-m4; Theme.confirm, waiting): Cancel confirm, saving
|
|
24
|
+
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
OrdersPageDefaults = {
|
|
28
|
+
color: "transparent",
|
|
29
|
+
openOrderId: null, // Opens the details of this order. (Ex: from the search on the top bar)
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const OrdersPage = function(params = {}) {
|
|
33
|
+
|
|
34
|
+
// BOX: Page container
|
|
35
|
+
let box = startPage(params, OrdersPageDefaults, mainView);
|
|
36
|
+
|
|
37
|
+
mainView.setKey(OrdersPage.KEY);
|
|
38
|
+
|
|
39
|
+
// *** PRIVATE VARIABLES:
|
|
40
|
+
|
|
41
|
+
const ASSETS = "assets/";
|
|
42
|
+
const LIB_PATH = "_basic/";
|
|
43
|
+
const S = OrdersPage.STYLE;
|
|
44
|
+
const STATUSES = OrdersPage.STATUSES;
|
|
45
|
+
|
|
46
|
+
const HOUR = 60 * 60 * 1000;
|
|
47
|
+
const DAY = 24 * HOUR;
|
|
48
|
+
|
|
49
|
+
// Tabs: "" -> All
|
|
50
|
+
const TABS = ["", "pending", "processing", "shipped", "delivered", "cancelled", "refunded"];
|
|
51
|
+
|
|
52
|
+
const RANGES = [
|
|
53
|
+
{ id: "7", label: "Last 7 days", ms: 7 * DAY },
|
|
54
|
+
{ id: "30", label: "Last 30 days", ms: 30 * DAY },
|
|
55
|
+
{ id: "60", label: "Last 60 days", ms: 60 * DAY },
|
|
56
|
+
];
|
|
57
|
+
|
|
58
|
+
const filter = {
|
|
59
|
+
status: "",
|
|
60
|
+
search: "",
|
|
61
|
+
payment: "",
|
|
62
|
+
rangeId: "30",
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
let searchTimer = null;
|
|
66
|
+
|
|
67
|
+
// Components
|
|
68
|
+
let statusTabs, searchInput, paymentSelect, rangeSelect;
|
|
69
|
+
let kpiBoxList = [];
|
|
70
|
+
let lblResultCount, smartTable;
|
|
71
|
+
|
|
72
|
+
// *** PRIVATE FUNCTIONS:
|
|
73
|
+
|
|
74
|
+
const getOrders = function() {
|
|
75
|
+
return OrdersPage.getOrders();
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const getRangeStart = function() {
|
|
79
|
+
return Date.now() - RANGES.find(function(range) { return range.id == filter.rangeId; }).ms;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
// All filters except the status (used for the tab counts too)
|
|
83
|
+
const matchesFilters = function(order) {
|
|
84
|
+
if (order.time < getRangeStart()) return false;
|
|
85
|
+
if (filter.payment && order.payment != filter.payment) return false;
|
|
86
|
+
const search = filter.search.trim().toLowerCase();
|
|
87
|
+
if (search) {
|
|
88
|
+
const text = (order.id + " " + order.customer.name + " " + order.customer.email).toLowerCase();
|
|
89
|
+
if (!text.includes(search)) return false;
|
|
90
|
+
}
|
|
91
|
+
return true;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const render = function() {
|
|
95
|
+
|
|
96
|
+
const list = getOrders().filter(matchesFilters);
|
|
97
|
+
|
|
98
|
+
// Tab counts
|
|
99
|
+
TABS.forEach(function(status, index) {
|
|
100
|
+
const count = (status) ? list.filter(function(order) { return order.status == status; }).length : list.length;
|
|
101
|
+
statusTabs.setCount(index, count);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
const shown = (filter.status) ? list.filter(function(order) { return order.status == filter.status; }) : list;
|
|
105
|
+
|
|
106
|
+
smartTable.setItemDataList(shown.map(function(order) {
|
|
107
|
+
return {
|
|
108
|
+
id: order.id,
|
|
109
|
+
date: OrdersPage.formatDateTime(order.time), // Sortable text
|
|
110
|
+
customer: order.customer.name,
|
|
111
|
+
items: order.items.reduce(function(sum, item) { return sum + item.qty; }, 0),
|
|
112
|
+
total: order.total,
|
|
113
|
+
payment: order.payment,
|
|
114
|
+
status: STATUSES[order.status].label,
|
|
115
|
+
};
|
|
116
|
+
}));
|
|
117
|
+
|
|
118
|
+
const revenue = shown.filter(function(order) { return !["cancelled", "refunded"].includes(order.status); })
|
|
119
|
+
.reduce(function(sum, order) { return sum + order.total; }, 0);
|
|
120
|
+
lblResultCount.text = shown.length.toLocaleString("en-US") + " orders · " + OrdersPage.formatMoney(revenue) + " revenue (without cancelled and refunded)";
|
|
121
|
+
|
|
122
|
+
renderSummary();
|
|
123
|
+
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const renderSummary = function() {
|
|
127
|
+
|
|
128
|
+
const orders = getOrders();
|
|
129
|
+
const now = Date.now();
|
|
130
|
+
const isValid = function(order) { return !["cancelled", "refunded"].includes(order.status); };
|
|
131
|
+
|
|
132
|
+
// Buckets: count bars from the newest to the oldest
|
|
133
|
+
const buckets = function(count, size, getValue) {
|
|
134
|
+
const bars = new Array(count).fill(0);
|
|
135
|
+
orders.forEach(function(order) {
|
|
136
|
+
const age = now - order.time;
|
|
137
|
+
if (age < 0 || age >= count * size) return;
|
|
138
|
+
bars[count - 1 - Math.floor(age / size)] += getValue(order);
|
|
139
|
+
});
|
|
140
|
+
return bars;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const ordersToday = buckets(24, HOUR, function(order) { return 1; });
|
|
144
|
+
const revenueToday = buckets(24, HOUR, function(order) { return (isValid(order)) ? order.total : 0; });
|
|
145
|
+
const toShip = orders.filter(function(order) { return order.status == "processing"; });
|
|
146
|
+
const refunds = buckets(30, DAY, function(order) { return (order.status == "refunded") ? 1 : 0; });
|
|
147
|
+
|
|
148
|
+
const values = [
|
|
149
|
+
{ text: String(sum(ordersToday)), bars: ordersToday },
|
|
150
|
+
{ text: OrdersPage.formatMoney(sum(revenueToday)), bars: revenueToday.map(Math.round) },
|
|
151
|
+
{ text: String(toShip.length), bars: buckets(7, DAY, function(order) { return (order.status == "processing") ? 1 : 0; }) },
|
|
152
|
+
{ text: String(sum(refunds)), bars: refunds },
|
|
153
|
+
];
|
|
154
|
+
|
|
155
|
+
kpiBoxList.forEach(function(kpiBox, index) {
|
|
156
|
+
kpiBox.setValueText(values[index].text);
|
|
157
|
+
kpiBox.setValues(values[index].bars);
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
const sum = function(list) {
|
|
163
|
+
return list.reduce(function(total, value) { return total + value; }, 0);
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const exportCSV = function() {
|
|
167
|
+
|
|
168
|
+
const rows = smartTable.visibleItemDataList; // WHY: Also uses the sort and the search of the table.
|
|
169
|
+
const quote = function(value) { return "\"" + String(value).replace(/"/g, "\"\"") + "\""; };
|
|
170
|
+
const lines = ["order,date,customer,items,total,payment,status"].concat(rows.map(function(row) {
|
|
171
|
+
return [row.id, row.date, row.customer, row.items, row.total, row.payment, row.status].map(quote).join(",");
|
|
172
|
+
}));
|
|
173
|
+
|
|
174
|
+
const link = document.createElement("a");
|
|
175
|
+
link.href = URL.createObjectURL(new Blob([lines.join("\n")], { type: "text/csv" }));
|
|
176
|
+
link.download = "orders-" + OrdersPage.formatDateTime(Date.now()).slice(0, 10) + ".csv";
|
|
177
|
+
link.click();
|
|
178
|
+
URL.revokeObjectURL(link.href);
|
|
179
|
+
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
const openDetails = function(orderId) {
|
|
183
|
+
const order = getOrders().find(function(o) { return o.id == orderId; });
|
|
184
|
+
if (!order) return;
|
|
185
|
+
OrderDetails({
|
|
186
|
+
order: order,
|
|
187
|
+
onChange: function() {
|
|
188
|
+
if (box) render();
|
|
189
|
+
},
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
const closeDetails = function() {
|
|
194
|
+
if (rightView.isShown(OrderDetails.KEY)) {
|
|
195
|
+
rightView.hide();
|
|
196
|
+
rightView.clean();
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
// *** VIEW HELPERS:
|
|
201
|
+
|
|
202
|
+
const setFlex = function(obj, flex) {
|
|
203
|
+
obj.elem.style.flex = flex;
|
|
204
|
+
obj.elem.style.minWidth = "0";
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
// *** PUBLIC FUNCTIONS:
|
|
208
|
+
|
|
209
|
+
box.destroy = function() {
|
|
210
|
+
|
|
211
|
+
clearTimeout(searchTimer);
|
|
212
|
+
closeDetails();
|
|
213
|
+
|
|
214
|
+
// WHY: SmartTable has window events and a menu on the page. box.remove() does not remove them.
|
|
215
|
+
if (smartTable) smartTable.remove();
|
|
216
|
+
|
|
217
|
+
box.remove();
|
|
218
|
+
box = null;
|
|
219
|
+
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
// *** PAGE VIEW:
|
|
223
|
+
|
|
224
|
+
const initHeader = function() {
|
|
225
|
+
|
|
226
|
+
HGroup({ width: "100%", height: "auto", align: "left center", gap: 16 });
|
|
227
|
+
that.elem.style.flexWrap = "wrap";
|
|
228
|
+
that.elem.style.justifyContent = "space-between";
|
|
229
|
+
|
|
230
|
+
VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
|
|
231
|
+
|
|
232
|
+
Label({ text: "Orders", fontSize: 26, textColor: Ink(0.95) });
|
|
233
|
+
that.elem.style.fontFamily = "opensans-bold";
|
|
234
|
+
|
|
235
|
+
Label({ text: "Process, ship and refund the orders of your store", fontSize: 14, textColor: Ink(0.5) });
|
|
236
|
+
|
|
237
|
+
endGroup();
|
|
238
|
+
|
|
239
|
+
OrdersPage.createButton("Export CSV", ASSETS + "arrow_down.png", exportCSV, { primary: 1 });
|
|
240
|
+
|
|
241
|
+
endGroup();
|
|
242
|
+
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
const initSummary = function() {
|
|
246
|
+
|
|
247
|
+
const KPI_LIST = [
|
|
248
|
+
{ title: "Orders · 24 hours", lineColor: S.ACCENT_COLOR },
|
|
249
|
+
{ title: "Revenue · 24 hours", lineColor: T.info },
|
|
250
|
+
{ title: "Waiting to ship", lineColor: T.warning },
|
|
251
|
+
{ title: "Refunds · 30 days", lineColor: S.ERROR_COLOR },
|
|
252
|
+
];
|
|
253
|
+
|
|
254
|
+
HGroup({ width: "100%", height: "auto", align: "left top", gap: 16 });
|
|
255
|
+
that.elem.style.flexWrap = "wrap";
|
|
256
|
+
|
|
257
|
+
KPI_LIST.forEach(function(kpi) {
|
|
258
|
+
|
|
259
|
+
const kpiBox = SparkLineBox({
|
|
260
|
+
height: 96,
|
|
261
|
+
title: kpi.title,
|
|
262
|
+
valueText: "",
|
|
263
|
+
iconFile: "",
|
|
264
|
+
lineColor: kpi.lineColor,
|
|
265
|
+
style: {
|
|
266
|
+
box: { color: S.CARD_COLOR, border: 1, borderColor: S.CARD_BORDER_COLOR, round: 12 },
|
|
267
|
+
text: { padding: 14 },
|
|
268
|
+
title: { fontSize: 13, textColor: Ink(0.5) },
|
|
269
|
+
valueText: { fontSize: 24, textColor: Ink(0.95) },
|
|
270
|
+
trend: { flatColor: Ink(0.45) }, // WHY: The default flat color is made for light cards.
|
|
271
|
+
graph: { height: 30, padding: 14 },
|
|
272
|
+
},
|
|
273
|
+
});
|
|
274
|
+
setFlex(kpiBox, "1 1 220px");
|
|
275
|
+
kpiBoxList.push(kpiBox);
|
|
276
|
+
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
endGroup();
|
|
280
|
+
|
|
281
|
+
// WHY: Bar count was calculated with the default width (before flex).
|
|
282
|
+
kpiBoxList.forEach(function(kpiBox) { kpiBox.refresh(); });
|
|
283
|
+
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
const initToolbar = function() {
|
|
287
|
+
|
|
288
|
+
VGroup({ width: "100%", height: "auto", align: "left top", gap: 12, padding: 16, color: S.CARD_COLOR, border: 1, borderColor: S.CARD_BORDER_COLOR, round: 12 });
|
|
289
|
+
|
|
290
|
+
// TABS: Status (horizontal scroll on small widths)
|
|
291
|
+
HGroup({ width: "100%", height: "auto", align: "left top" });
|
|
292
|
+
that.elem.style.overflowX = "auto";
|
|
293
|
+
|
|
294
|
+
statusTabs = Tabs({
|
|
295
|
+
variant: "pill",
|
|
296
|
+
styleName: T.compStyle,
|
|
297
|
+
tabs: Theme.indexTabs(TABS.map(function(status) { return (status) ? STATUSES[status].label : "All"; })), // (the key of a tab is its index: self.value)
|
|
298
|
+
onChange: function(self) {
|
|
299
|
+
filter.status = TABS[self.value];
|
|
300
|
+
render();
|
|
301
|
+
},
|
|
302
|
+
style: Theme.tabsStyle({ height: 40, barColor: S.FIELD_COLOR, borderColor: S.CARD_BORDER_COLOR, padding: [12, 6], activeColor: S.PRIMARY_COLOR }),
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
endGroup();
|
|
306
|
+
|
|
307
|
+
HGroup({ width: "100%", height: "auto", align: "left center", gap: 10 });
|
|
308
|
+
that.elem.style.flexWrap = "wrap";
|
|
309
|
+
|
|
310
|
+
searchInput = SearchInput({
|
|
311
|
+
width: 280,
|
|
312
|
+
height: 40,
|
|
313
|
+
border: 1,
|
|
314
|
+
borderColor: S.CARD_BORDER_COLOR,
|
|
315
|
+
borderBottomStyle: "1px solid " + S.CARD_BORDER_COLOR,
|
|
316
|
+
round: 8,
|
|
317
|
+
color: S.FIELD_COLOR,
|
|
318
|
+
textColor: Ink(0.9),
|
|
319
|
+
fontSize: 14,
|
|
320
|
+
searchIconSize: 16,
|
|
321
|
+
placeholderText: "Search orders",
|
|
322
|
+
invertIconColor: T.invertIcon,
|
|
323
|
+
searchIconFile: LIB_PATH + "comp/search-input-v2/search.svg",
|
|
324
|
+
clearIconFile: LIB_PATH + "comp/search-input-v2/clear.svg",
|
|
325
|
+
onSearch: function(text) {
|
|
326
|
+
filter.search = text;
|
|
327
|
+
searchTimer = waitAndRun(searchTimer, render, 200); // WHY: Do not filter on every key.
|
|
328
|
+
},
|
|
329
|
+
});
|
|
330
|
+
that.position = "relative";
|
|
331
|
+
|
|
332
|
+
rangeSelect = OrdersPage.createTinySelect(
|
|
333
|
+
RANGES.map(function(range) { return { id: range.id, label: range.label }; }),
|
|
334
|
+
function(id) { filter.rangeId = id; render(); },
|
|
335
|
+
1 // Selected: "Last 30 days"
|
|
336
|
+
);
|
|
337
|
+
|
|
338
|
+
paymentSelect = OrdersPage.createTinySelect(
|
|
339
|
+
[{ id: "", label: "All payments" }].concat(OrdersPage.PAYMENTS.map(function(name) { return { id: name, label: name }; })),
|
|
340
|
+
function(id) { filter.payment = id; render(); }
|
|
341
|
+
);
|
|
342
|
+
|
|
343
|
+
// Space
|
|
344
|
+
HGroup({ width: "auto", height: 1 });
|
|
345
|
+
that.elem.style.flex = "1 1 auto";
|
|
346
|
+
endGroup();
|
|
347
|
+
|
|
348
|
+
lblResultCount = Label({ text: "", fontSize: 13, textColor: Ink(0.55) });
|
|
349
|
+
|
|
350
|
+
endGroup();
|
|
351
|
+
|
|
352
|
+
endGroup();
|
|
353
|
+
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
const initTable = function() {
|
|
357
|
+
|
|
358
|
+
HGroup({ width: "100%", height: 640, align: "left top" });
|
|
359
|
+
|
|
360
|
+
smartTable = SmartTable({
|
|
361
|
+
titleDataList: [
|
|
362
|
+
{ name: "ORDER", dataTitle: "id", dataType: "string", width: 130, shortable: 1 },
|
|
363
|
+
{ name: "DATE", dataTitle: "date", dataType: "string", width: 180, shortable: 1 },
|
|
364
|
+
{ name: "CUSTOMER", dataTitle: "customer", dataType: "string", width: 200, shortable: 1 },
|
|
365
|
+
{ name: "ITEMS", dataTitle: "items", dataType: "integer", width: 90, shortable: 1 },
|
|
366
|
+
{ name: "TOTAL", dataTitle: "total", dataType: "float", width: 130, shortable: 1 },
|
|
367
|
+
{ name: "PAYMENT", dataTitle: "payment", dataType: "string", width: 160, shortable: 1 },
|
|
368
|
+
{ name: "STATUS", dataTitle: "status", dataType: "string", width: 140, shortable: 1 },
|
|
369
|
+
],
|
|
370
|
+
itemDataList: [],
|
|
371
|
+
titleHeight: 44,
|
|
372
|
+
itemHeight: 40,
|
|
373
|
+
infoHeight: 56,
|
|
374
|
+
itemLineCount: 13,
|
|
375
|
+
sortByTitleIndex: 1,
|
|
376
|
+
sortDirection: "Z-A", // Newest first
|
|
377
|
+
onSelect: function(itemData) {
|
|
378
|
+
openDetails(itemData.id);
|
|
379
|
+
},
|
|
380
|
+
// WHY: SmartTable writes the raw value (totals sort as numbers). Money and status colors are written here.
|
|
381
|
+
updateCustomItemCell: function(cell, titleDataIndex, data) {
|
|
382
|
+
if (titleDataIndex == 4 && data !== "") cell.label.text = OrdersPage.formatMoney(data);
|
|
383
|
+
if (titleDataIndex == 6) {
|
|
384
|
+
const status = OrdersPage.getStatusByLabel(data);
|
|
385
|
+
cell.label.textColor = (status) ? status.color : Ink(0.75);
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
...OrdersPage.getSmartTableStyle(LIB_PATH),
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
endGroup();
|
|
392
|
+
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
// *** PAGE INIT CODE:
|
|
396
|
+
|
|
397
|
+
// BOX: Scrollable container
|
|
398
|
+
// WHY: page does not scroll. Scrollable content must be inside a Box with scrollY: 1.
|
|
399
|
+
startBox(0, 0, "100%", "100%", {
|
|
400
|
+
color: "transparent",
|
|
401
|
+
scrollY: 1,
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
VGroup({
|
|
405
|
+
width: "100%",
|
|
406
|
+
height: "auto", // Grows with content, so the Box can scroll.
|
|
407
|
+
align: "left top",
|
|
408
|
+
gap: 16,
|
|
409
|
+
padding: 24,
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
initHeader();
|
|
413
|
+
initSummary();
|
|
414
|
+
initToolbar();
|
|
415
|
+
initTable();
|
|
416
|
+
|
|
417
|
+
endGroup();
|
|
418
|
+
|
|
419
|
+
endBox();
|
|
420
|
+
|
|
421
|
+
render();
|
|
422
|
+
|
|
423
|
+
box.endPage();
|
|
424
|
+
|
|
425
|
+
if (box.openOrderId !== null) openDetails(box.openOrderId);
|
|
426
|
+
|
|
427
|
+
return box;
|
|
428
|
+
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
OrdersPage.KEY = "Orders";
|
|
432
|
+
|
|
433
|
+
// *** DETAILS PANEL (RIGHT VIEW):
|
|
434
|
+
|
|
435
|
+
const OrderDetailsDefaults = {
|
|
436
|
+
order: null,
|
|
437
|
+
onChange: function(order) {},
|
|
438
|
+
};
|
|
439
|
+
|
|
440
|
+
const OrderDetails = function(params = {}) {
|
|
441
|
+
|
|
442
|
+
// Merge params:
|
|
443
|
+
mergeIntoIfMissing(params, OrderDetailsDefaults);
|
|
444
|
+
|
|
445
|
+
params.left = 0;
|
|
446
|
+
params.top = 0;
|
|
447
|
+
params.width = "100%";
|
|
448
|
+
params.height = "100%";
|
|
449
|
+
params.color = T.surfaceDeep;
|
|
450
|
+
|
|
451
|
+
// WHY: order is a live object of the list. startObject() would copy it.
|
|
452
|
+
const order = params.order;
|
|
453
|
+
|
|
454
|
+
// BOX: Component container
|
|
455
|
+
let box = startObject(params);
|
|
456
|
+
|
|
457
|
+
const S = OrdersPage.STYLE;
|
|
458
|
+
const escape = OrdersPage.escapeHtml;
|
|
459
|
+
let saveTimer = null;
|
|
460
|
+
|
|
461
|
+
// *** ORDER SERVICE (TEST):
|
|
462
|
+
|
|
463
|
+
// Changes the order like a server request, then opens the panel again with the new data.
|
|
464
|
+
const updateOrder = function(change, historyText, historyType) {
|
|
465
|
+
|
|
466
|
+
if (typeof waiting !== "undefined") waiting.open();
|
|
467
|
+
|
|
468
|
+
saveTimer = setTimeout(function() {
|
|
469
|
+
|
|
470
|
+
// TODO: Send the change to your service. (Also e-mail the customer for status changes.)
|
|
471
|
+
Object.assign(order, change);
|
|
472
|
+
order.history.push({ time: Date.now(), text: historyText, type: historyType, by: "You" });
|
|
473
|
+
|
|
474
|
+
if (typeof waiting !== "undefined") waiting.close();
|
|
475
|
+
|
|
476
|
+
box.onChange(order);
|
|
477
|
+
OrderDetails({ order: order, onChange: box.onChange }); // Render again
|
|
478
|
+
|
|
479
|
+
}, 400);
|
|
480
|
+
|
|
481
|
+
};
|
|
482
|
+
|
|
483
|
+
// *** VIEW HELPERS:
|
|
484
|
+
|
|
485
|
+
const startSection = function(title) {
|
|
486
|
+
const group = VGroup({ width: "100%", height: "auto", align: "left top", gap: 8, padding: [16, 14], color: S.CARD_COLOR, border: 1, borderColor: S.CARD_BORDER_COLOR, round: 10 });
|
|
487
|
+
if (title) {
|
|
488
|
+
Label({ text: title.toUpperCase(), fontSize: 11, textColor: Ink(0.45) });
|
|
489
|
+
that.elem.style.letterSpacing = "1px";
|
|
490
|
+
}
|
|
491
|
+
return group;
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
const createInfoLine = function(left, right, rightStyle = {}) {
|
|
495
|
+
HGroup({ width: "100%", height: "auto", align: "left center", gap: 16 });
|
|
496
|
+
that.elem.style.justifyContent = "space-between";
|
|
497
|
+
Label({ text: left, fontSize: 14, textColor: Ink(0.55) });
|
|
498
|
+
that.elem.style.flexShrink = "0";
|
|
499
|
+
Label({ text: right, fontSize: 14, textColor: Ink(0.9), textAlign: "right", ...rightStyle });
|
|
500
|
+
endGroup();
|
|
501
|
+
};
|
|
502
|
+
|
|
503
|
+
const createDarkInput = function(params) {
|
|
504
|
+
const input = InputB({
|
|
505
|
+
width: "100%",
|
|
506
|
+
leftPadding: 14,
|
|
507
|
+
rightPadding: 36,
|
|
508
|
+
backgroundColor: S.FIELD_COLOR,
|
|
509
|
+
selectedBackgroundColor: T.surface3,
|
|
510
|
+
lineColor: "transparent",
|
|
511
|
+
selectedLineColor: "transparent",
|
|
512
|
+
backBorderColor: S.CARD_BORDER_COLOR,
|
|
513
|
+
selectedBackBorderColor: S.ACCENT_COLOR,
|
|
514
|
+
backBorderTopRound: 8,
|
|
515
|
+
backBorderBottomRound: 8,
|
|
516
|
+
requiredColor: S.ERROR_COLOR,
|
|
517
|
+
warningColor: S.ERROR_COLOR,
|
|
518
|
+
...params,
|
|
519
|
+
});
|
|
520
|
+
// WHY: InputB has fixed text colors for light backgrounds.
|
|
521
|
+
input.title.textColor = Ink(0.45);
|
|
522
|
+
input.title.fontSize = 11;
|
|
523
|
+
input.title.elem.style.letterSpacing = "1px";
|
|
524
|
+
input.input.textColor = Ink(0.9);
|
|
525
|
+
input.input.fontSize = 15;
|
|
526
|
+
input.input.height = 32;
|
|
527
|
+
input.warningBall.borderColor = S.CARD_COLOR;
|
|
528
|
+
return input;
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
// WHY: Some components have no enabled setting. "inert" blocks the mouse and keyboard for all the children.
|
|
532
|
+
const setInteractive = function(obj, enabled) {
|
|
533
|
+
obj.elem.inert = !enabled;
|
|
534
|
+
obj.opacity = (enabled) ? 1 : 0.4;
|
|
535
|
+
};
|
|
536
|
+
|
|
537
|
+
box.destroy = function() {
|
|
538
|
+
clearTimeout(saveTimer);
|
|
539
|
+
box.remove();
|
|
540
|
+
box = null;
|
|
541
|
+
};
|
|
542
|
+
|
|
543
|
+
// *** VIEW:
|
|
544
|
+
|
|
545
|
+
const status = OrdersPage.STATUSES[order.status];
|
|
546
|
+
|
|
547
|
+
// Left line
|
|
548
|
+
Box(0, 0, 1, "100%", { color: Ink(0.12) });
|
|
549
|
+
|
|
550
|
+
// GROUP: Scrollable content
|
|
551
|
+
startBox(0, 0, "100%", "calc(100% - 76px)", { color: "transparent", scrollY: 1 });
|
|
552
|
+
|
|
553
|
+
VGroup({ width: "100%", height: "auto", align: "left top", gap: 14, padding: 20 });
|
|
554
|
+
|
|
555
|
+
// TITLE
|
|
556
|
+
HGroup({ width: "100%", height: "auto", align: "left center", gap: 10 });
|
|
557
|
+
|
|
558
|
+
VGroup({ width: "auto", height: "auto", align: "left top", gap: 2 });
|
|
559
|
+
that.elem.style.flex = "1 1 auto";
|
|
560
|
+
|
|
561
|
+
HGroup({ width: "auto", height: "auto", align: "left center", gap: 10 });
|
|
562
|
+
Label({ text: order.id, fontSize: 20, textColor: Ink(0.95) });
|
|
563
|
+
that.elem.style.fontFamily = "opensans-bold";
|
|
564
|
+
Label({ text: status.label.toUpperCase(), fontSize: 11, textColor: status.color, color: OrdersPage.alpha(status.color, 0.15), round: 6, padding: [8, 3] });
|
|
565
|
+
that.elem.style.letterSpacing = "1px";
|
|
566
|
+
endGroup();
|
|
567
|
+
|
|
568
|
+
Label({ text: new Date(order.time).toLocaleString("en-GB", { dateStyle: "long", timeStyle: "short" }) + " · " + escape(order.payment), fontSize: 13, textColor: Ink(0.5) });
|
|
569
|
+
|
|
570
|
+
endGroup();
|
|
571
|
+
|
|
572
|
+
Icon({ width: 28, height: 28, clickable: 1 });
|
|
573
|
+
that.load("assets/close.png");
|
|
574
|
+
that.elem.style.filter = T.iconFilter;
|
|
575
|
+
that.elem.style.cursor = "pointer";
|
|
576
|
+
that.opacity = 0.6;
|
|
577
|
+
that.on("click", function() {
|
|
578
|
+
rightView.hide();
|
|
579
|
+
rightView.clean();
|
|
580
|
+
});
|
|
581
|
+
|
|
582
|
+
endGroup();
|
|
583
|
+
|
|
584
|
+
// NEXT STEP
|
|
585
|
+
const initNextStep = function() {
|
|
586
|
+
|
|
587
|
+
if (order.status == "pending") {
|
|
588
|
+
startSection("Next step");
|
|
589
|
+
Label({ text: "A new order. Check the payment and start preparing it.", fontSize: 14, textColor: Ink(0.8), width: "100%" });
|
|
590
|
+
OrdersPage.createButton("Start Processing", "", function() {
|
|
591
|
+
updateOrder({ status: "processing" }, "Order is being prepared", "processing");
|
|
592
|
+
}, { primary: 1 });
|
|
593
|
+
endGroup();
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
if (order.status == "processing") {
|
|
597
|
+
|
|
598
|
+
startSection("Ship the order");
|
|
599
|
+
|
|
600
|
+
let carrierId = OrdersPage.CARRIERS[0];
|
|
601
|
+
|
|
602
|
+
HGroup({ width: "100%", height: "auto", align: "left bottom", gap: 10 });
|
|
603
|
+
|
|
604
|
+
VGroup({ width: "auto", height: "auto", align: "left top", gap: 6 });
|
|
605
|
+
Label({ text: "CARRIER", fontSize: 11, textColor: Ink(0.45) });
|
|
606
|
+
that.elem.style.letterSpacing = "1px";
|
|
607
|
+
OrdersPage.createTinySelect(OrdersPage.CARRIERS.map(function(name) { return { id: name, label: name }; }), function(id) { carrierId = id; });
|
|
608
|
+
endGroup();
|
|
609
|
+
|
|
610
|
+
const trackingInput = createDarkInput({
|
|
611
|
+
titleText: "TRACKING NUMBER",
|
|
612
|
+
placeholder: "At least 8 letters or numbers",
|
|
613
|
+
maxChar: 30,
|
|
614
|
+
warningText: "At least 8 letters or numbers",
|
|
615
|
+
onEdit: function() {
|
|
616
|
+
setInteractive(btnShip, trackingInput.isValid() == 1);
|
|
617
|
+
},
|
|
618
|
+
});
|
|
619
|
+
trackingInput.isValid = function() {
|
|
620
|
+
return /^[A-Za-z0-9-]{8,}$/.test(trackingInput.getInputValue().trim()) ? 1 : 0;
|
|
621
|
+
};
|
|
622
|
+
trackingInput.elem.style.flex = "1 1 auto";
|
|
623
|
+
|
|
624
|
+
endGroup();
|
|
625
|
+
|
|
626
|
+
const btnShip = OrdersPage.createButton("Mark as Shipped", "", function() {
|
|
627
|
+
const tracking = trackingInput.getInputValue().trim().toUpperCase();
|
|
628
|
+
updateOrder({ status: "shipped", carrier: carrierId, tracking: tracking }, "Shipped with " + carrierId + " (" + tracking + ")", "shipped");
|
|
629
|
+
}, { primary: 1 });
|
|
630
|
+
setInteractive(btnShip, false);
|
|
631
|
+
|
|
632
|
+
endGroup();
|
|
633
|
+
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
if (order.status == "shipped") {
|
|
637
|
+
startSection("Next step");
|
|
638
|
+
Label({ text: "Shipped with " + escape(order.carrier) + ". Tracking number: <b>" + escape(order.tracking) + "</b>", fontSize: 14, textColor: Ink(0.8), width: "100%" });
|
|
639
|
+
OrdersPage.createButton("Mark as Delivered", "", function() {
|
|
640
|
+
updateOrder({ status: "delivered" }, "Delivered to the customer", "delivered");
|
|
641
|
+
}, { primary: 1 });
|
|
642
|
+
endGroup();
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
};
|
|
646
|
+
|
|
647
|
+
initNextStep();
|
|
648
|
+
|
|
649
|
+
// ITEMS AND TOTALS
|
|
650
|
+
startSection("Items");
|
|
651
|
+
|
|
652
|
+
const table = TinyTable({
|
|
653
|
+
columns: Theme.tableColumns(["PRODUCT", "QTY", "PRICE", "TOTAL"], ["46%", "12%", "20%", "20%"], ["left", "right", "right", "right"]),
|
|
654
|
+
rows: order.items.map(function(item) {
|
|
655
|
+
return [escape(item.name) + "<br><span style='font-size:12px; color:" + Ink(0.4) + "'>" + escape(item.sku) + "</span>", String(item.qty), OrdersPage.formatMoney(item.price), OrdersPage.formatMoney(item.qty * item.price)];
|
|
656
|
+
}),
|
|
657
|
+
allowHtml: 1, // (the texts are made by the panel, user texts are escaped)
|
|
658
|
+
style: Theme.tableStyle({ headerColor: S.FIELD_COLOR, bodyColor: S.CARD_COLOR, borderColor: S.CARD_BORDER_COLOR, textColor: Ink(0.85) }),
|
|
659
|
+
onCellCreate: function(cell) {
|
|
660
|
+
if (cell.columnIndex == 0) cell.label.elem.style.whiteSpace = "normal"; // (the SKU under the name)
|
|
661
|
+
},
|
|
662
|
+
});
|
|
663
|
+
Theme.fillTableWidth(table);
|
|
664
|
+
// WHY: The align of a column is only for its cells. Number columns get right aligned titles too.
|
|
665
|
+
table.titleList.forEach(function(title, index) {
|
|
666
|
+
if (index > 0) title.label.textAlign = "right";
|
|
667
|
+
});
|
|
668
|
+
|
|
669
|
+
VGroup({ width: "100%", height: "auto", align: "left top", gap: 4 });
|
|
670
|
+
that.elem.style.marginTop = "6px";
|
|
671
|
+
createInfoLine("Subtotal", OrdersPage.formatMoney(order.subtotal));
|
|
672
|
+
createInfoLine("Shipping", (order.shipping) ? OrdersPage.formatMoney(order.shipping) : "Free");
|
|
673
|
+
if (order.discount) createInfoLine("Discount", "−" + OrdersPage.formatMoney(order.discount), { textColor: S.ACCENT_COLOR });
|
|
674
|
+
createInfoLine("<b>Total</b>", "<b>" + OrdersPage.formatMoney(order.total) + "</b>", { fontSize: 16 });
|
|
675
|
+
endGroup();
|
|
676
|
+
|
|
677
|
+
endGroup();
|
|
678
|
+
|
|
679
|
+
// CUSTOMER
|
|
680
|
+
startSection("Customer");
|
|
681
|
+
|
|
682
|
+
Label({ text: escape(order.customer.name), fontSize: 16, textColor: Ink(0.95) });
|
|
683
|
+
Label({ text: escape(order.customer.email) + " · " + escape(order.customer.phone), fontSize: 13, textColor: Ink(0.55), width: "100%" });
|
|
684
|
+
|
|
685
|
+
Label({ text: "SHIPPING ADDRESS", fontSize: 11, textColor: Ink(0.45) });
|
|
686
|
+
that.elem.style.letterSpacing = "1px";
|
|
687
|
+
that.elem.style.marginTop = "6px";
|
|
688
|
+
Label({ text: escape(order.address), fontSize: 14, textColor: Ink(0.85), width: "100%" });
|
|
689
|
+
|
|
690
|
+
HGroup({ width: "100%", height: "auto", align: "left center", gap: 8 });
|
|
691
|
+
that.elem.style.marginTop = "4px";
|
|
692
|
+
OrdersPage.createButton("E-mail Customer", "", function() {
|
|
693
|
+
window.location.href = "mailto:" + encodeURIComponent(order.customer.email) + "?subject=" + encodeURIComponent("Your order " + order.id);
|
|
694
|
+
});
|
|
695
|
+
OrdersPage.createButton("Print Invoice", "", function() {
|
|
696
|
+
OrdersPage.printInvoice(order);
|
|
697
|
+
});
|
|
698
|
+
endGroup();
|
|
699
|
+
|
|
700
|
+
endGroup();
|
|
701
|
+
|
|
702
|
+
// TIMELINE
|
|
703
|
+
startSection("Timeline");
|
|
704
|
+
|
|
705
|
+
// Newest first
|
|
706
|
+
order.history.slice().reverse().forEach(function(entry, index, list) {
|
|
707
|
+
|
|
708
|
+
const color = (OrdersPage.STATUSES[entry.type]) ? OrdersPage.STATUSES[entry.type].color : Ink(0.5);
|
|
709
|
+
|
|
710
|
+
HGroup({ width: "100%", height: "auto", align: "left top", gap: 12 });
|
|
711
|
+
|
|
712
|
+
// Dot and line
|
|
713
|
+
VGroup({ width: 12, height: "auto", align: "center top", gap: 0 });
|
|
714
|
+
that.elem.style.alignSelf = "stretch";
|
|
715
|
+
Box({ width: 10, height: 10, round: 100, color: color });
|
|
716
|
+
that.elem.style.marginTop = "5px";
|
|
717
|
+
if (index < list.length - 1) {
|
|
718
|
+
Box({ width: 2, height: "auto", color: Ink(0.1) });
|
|
719
|
+
that.elem.style.flex = "1 1 auto";
|
|
720
|
+
that.elem.style.minHeight = "20px";
|
|
721
|
+
}
|
|
722
|
+
endGroup();
|
|
723
|
+
|
|
724
|
+
VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
|
|
725
|
+
that.elem.style.flex = "1 1 auto";
|
|
726
|
+
that.elem.style.minWidth = "0";
|
|
727
|
+
that.elem.style.paddingBottom = "12px";
|
|
728
|
+
Label({ text: escape(entry.text), fontSize: 14, textColor: (entry.type == "note") ? Theme.readable("#E8D9A8") : Ink(0.9), width: "100%" });
|
|
729
|
+
Label({ text: new Date(entry.time).toLocaleString("en-GB", { dateStyle: "medium", timeStyle: "short" }) + " · " + escape(entry.by), fontSize: 12, textColor: Ink(0.45) });
|
|
730
|
+
endGroup();
|
|
731
|
+
|
|
732
|
+
endGroup();
|
|
733
|
+
|
|
734
|
+
});
|
|
735
|
+
|
|
736
|
+
// Internal note
|
|
737
|
+
HGroup({ width: "100%", height: "auto", align: "left bottom", gap: 8 });
|
|
738
|
+
|
|
739
|
+
const noteInput = createDarkInput({
|
|
740
|
+
titleText: "INTERNAL NOTE",
|
|
741
|
+
placeholder: "Only the team can see it",
|
|
742
|
+
maxChar: 200,
|
|
743
|
+
});
|
|
744
|
+
noteInput.elem.style.flex = "1 1 auto";
|
|
745
|
+
|
|
746
|
+
OrdersPage.createButton("Add", "", function() {
|
|
747
|
+
const text = noteInput.getInputValue().trim();
|
|
748
|
+
if (!text) return;
|
|
749
|
+
updateOrder({}, "Note: " + text, "note");
|
|
750
|
+
});
|
|
751
|
+
|
|
752
|
+
endGroup();
|
|
753
|
+
|
|
754
|
+
endGroup();
|
|
755
|
+
|
|
756
|
+
endGroup();
|
|
757
|
+
|
|
758
|
+
endBox();
|
|
759
|
+
|
|
760
|
+
// GROUP: Buttons (bottom)
|
|
761
|
+
HGroup({ left: 0, bottom: 0, width: "100%", height: 76, align: "left center", gap: 8, padding: [20, 0] });
|
|
762
|
+
that.elem.style.borderTop = "1px solid " + Ink(0.08);
|
|
763
|
+
|
|
764
|
+
const canCancel = ["pending", "processing"].includes(order.status);
|
|
765
|
+
const canRefund = ["shipped", "delivered"].includes(order.status);
|
|
766
|
+
|
|
767
|
+
if (canCancel) {
|
|
768
|
+
OrdersPage.createButton("Cancel Order", "", function() {
|
|
769
|
+
Theme.confirm({
|
|
770
|
+
titleText: "Cancel Order",
|
|
771
|
+
messageText: "<b>" + order.id + "</b> will be cancelled and the payment of <b>" + OrdersPage.formatMoney(order.total) + "</b> will be returned to the customer.",
|
|
772
|
+
confirmText: "Cancel Order",
|
|
773
|
+
cancelText: "Keep",
|
|
774
|
+
onAnswer: function(isConfirmed) {
|
|
775
|
+
if (isConfirmed && box) updateOrder({ status: "cancelled" }, "Order is cancelled, payment is returned", "cancelled");
|
|
776
|
+
},
|
|
777
|
+
});
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
if (canRefund) {
|
|
782
|
+
// WHY: Hold to confirm, so money is not refunded by mistake.
|
|
783
|
+
const btnRefund = HoldToConfirmButton({
|
|
784
|
+
height: 40,
|
|
785
|
+
labelText: "Hold to Refund " + OrdersPage.formatMoney(order.total),
|
|
786
|
+
completedText: "REFUNDED",
|
|
787
|
+
iconFile: "_basic/comp/hold-to-confirm-button/trash.png",
|
|
788
|
+
holdingIconFile: "_basic/comp/hold-to-confirm-button/trash-red.png",
|
|
789
|
+
holdDuration: 1500,
|
|
790
|
+
resetDelay: 600,
|
|
791
|
+
style: {
|
|
792
|
+
layout: { gap: 6, padding: [14, 0] },
|
|
793
|
+
icon: { width: 0, height: 0 },
|
|
794
|
+
label: { fontSize: 14, textColor: Ink(0.9) },
|
|
795
|
+
holdingLabel: { fontSize: 14, textColor: "#B03A2E" },
|
|
796
|
+
completedLabel: { fontSize: 14, textColor: T.primaryActive },
|
|
797
|
+
box: { color: S.FIELD_COLOR, border: 1, borderColor: S.CARD_BORDER_COLOR, round: 8 },
|
|
798
|
+
holdingBox: { color: "#FFD1CB", borderColor: S.ERROR_COLOR, round: 8 },
|
|
799
|
+
completedBox: { color: "#DFEFE6", borderColor: S.ACCENT_COLOR, round: 8 },
|
|
800
|
+
},
|
|
801
|
+
onConfirm: function() {
|
|
802
|
+
updateOrder({ status: "refunded" }, "Refunded " + OrdersPage.formatMoney(order.total), "refunded");
|
|
803
|
+
},
|
|
804
|
+
});
|
|
805
|
+
// WHY: No icon. (Icon size 0 still keeps the gap.)
|
|
806
|
+
btnRefund.icon.visible = 0;
|
|
807
|
+
btnRefund.iconRed.visible = 0;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
if (!canCancel && !canRefund) {
|
|
811
|
+
Label({ text: "No more actions for a " + status.label.toLowerCase() + " order.", fontSize: 13, textColor: Ink(0.45) });
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
endGroup();
|
|
815
|
+
|
|
816
|
+
// *** INIT CODE:
|
|
817
|
+
|
|
818
|
+
rightView.clean();
|
|
819
|
+
rightView.setKey(OrderDetails.KEY);
|
|
820
|
+
rightView.setWidth(520);
|
|
821
|
+
rightView.add(box);
|
|
822
|
+
rightView.show();
|
|
823
|
+
rightView.destroyPage = box.destroy;
|
|
824
|
+
|
|
825
|
+
return endObject(box);
|
|
826
|
+
|
|
827
|
+
};
|
|
828
|
+
|
|
829
|
+
OrderDetails.KEY = "OrderDetails";
|
|
830
|
+
|
|
831
|
+
// *** STATIC: STYLE AND HELPERS
|
|
832
|
+
|
|
833
|
+
OrdersPage.STYLE = {
|
|
834
|
+
CARD_COLOR: T.surface,
|
|
835
|
+
CARD_BORDER_COLOR: Ink(0.1),
|
|
836
|
+
FIELD_COLOR: T.surface2,
|
|
837
|
+
PRIMARY_COLOR: T.primary,
|
|
838
|
+
ACCENT_COLOR: T.accent,
|
|
839
|
+
ERROR_COLOR: T.danger,
|
|
840
|
+
};
|
|
841
|
+
|
|
842
|
+
OrdersPage.STATUSES = {
|
|
843
|
+
pending: { label: "Pending", color: T.warning },
|
|
844
|
+
processing: { label: "Processing", color: T.info },
|
|
845
|
+
shipped: { label: "Shipped", color: "#9085E9" },
|
|
846
|
+
delivered: { label: "Delivered", color: T.accent },
|
|
847
|
+
cancelled: { label: "Cancelled", color: Theme.readable("#A9A79F") },
|
|
848
|
+
refunded: { label: "Refunded", color: T.danger },
|
|
849
|
+
};
|
|
850
|
+
|
|
851
|
+
OrdersPage.PAYMENTS = ["Credit card", "PayPal", "Bank transfer", "Cash on delivery"];
|
|
852
|
+
OrdersPage.CARRIERS = ["Yurtici Kargo", "Aras Kargo", "MNG Kargo", "UPS", "DHL"];
|
|
853
|
+
|
|
854
|
+
OrdersPage.getStatusByLabel = function(label) {
|
|
855
|
+
const id = Object.keys(OrdersPage.STATUSES).find(function(key) { return OrdersPage.STATUSES[key].label == label; });
|
|
856
|
+
return (id) ? OrdersPage.STATUSES[id] : null;
|
|
857
|
+
};
|
|
858
|
+
|
|
859
|
+
OrdersPage.formatMoney = function(value) {
|
|
860
|
+
return "$" + value.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
861
|
+
};
|
|
862
|
+
|
|
863
|
+
// Local time: "2026-09-16 14:05" (sortable text)
|
|
864
|
+
OrdersPage.formatDateTime = function(time) {
|
|
865
|
+
const d = new Date(time);
|
|
866
|
+
const pad = function(n) { return String(n).padStart(2, "0"); };
|
|
867
|
+
return d.getFullYear() + "-" + pad(d.getMonth() + 1) + "-" + pad(d.getDate()) + " " + pad(d.getHours()) + ":" + pad(d.getMinutes());
|
|
868
|
+
};
|
|
869
|
+
|
|
870
|
+
OrdersPage.escapeHtml = function(text) {
|
|
871
|
+
return String(text).replace(/[&<>"']/g, function(c) { return { "&": "&", "<": "<", ">": ">", "\"": """, "'": "'" }[c]; });
|
|
872
|
+
};
|
|
873
|
+
|
|
874
|
+
// T.accent, 0.2 -> "rgba(101, 162, 147, 0.2)"
|
|
875
|
+
OrdersPage.alpha = function(hex, alpha) {
|
|
876
|
+
const n = parseInt(hex.slice(1), 16);
|
|
877
|
+
return "rgba(" + (n >> 16) + ", " + ((n >> 8) & 255) + ", " + (n & 255) + ", " + alpha + ")";
|
|
878
|
+
};
|
|
879
|
+
|
|
880
|
+
// params: { primary: 1, width }
|
|
881
|
+
OrdersPage.createButton = function(text, iconFile, onClick, params = {}) {
|
|
882
|
+
const S = OrdersPage.STYLE;
|
|
883
|
+
const btn = SmartButton({
|
|
884
|
+
styleName: "classic",
|
|
885
|
+
width: params.width || "auto",
|
|
886
|
+
labelText: text,
|
|
887
|
+
iconFile: iconFile || "",
|
|
888
|
+
onClick: onClick,
|
|
889
|
+
style: {
|
|
890
|
+
layout: { gap: 8, padding: [14, 8] },
|
|
891
|
+
icon: { width: 18, height: 18 },
|
|
892
|
+
label: { fontSize: 14, textColor: Ink(0.92) },
|
|
893
|
+
box: { color: (params.primary) ? S.PRIMARY_COLOR : S.FIELD_COLOR, border: 1, borderColor: S.CARD_BORDER_COLOR, round: 8 },
|
|
894
|
+
hover: { color: (params.primary) ? T.primaryHover : T.surface3 },
|
|
895
|
+
active: { color: (params.primary) ? T.primaryActive : T.surface4 },
|
|
896
|
+
},
|
|
897
|
+
});
|
|
898
|
+
if (btn.icon) btn.icon.elem.style.filter = T.iconFilter; // WHY: Panel icons are black.
|
|
899
|
+
return btn;
|
|
900
|
+
};
|
|
901
|
+
|
|
902
|
+
// selectedIndex: The first selected item
|
|
903
|
+
OrdersPage.createTinySelect = function(list, onSelect, selectedIndex = 0) {
|
|
904
|
+
const S = OrdersPage.STYLE;
|
|
905
|
+
let isReady = 0; // WHY: TinySelect calls onSelect when it is created.
|
|
906
|
+
const select = TinySelect({
|
|
907
|
+
list: list,
|
|
908
|
+
selectedIndex: selectedIndex,
|
|
909
|
+
height: 40,
|
|
910
|
+
fontSize: 14,
|
|
911
|
+
color: S.FIELD_COLOR,
|
|
912
|
+
border: 1,
|
|
913
|
+
borderColor: S.CARD_BORDER_COLOR,
|
|
914
|
+
round: 8,
|
|
915
|
+
labelBoldFont: 0,
|
|
916
|
+
labelTextColor: Ink(0.9),
|
|
917
|
+
arrowIcon: "_basic/comp/tiny-select/arrow.svg",
|
|
918
|
+
arrowSize: 18,
|
|
919
|
+
invertIconColor: T.invertIcon,
|
|
920
|
+
listFontSize: 14,
|
|
921
|
+
listTextColor: Ink(0.85),
|
|
922
|
+
listOverTextColor: S.ACCENT_COLOR,
|
|
923
|
+
listBackgroundColor: S.FIELD_COLOR,
|
|
924
|
+
listBorderColor: Ink(0.15),
|
|
925
|
+
onSelect: function(index, id) {
|
|
926
|
+
if (isReady) onSelect(id);
|
|
927
|
+
},
|
|
928
|
+
});
|
|
929
|
+
isReady = 1;
|
|
930
|
+
return select;
|
|
931
|
+
};
|
|
932
|
+
|
|
933
|
+
OrdersPage.getSmartTableStyle = function(libPath) {
|
|
934
|
+
const S = OrdersPage.STYLE;
|
|
935
|
+
return {
|
|
936
|
+
scrollBarParams: {
|
|
937
|
+
bar_border: 0, bar_round: 3, bar_borderColor: Ink(0.15), bar_width: 4, bar_mouseOverWidth: 4,
|
|
938
|
+
bar_mouseOverColor: T.scrollBar, bar_opacity: 0.4, bar_mouseOverOpacity: 0.9, bar_padding: 2, bar_color: T.scrollBar,
|
|
939
|
+
neverHide: 0, showDots: 0,
|
|
940
|
+
},
|
|
941
|
+
// WHY: Filtre kutusu ile alt bar aynı renkti, kutu görünmüyordu. Bar kart rengine, kutu ise alan rengine (FIELD_COLOR) alındı.
|
|
942
|
+
searchInputParams: {
|
|
943
|
+
width: "50%", height: 34, border: 1, round: 8, color: S.FIELD_COLOR, borderColor: S.CARD_BORDER_COLOR,
|
|
944
|
+
borderBottomStyle: "1px solid " + S.CARD_BORDER_COLOR,
|
|
945
|
+
textColor: Ink(0.9), placeholderColor: Ink(0.4), fontSize: 14,
|
|
946
|
+
placeholderText: "Filter the table",
|
|
947
|
+
searchIconSize: 15, searchIconOpacity: 0.55, invertIconColor: T.invertIcon,
|
|
948
|
+
searchIconFile: libPath + "comp/search-input-v2/filter.png",
|
|
949
|
+
clearIconFile: libPath + "comp/search-input-v2/clear.svg",
|
|
950
|
+
},
|
|
951
|
+
// Filtre kutusundaki sütun seçim listesi (ALL) de koyu tema ile açılsın.
|
|
952
|
+
searchTitleMenuParams: {
|
|
953
|
+
minWidth: 170,
|
|
954
|
+
style: {
|
|
955
|
+
menu: { color: S.FIELD_COLOR, border: 1, borderColor: Ink(0.12), round: 8, padding: 4, shadow: "0 8px 24px " + Black(0.5) },
|
|
956
|
+
item: { height: 30, fontSize: 13, textColor: Ink(0.75), color: "transparent", round: 6, padding: 10, gap: 10 },
|
|
957
|
+
itemHover: { textColor: "white", color: Ink(0.08) },
|
|
958
|
+
disabled: { textColor: Ink(0.3), opacity: 0.4 },
|
|
959
|
+
icon: { width: 14, height: 14 },
|
|
960
|
+
separator: { color: Ink(0.1), space: 4 },
|
|
961
|
+
},
|
|
962
|
+
},
|
|
963
|
+
style: {
|
|
964
|
+
width: "100%",
|
|
965
|
+
height: "100%",
|
|
966
|
+
round: 8,
|
|
967
|
+
line1Color: S.CARD_COLOR,
|
|
968
|
+
line2Color: T.tableRow2,
|
|
969
|
+
highlightItemCellColor: T.tableHighlight,
|
|
970
|
+
highlightTitleCellColor: Ink(0.08),
|
|
971
|
+
verticalScrollWidth: 20,
|
|
972
|
+
verticalScrollMargin: 2,
|
|
973
|
+
btnScrollDownIconFile: libPath + "comp/smart-table/down.png",
|
|
974
|
+
btnScrollUpIconFile: libPath + "comp/smart-table/up.png",
|
|
975
|
+
btnScrollCenterIconFile: libPath + "comp/smart-table/scroll.png",
|
|
976
|
+
sortIconFile: libPath + "comp/smart-table/sort.png",
|
|
977
|
+
// WHY: Varsayılan tik ikonu koyu renkli; koyu menüde görünmüyordu.
|
|
978
|
+
searchTitleCheckIconFile: "data:image/svg+xml," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="' + S.ACCENT_COLOR + '" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12.5 10 17.5 19 7"/></svg>'),
|
|
979
|
+
loadingIconFile: libPath + "comp/smart-table/clock.png",
|
|
980
|
+
invertIconColor: T.invertIcon,
|
|
981
|
+
box: { color: S.CARD_COLOR },
|
|
982
|
+
boxBorder: { border: 1, borderColor: S.CARD_BORDER_COLOR },
|
|
983
|
+
boxTitleLine: { color: S.FIELD_COLOR },
|
|
984
|
+
boxTitleCell: { padding: [10, 0], borderRight: "1px solid " + Ink(0.06), borderBottom: "1px solid " + Ink(0.12) },
|
|
985
|
+
lblTitleCell: { fontSize: 13, fontFamily: "opensans", textColor: Ink(0.6) },
|
|
986
|
+
boxItemCell: { borderBottom: "1px solid " + Ink(0.05), borderRight: "1px solid " + Ink(0.03), padding: [10, 0] },
|
|
987
|
+
lblItemCell: { fontSize: 14, textColor: Ink(0.75), fontFamily: "opensans" },
|
|
988
|
+
boxInfoLine: { color: S.CARD_COLOR, borderTop: "1px solid " + Ink(0.08) },
|
|
989
|
+
lblBoxInfoLine: { fontSize: 13, textColor: Ink(0.55) },
|
|
990
|
+
lblNoDataFound: { color: T.surface3, textColor: Ink(0.6), padding: [8, 2], fontSize: 13, round: 8, border: 1, borderColor: Ink(0.15) },
|
|
991
|
+
// Filtre kutusunun içindeki sütun etiketi: Kutunun içinde durduğu için daha hafif bir chip.
|
|
992
|
+
lblSearchTitle: { color: Ink(0.08), textColor: Ink(0.6), padding: [8, 1], fontSize: 12, round: 6, border: 1, borderColor: Ink(0.14) },
|
|
993
|
+
btnScrollCenter: { color: T.surface3, round: 100, borderColor: Ink(0.2), border: 1 },
|
|
994
|
+
btnScrollUp: { color: T.surface4, round: 100, border: 1, borderColor: Ink(0.3) },
|
|
995
|
+
btnScrollDown: { color: T.surface4, round: 100, border: 1, borderColor: Ink(0.3) },
|
|
996
|
+
boxSort: { color: S.PRIMARY_COLOR },
|
|
997
|
+
},
|
|
998
|
+
};
|
|
999
|
+
};
|
|
1000
|
+
|
|
1001
|
+
// Opens a simple invoice in a new window and prints it.
|
|
1002
|
+
OrdersPage.printInvoice = function(order) {
|
|
1003
|
+
|
|
1004
|
+
const escape = OrdersPage.escapeHtml;
|
|
1005
|
+
const money = OrdersPage.formatMoney;
|
|
1006
|
+
|
|
1007
|
+
const rows = order.items.map(function(item) {
|
|
1008
|
+
return "<tr><td>" + escape(item.name) + "<br><small>" + escape(item.sku) + "</small></td><td class='r'>" + item.qty + "</td><td class='r'>" + money(item.price) + "</td><td class='r'>" + money(item.qty * item.price) + "</td></tr>";
|
|
1009
|
+
}).join("");
|
|
1010
|
+
|
|
1011
|
+
const html = "<!DOCTYPE html><html><head><meta charset='UTF-8'><title>Invoice " + escape(order.id) + "</title>" +
|
|
1012
|
+
"<style>body{font-family:system-ui,sans-serif;color:#222;margin:40px}table{width:100%;border-collapse:collapse;margin-top:24px}" +
|
|
1013
|
+
"th,td{padding:8px;border-bottom:1px solid #ddd;text-align:left}.r{text-align:right}small{color:#888}h1{margin:0}</style></head><body>" +
|
|
1014
|
+
"<h1>Invoice</h1><p>" + escape(order.id) + " · " + new Date(order.time).toLocaleDateString("en-GB", { dateStyle: "long" }) + "</p>" +
|
|
1015
|
+
"<p><b>" + escape(order.customer.name) + "</b><br>" + escape(order.address) + "<br>" + escape(order.customer.email) + "</p>" +
|
|
1016
|
+
"<table><tr><th>Product</th><th class='r'>Qty</th><th class='r'>Price</th><th class='r'>Total</th></tr>" + rows +
|
|
1017
|
+
"<tr><td colspan='3' class='r'>Subtotal</td><td class='r'>" + money(order.subtotal) + "</td></tr>" +
|
|
1018
|
+
"<tr><td colspan='3' class='r'>Shipping</td><td class='r'>" + money(order.shipping) + "</td></tr>" +
|
|
1019
|
+
((order.discount) ? "<tr><td colspan='3' class='r'>Discount</td><td class='r'>−" + money(order.discount) + "</td></tr>" : "") +
|
|
1020
|
+
"<tr><th colspan='3' class='r'>Total</th><th class='r'>" + money(order.total) + "</th></tr></table>" +
|
|
1021
|
+
"<p><small>Payment: " + escape(order.payment) + "</small></p></body></html>";
|
|
1022
|
+
|
|
1023
|
+
const win = window.open("", "_blank");
|
|
1024
|
+
if (!win) return; // Pop-up blocked
|
|
1025
|
+
win.document.write(html);
|
|
1026
|
+
win.document.close();
|
|
1027
|
+
win.focus();
|
|
1028
|
+
win.print();
|
|
1029
|
+
|
|
1030
|
+
};
|
|
1031
|
+
|
|
1032
|
+
// *** STATIC: TEST DATA
|
|
1033
|
+
|
|
1034
|
+
OrdersPage._orders = null;
|
|
1035
|
+
|
|
1036
|
+
// Orders of the last 60 days, newest first. Created one time and kept while the panel is open.
|
|
1037
|
+
// TODO: Load the orders from your service (with paging and filters).
|
|
1038
|
+
OrdersPage.getOrders = function() {
|
|
1039
|
+
|
|
1040
|
+
if (OrdersPage._orders) return OrdersPage._orders;
|
|
1041
|
+
|
|
1042
|
+
// Random numbers with a seed: the same test data every time. (mulberry32)
|
|
1043
|
+
let seed = 104582;
|
|
1044
|
+
const rnd = function() {
|
|
1045
|
+
seed = (seed + 0x6D2B79F5) | 0;
|
|
1046
|
+
let t = seed;
|
|
1047
|
+
t = Math.imul(t ^ (t >>> 15), t | 1);
|
|
1048
|
+
t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
|
|
1049
|
+
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
|
|
1050
|
+
};
|
|
1051
|
+
const pick = function(list) { return list[Math.floor(rnd() * list.length)]; };
|
|
1052
|
+
|
|
1053
|
+
const CUSTOMERS = [
|
|
1054
|
+
["Selin Koc", "selin.koc@mail.com", "Moda Cad. 24, Kadikoy, Istanbul"],
|
|
1055
|
+
["Emre Gunes", "emre.gunes@mail.com", "Ataturk Bulvari 118, Cankaya, Ankara"],
|
|
1056
|
+
["Yasemin Dogan", "yasemin.d@mail.com", "Kordon Boyu 7, Alsancak, Izmir"],
|
|
1057
|
+
["Tarik Yilmaz", "tarik.yilmaz@mail.com", "Bagdat Cad. 310, Maltepe, Istanbul"],
|
|
1058
|
+
["Hakan Bulut", "hakan.bulut@mail.com", "Nilufer Sok. 3, Nilufer, Bursa"],
|
|
1059
|
+
["Deniz Arslan", "deniz.arslan@mail.com", "Liman Cad. 12, Muratpasa, Antalya"],
|
|
1060
|
+
["Anna Schmidt", "anna.schmidt@mail.de", "Hauptstrasse 5, 10115 Berlin"],
|
|
1061
|
+
["Mert Aksoy", "mert.aksoy@mail.com", "Istiklal Cad. 88, Beyoglu, Istanbul"],
|
|
1062
|
+
["Ece Yurt", "ece.yurt@mail.com", "Cumhuriyet Mah. 41, Eskisehir"],
|
|
1063
|
+
["Can Ozturk", "can.ozturk@mail.com", "Sahil Yolu 19, Mezitli, Mersin"],
|
|
1064
|
+
];
|
|
1065
|
+
|
|
1066
|
+
const PRODUCTS = [
|
|
1067
|
+
["HP-BLK-01", "Wireless Headphones (Black)", 129],
|
|
1068
|
+
["SW-FIT-02", "Smart Watch Fit 2", 189],
|
|
1069
|
+
["SH-RUN-42", "Running Shoes (42)", 95],
|
|
1070
|
+
["MG-CER-01", "Ceramic Coffee Mug", 14.9],
|
|
1071
|
+
["BP-GRY-20", "Backpack 20L (Grey)", 59],
|
|
1072
|
+
["LM-DSK-01", "Desk Lamp (Warm)", 42.5],
|
|
1073
|
+
["BK-JS-101", "Book: Modern JavaScript", 29],
|
|
1074
|
+
["CB-USB-C2", "USB-C Cable (2 m)", 9.9],
|
|
1075
|
+
];
|
|
1076
|
+
|
|
1077
|
+
const now = Date.now();
|
|
1078
|
+
const list = [];
|
|
1079
|
+
|
|
1080
|
+
for (let i = 0; i < 600; i++) {
|
|
1081
|
+
|
|
1082
|
+
// More orders in the recent days
|
|
1083
|
+
const time = now - Math.pow(rnd(), 1.3) * 60 * 86400000;
|
|
1084
|
+
const age = (now - time) / 86400000; // days
|
|
1085
|
+
const customer = pick(CUSTOMERS);
|
|
1086
|
+
|
|
1087
|
+
const items = [];
|
|
1088
|
+
const itemCount = 1 + Math.floor(Math.pow(rnd(), 2) * 3);
|
|
1089
|
+
for (let j = 0; j < itemCount; j++) {
|
|
1090
|
+
const product = pick(PRODUCTS);
|
|
1091
|
+
if (items.some(function(item) { return item.sku == product[0]; })) continue;
|
|
1092
|
+
items.push({ sku: product[0], name: product[1], price: product[2], qty: 1 + Math.floor(Math.pow(rnd(), 3) * 3) });
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
const subtotal = Math.round(items.reduce(function(sum, item) { return sum + item.qty * item.price; }, 0) * 100) / 100;
|
|
1096
|
+
const shipping = (subtotal >= 100) ? 0 : 9.9;
|
|
1097
|
+
const discount = (rnd() < 0.15) ? Math.round(subtotal * 0.1 * 100) / 100 : 0;
|
|
1098
|
+
const total = Math.round((subtotal + shipping - discount) * 100) / 100;
|
|
1099
|
+
|
|
1100
|
+
// Status by age
|
|
1101
|
+
const r = rnd();
|
|
1102
|
+
let status;
|
|
1103
|
+
if (age < 0.5) status = (r < 0.6) ? "pending" : "processing";
|
|
1104
|
+
else if (age < 2) status = (r < 0.15) ? "pending" : (r < 0.7) ? "processing" : "shipped";
|
|
1105
|
+
else if (age < 6) status = (r < 0.1) ? "processing" : (r < 0.6) ? "shipped" : "delivered";
|
|
1106
|
+
else status = "delivered";
|
|
1107
|
+
if (rnd() < 0.04) status = "cancelled";
|
|
1108
|
+
else if (age > 3 && rnd() < 0.035) status = "refunded";
|
|
1109
|
+
|
|
1110
|
+
const carrier = pick(OrdersPage.CARRIERS);
|
|
1111
|
+
const tracking = carrier.slice(0, 2).toUpperCase() + String(Math.floor(rnd() * 1e10)).padStart(10, "0");
|
|
1112
|
+
|
|
1113
|
+
// History
|
|
1114
|
+
const history = [{ time: time, text: "Order is placed (" + OrdersPage.formatMoney(total) + ")", type: "pending", by: "Customer" }];
|
|
1115
|
+
const step = function(hours, text, type) {
|
|
1116
|
+
history.push({ time: Math.min(now, time + hours * 3600000), text: text, type: type, by: pick(["Deniz Arslan", "Ceren Aktas", "System"]) });
|
|
1117
|
+
};
|
|
1118
|
+
if (["processing", "shipped", "delivered", "refunded"].includes(status)) step(3 + rnd() * 5, "Order is being prepared", "processing");
|
|
1119
|
+
if (["shipped", "delivered", "refunded"].includes(status)) step(20 + rnd() * 20, "Shipped with " + carrier + " (" + tracking + ")", "shipped");
|
|
1120
|
+
if (["delivered", "refunded"].includes(status)) step(60 + rnd() * 50, "Delivered to the customer", "delivered");
|
|
1121
|
+
if (status == "cancelled") step(2 + rnd() * 10, "Order is cancelled, payment is returned", "cancelled");
|
|
1122
|
+
if (status == "refunded") step(140 + rnd() * 30, "Refunded " + OrdersPage.formatMoney(total), "refunded");
|
|
1123
|
+
|
|
1124
|
+
list.push({
|
|
1125
|
+
id: "ORD-" + String(100000 + i * 7 + Math.floor(rnd() * 7)),
|
|
1126
|
+
time: time,
|
|
1127
|
+
customer: { name: customer[0], email: customer[1], phone: "+90 5" + String(Math.floor(rnd() * 1e9)).padStart(9, "0") },
|
|
1128
|
+
address: customer[2],
|
|
1129
|
+
items: items,
|
|
1130
|
+
subtotal: subtotal,
|
|
1131
|
+
shipping: shipping,
|
|
1132
|
+
discount: discount,
|
|
1133
|
+
total: total,
|
|
1134
|
+
payment: pick(OrdersPage.PAYMENTS),
|
|
1135
|
+
status: status,
|
|
1136
|
+
carrier: (["shipped", "delivered", "refunded"].includes(status)) ? carrier : "",
|
|
1137
|
+
tracking: (["shipped", "delivered", "refunded"].includes(status)) ? tracking : "",
|
|
1138
|
+
history: history,
|
|
1139
|
+
});
|
|
1140
|
+
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
list.sort(function(a, b) { return b.time - a.time; });
|
|
1144
|
+
OrdersPage._orders = list;
|
|
1145
|
+
return list;
|
|
1146
|
+
|
|
1147
|
+
};
|