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,1462 @@
|
|
|
1
|
+
/* Bismillah */
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
|
|
5
|
+
Settings Page (Template) - v26.09
|
|
6
|
+
|
|
7
|
+
- A sample settings page for the admin panel. Sections: General, Account, Notifications, Appearance, Advanced.
|
|
8
|
+
- Changes are kept in a draft. A bar at the bottom shows "unsaved changes" with Discard and Save.
|
|
9
|
+
- Settings are saved to the browser (basic.storage). Replace SettingsPage.load() and SettingsPage.save()
|
|
10
|
+
with your service (Supabase, API...) calls.
|
|
11
|
+
- Panel name, panel color and the start page are used by the panel (index.htm: SettingsPage.applyToPanel).
|
|
12
|
+
|
|
13
|
+
COMPONENTS:
|
|
14
|
+
- Tabs (comp-m4): Sections
|
|
15
|
+
- InputB, EmailInputB, PasswordInputB (comp-m2): Text fields
|
|
16
|
+
- TinySelect (comp-m2): Language, time zone, start page, report day
|
|
17
|
+
- RadioButton (comp-m3): Date format, panel color
|
|
18
|
+
- CheckBox (comp-m3): Notification channels
|
|
19
|
+
- Toggle (comp-m2): Two-factor, quiet hours, maintenance mode
|
|
20
|
+
- SelectTime (comp-m4): Quiet hours
|
|
21
|
+
- Slider (comp-m2): Session timeout
|
|
22
|
+
- SelectFile (comp-m4): Logo, settings import
|
|
23
|
+
- TinyTable (comp-m4): Active sessions
|
|
24
|
+
- SmartButton (comp-m4), HoldToConfirmButton (comp-m3): Actions
|
|
25
|
+
- Dialog, LoadingScreen (comp-m4; Theme.confirm, waiting): Confirm, save
|
|
26
|
+
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
SettingsPageDefaults = {
|
|
30
|
+
color: "transparent",
|
|
31
|
+
sectionIndex: 0, // The first section. 0: General, 1: Account, 2: Notifications, 3: Appearance, 4: Advanced
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const SettingsPage = function(params = {}) {
|
|
35
|
+
|
|
36
|
+
// BOX: Page container
|
|
37
|
+
let box = startPage(params, SettingsPageDefaults, mainView);
|
|
38
|
+
|
|
39
|
+
mainView.setKey(SettingsPage.KEY);
|
|
40
|
+
|
|
41
|
+
// *** PRIVATE VARIABLES:
|
|
42
|
+
|
|
43
|
+
const ASSETS = "assets/";
|
|
44
|
+
const LIB_PATH = "_basic/";
|
|
45
|
+
|
|
46
|
+
const CARD_COLOR = T.surface;
|
|
47
|
+
const CARD_BORDER_COLOR = Ink(0.1);
|
|
48
|
+
const FIELD_COLOR = T.surface2;
|
|
49
|
+
const PRIMARY_COLOR = T.primary;
|
|
50
|
+
const ACCENT_COLOR = T.accent;
|
|
51
|
+
const ERROR_COLOR = T.danger;
|
|
52
|
+
|
|
53
|
+
const SECTIONS = ["General", "Account", "Notifications", "Appearance", "Advanced"];
|
|
54
|
+
|
|
55
|
+
const currentThemeName = Theme.load(); // The theme of the panel now (Settings > Appearance)
|
|
56
|
+
|
|
57
|
+
const LANGUAGES = [
|
|
58
|
+
{ id: "en", label: "English" },
|
|
59
|
+
{ id: "tr", label: "Türkçe" },
|
|
60
|
+
{ id: "de", label: "Deutsch" },
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
const TIME_ZONES = [
|
|
64
|
+
{ id: "Europe/Istanbul", label: "(GMT+03:00) Istanbul" },
|
|
65
|
+
{ id: "Europe/London", label: "(GMT+00:00) London" },
|
|
66
|
+
{ id: "Europe/Berlin", label: "(GMT+01:00) Berlin" },
|
|
67
|
+
{ id: "America/New_York", label: "(GMT-05:00) New York" },
|
|
68
|
+
{ id: "Asia/Tokyo", label: "(GMT+09:00) Tokyo" },
|
|
69
|
+
];
|
|
70
|
+
|
|
71
|
+
const DATE_FORMATS = ["DD.MM.YYYY", "MM/DD/YYYY", "YYYY-MM-DD"];
|
|
72
|
+
|
|
73
|
+
const START_PAGES = [
|
|
74
|
+
{ id: HomePage.KEY, label: "Home" },
|
|
75
|
+
{ id: ReportsPage.KEY, label: "Reports" },
|
|
76
|
+
{ id: OrdersPage.KEY, label: "Orders" },
|
|
77
|
+
{ id: ProductsPage.KEY, label: "Products" },
|
|
78
|
+
{ id: UsersPage.KEY, label: "Users" },
|
|
79
|
+
{ id: UserListPage.KEY, label: "User List" },
|
|
80
|
+
{ id: CustomersPage.KEY, label: "Customers" },
|
|
81
|
+
{ id: ContentsPage.KEY, label: "Contents" },
|
|
82
|
+
{ id: MediaPage.KEY, label: "Media Library" },
|
|
83
|
+
{ id: RolesPage.KEY, label: "Roles & Permissions" },
|
|
84
|
+
{ id: ActivityPage.KEY, label: "Activity Log" },
|
|
85
|
+
];
|
|
86
|
+
|
|
87
|
+
const WEEK_DAYS = [
|
|
88
|
+
{ id: "mon", label: "Monday" },
|
|
89
|
+
{ id: "fri", label: "Friday" },
|
|
90
|
+
{ id: "sun", label: "Sunday" },
|
|
91
|
+
];
|
|
92
|
+
|
|
93
|
+
const NOTIFY_EVENTS = [
|
|
94
|
+
{ key: "signup", title: "New user sign up", desc: "When a new user creates an account" },
|
|
95
|
+
{ key: "order", title: "New order", desc: "When an order is paid" },
|
|
96
|
+
{ key: "report", title: "Weekly report", desc: "Summary of the last 7 days" },
|
|
97
|
+
{ key: "security", title: "Security alerts", desc: "New sign in, password change" },
|
|
98
|
+
];
|
|
99
|
+
|
|
100
|
+
const SESSION_TIMEOUT_MIN = 5; // Minutes (Slider: 0)
|
|
101
|
+
const SESSION_TIMEOUT_MAX = 120; // Minutes (Slider: 100)
|
|
102
|
+
|
|
103
|
+
// Settings
|
|
104
|
+
let saved = SettingsPage.load();
|
|
105
|
+
let draft = SettingsPage.clone(saved);
|
|
106
|
+
|
|
107
|
+
let isRendering = 0; // WHY: Component setters call onChange. Values written by code are not user changes.
|
|
108
|
+
let saveTimer = null;
|
|
109
|
+
let messageTimer = null;
|
|
110
|
+
|
|
111
|
+
// Components
|
|
112
|
+
let sectionTabs;
|
|
113
|
+
let sectionList = [];
|
|
114
|
+
let fields = {}; // InputB family
|
|
115
|
+
let selects = {}; // TinySelect
|
|
116
|
+
let toggles = {};
|
|
117
|
+
let notifyCheckBoxes = {}; // [event][channel]
|
|
118
|
+
let radioList = []; // WHY: RadioButton groups are static. Radio buttons must be removed from the group on destroy.
|
|
119
|
+
let selectTimes = [];
|
|
120
|
+
let selectFiles = [];
|
|
121
|
+
let sliderTimeout, lblTimeout, lblDatePreview, lblLogo, lblApiKey, lblAccountMessage;
|
|
122
|
+
let grpSessionTable, sessionTable = null;
|
|
123
|
+
let footer, lblFooter, btnDiscard, btnSave;
|
|
124
|
+
|
|
125
|
+
let isApiKeyVisible = 0;
|
|
126
|
+
let sessionList = [
|
|
127
|
+
["MacBook Pro · Chrome", "Istanbul, TR", "Active now"],
|
|
128
|
+
["iPhone 15 · Safari", "Istanbul, TR", "2 hours ago"],
|
|
129
|
+
["Windows · Edge", "Berlin, DE", "3 days ago"],
|
|
130
|
+
];
|
|
131
|
+
|
|
132
|
+
// *** PRIVATE FUNCTIONS:
|
|
133
|
+
|
|
134
|
+
const isDirty = function() {
|
|
135
|
+
return JSON.stringify(draft) != JSON.stringify(saved);
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
// Changes a draft value by a user action.
|
|
139
|
+
const setDraft = function(key, value) {
|
|
140
|
+
if (isRendering) return;
|
|
141
|
+
draft[key] = value;
|
|
142
|
+
updateFooter();
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const formatDateBy = function(format, date) {
|
|
146
|
+
const pad = function(n) { return String(n).padStart(2, "0"); };
|
|
147
|
+
return format.replace("YYYY", date.getFullYear()).replace("MM", pad(date.getMonth() + 1)).replace("DD", pad(date.getDate()));
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
const timeoutToSlider = function(minutes) {
|
|
151
|
+
return Math.round((minutes - SESSION_TIMEOUT_MIN) / (SESSION_TIMEOUT_MAX - SESSION_TIMEOUT_MIN) * 100);
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
// 5 minute steps
|
|
155
|
+
const sliderToTimeout = function(value) {
|
|
156
|
+
const minutes = SESSION_TIMEOUT_MIN + value / 100 * (SESSION_TIMEOUT_MAX - SESSION_TIMEOUT_MIN);
|
|
157
|
+
return Math.round(minutes / 5) * 5;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const maskApiKey = function(key) {
|
|
161
|
+
return key.slice(0, 8) + "•".repeat(16) + key.slice(-4);
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const createApiKey = function() {
|
|
165
|
+
const chars = "abcdefghijklmnopqrstuvwxyz0123456789";
|
|
166
|
+
let key = "sk_live_";
|
|
167
|
+
for (let i = 0; i < 32; i++) key += chars[random(0, chars.length - 1)];
|
|
168
|
+
return key;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
const selectById = function(select, id) {
|
|
172
|
+
const index = select.getIndexById(id);
|
|
173
|
+
if (index >= 0 && index != select.selectedIndex) select.setSelectedIndex(index);
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
const showSection = function(index) {
|
|
177
|
+
sectionList.forEach(function(section, i) {
|
|
178
|
+
section.visible = (i == index) ? 1 : 0;
|
|
179
|
+
});
|
|
180
|
+
sectionTabs.setValue(index, 1); // (silent: no onChange)
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
// Writes the values to the components. (Used on start, Discard, Import and Reset.)
|
|
184
|
+
const fillForm = function(values) {
|
|
185
|
+
|
|
186
|
+
isRendering = 1;
|
|
187
|
+
|
|
188
|
+
fields.panelName.setInputValue(values.panelName);
|
|
189
|
+
fields.supportEmail.setInputValue(values.supportEmail);
|
|
190
|
+
fields.fullName.setInputValue(values.fullName);
|
|
191
|
+
fields.email.setInputValue(values.email);
|
|
192
|
+
|
|
193
|
+
selectById(selects.language, values.language);
|
|
194
|
+
selectById(selects.timeZone, values.timeZone);
|
|
195
|
+
selectById(selects.startPage, values.startPage);
|
|
196
|
+
selectById(selects.reportDay, values.reportDay);
|
|
197
|
+
|
|
198
|
+
RadioButton.setValue("settingsDateFormat", values.dateFormat, 1);
|
|
199
|
+
RadioButton.setValue("settingsPanelColor", values.panelColor, 1);
|
|
200
|
+
lblDatePreview.text = "Preview: " + formatDateBy(values.dateFormat, new Date());
|
|
201
|
+
|
|
202
|
+
lblLogo.text = (values.logoName) ? "Current logo: <b>" + ContentsPage.escapeHtml(values.logoName) + "</b>" : "No logo. The default panel icon is used.";
|
|
203
|
+
selectFiles.forEach(function(selectFile) { selectFile.clear(1); });
|
|
204
|
+
|
|
205
|
+
NOTIFY_EVENTS.forEach(function(event) {
|
|
206
|
+
["email", "push"].forEach(function(channel) {
|
|
207
|
+
notifyCheckBoxes[event.key][channel].setChecked(values.notify[event.key][channel], 1);
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
["twoFactor", "quietHours", "maintenance"].forEach(function(key) {
|
|
212
|
+
if (toggles[key].value !== values[key]) toggles[key].setValue(values[key]);
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
selectTimes[0].setTime(values.quietFrom, 1);
|
|
216
|
+
selectTimes[1].setTime(values.quietTo, 1);
|
|
217
|
+
selectTimes.forEach(function(selectTime) { selectTime.setEnabled(values.quietHours); });
|
|
218
|
+
|
|
219
|
+
sliderTimeout.setValue(timeoutToSlider(values.sessionTimeout));
|
|
220
|
+
lblTimeout.text = values.sessionTimeout + " min";
|
|
221
|
+
|
|
222
|
+
lblApiKey.text = (isApiKeyVisible) ? values.apiKey : maskApiKey(values.apiKey);
|
|
223
|
+
|
|
224
|
+
isRendering = 0;
|
|
225
|
+
|
|
226
|
+
SettingsPage.applyToPanel(values); // Preview
|
|
227
|
+
updateFooter();
|
|
228
|
+
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
// Returns the section index of the first error, or -1.
|
|
232
|
+
const validate = function() {
|
|
233
|
+
|
|
234
|
+
const checks = [
|
|
235
|
+
{ field: fields.panelName, section: 0, isValid: draft.panelName.trim() != "", message: "Panel name is required." },
|
|
236
|
+
{ field: fields.supportEmail, section: 0, isValid: fields.supportEmail.isValid() == 1, message: "Support e-mail is not valid." },
|
|
237
|
+
{ field: fields.fullName, section: 1, isValid: draft.fullName.trim() != "", message: "Full name is required." },
|
|
238
|
+
{ field: fields.email, section: 1, isValid: fields.email.isValid() == 1, message: "E-mail is not valid." },
|
|
239
|
+
];
|
|
240
|
+
|
|
241
|
+
const error = checks.find(function(check) { return !check.isValid; });
|
|
242
|
+
if (!error) return -1;
|
|
243
|
+
|
|
244
|
+
error.field.checkIfInputIsRequiredAndEmpty();
|
|
245
|
+
error.field.showWarningIfNotValid(0);
|
|
246
|
+
showSection(error.section);
|
|
247
|
+
showFooterMessage(error.message, ERROR_COLOR);
|
|
248
|
+
|
|
249
|
+
return error.section;
|
|
250
|
+
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
const saveSettings = function() {
|
|
254
|
+
|
|
255
|
+
if (validate() >= 0) return;
|
|
256
|
+
|
|
257
|
+
btnSave.elem.inert = true;
|
|
258
|
+
if (typeof waiting !== "undefined") waiting.open();
|
|
259
|
+
|
|
260
|
+
// TEST: Like a server request
|
|
261
|
+
saveTimer = setTimeout(function() {
|
|
262
|
+
|
|
263
|
+
if (!box) return;
|
|
264
|
+
|
|
265
|
+
SettingsPage.save(draft);
|
|
266
|
+
saved = SettingsPage.clone(draft);
|
|
267
|
+
SettingsPage.applyToPanel(saved);
|
|
268
|
+
|
|
269
|
+
if (typeof waiting !== "undefined") waiting.close();
|
|
270
|
+
btnSave.elem.inert = false;
|
|
271
|
+
showFooterMessage("All changes are saved.", ACCENT_COLOR, 1);
|
|
272
|
+
|
|
273
|
+
}, 500);
|
|
274
|
+
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
const discardChanges = function() {
|
|
278
|
+
draft = SettingsPage.clone(saved);
|
|
279
|
+
fillForm(draft);
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
// Settings were saved from outside while this page is open. (Ex: Maintenance mode on the top bar)
|
|
283
|
+
// The changed values are written to the form. Other unsaved changes of the user are kept.
|
|
284
|
+
// WHY: The form was showing the old values, and "Save" was writing them back.
|
|
285
|
+
SettingsPage.refreshOpenPage = function(settings) {
|
|
286
|
+
if (!box) return;
|
|
287
|
+
Object.keys(settings).forEach(function(key) {
|
|
288
|
+
if (JSON.stringify(settings[key]) != JSON.stringify(saved[key])) draft[key] = SettingsPage.clone(settings[key]);
|
|
289
|
+
});
|
|
290
|
+
saved = SettingsPage.clone(settings);
|
|
291
|
+
fillForm(draft);
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
// *** FOOTER:
|
|
295
|
+
|
|
296
|
+
const updateFooter = function() {
|
|
297
|
+
|
|
298
|
+
if (!footer) return;
|
|
299
|
+
|
|
300
|
+
const dirty = isDirty();
|
|
301
|
+
|
|
302
|
+
if (dirty) {
|
|
303
|
+
clearTimeout(messageTimer);
|
|
304
|
+
messageTimer = null; // WHY: else "!messageTimer" below never hid the bar again
|
|
305
|
+
lblFooter.text = "You have unsaved changes.";
|
|
306
|
+
lblFooter.textColor = Ink(0.85);
|
|
307
|
+
btnDiscard.visible = 1;
|
|
308
|
+
btnSave.visible = 1;
|
|
309
|
+
showFooter(1);
|
|
310
|
+
} else if (!messageTimer) {
|
|
311
|
+
showFooter(0);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
// autoHide: 1 -> Hides after 2 seconds (if there is no change).
|
|
317
|
+
const showFooterMessage = function(text, color, autoHide = 0) {
|
|
318
|
+
|
|
319
|
+
clearTimeout(messageTimer);
|
|
320
|
+
messageTimer = null;
|
|
321
|
+
|
|
322
|
+
lblFooter.text = text;
|
|
323
|
+
lblFooter.textColor = color;
|
|
324
|
+
btnDiscard.visible = (isDirty()) ? 1 : 0;
|
|
325
|
+
btnSave.visible = (isDirty()) ? 1 : 0;
|
|
326
|
+
showFooter(1);
|
|
327
|
+
|
|
328
|
+
if (autoHide) {
|
|
329
|
+
messageTimer = setTimeout(function() {
|
|
330
|
+
messageTimer = null;
|
|
331
|
+
if (box) updateFooter();
|
|
332
|
+
}, 2000);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
const showFooter = function(show) {
|
|
338
|
+
if (show) {
|
|
339
|
+
footer.visible = 1;
|
|
340
|
+
footer.withMotion(function(self) {
|
|
341
|
+
self.opacity = 1;
|
|
342
|
+
self.elem.style.transform = "translateY(0px)";
|
|
343
|
+
});
|
|
344
|
+
} else {
|
|
345
|
+
footer.opacity = 0;
|
|
346
|
+
footer.elem.style.transform = "translateY(20px)";
|
|
347
|
+
footer.visible = 0;
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
// *** VIEW HELPERS:
|
|
352
|
+
|
|
353
|
+
const setFlex = function(obj, flex) {
|
|
354
|
+
obj.elem.style.flex = flex;
|
|
355
|
+
obj.elem.style.minWidth = "0";
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
const startCard = function(title, subtitle) {
|
|
359
|
+
|
|
360
|
+
const card = VGroup({
|
|
361
|
+
width: "100%",
|
|
362
|
+
height: "auto",
|
|
363
|
+
align: "left top",
|
|
364
|
+
gap: 16,
|
|
365
|
+
padding: 20,
|
|
366
|
+
color: CARD_COLOR,
|
|
367
|
+
border: 1,
|
|
368
|
+
borderColor: CARD_BORDER_COLOR,
|
|
369
|
+
round: 12,
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
VGroup({ width: "100%", height: "auto", align: "left top", gap: 0 });
|
|
373
|
+
|
|
374
|
+
Label({ text: title, fontSize: 16, textColor: Ink(0.95) });
|
|
375
|
+
that.elem.style.fontFamily = "opensans-bold";
|
|
376
|
+
|
|
377
|
+
if (subtitle) {
|
|
378
|
+
Label({ text: subtitle, fontSize: 13, textColor: Ink(0.45), width: "100%" });
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
endGroup();
|
|
382
|
+
|
|
383
|
+
return card;
|
|
384
|
+
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
const endCard = function() {
|
|
388
|
+
endGroup();
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
// GROUP: Fields side by side (wraps on small screens)
|
|
392
|
+
const startFieldRow = function() {
|
|
393
|
+
HGroup({ width: "100%", height: "auto", align: "left top", gap: 16 });
|
|
394
|
+
that.elem.style.flexWrap = "wrap";
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
// GROUP: Small title and a component
|
|
398
|
+
// flex: For a field in a row. null: Full width (in a card).
|
|
399
|
+
const startField = function(title, flex = "1 1 260px") {
|
|
400
|
+
const group = VGroup({ width: (flex) ? "auto" : "100%", height: "auto", align: "left top", gap: 8 });
|
|
401
|
+
if (flex) setFlex(group, flex);
|
|
402
|
+
Label({ text: title.toUpperCase(), fontSize: 11, textColor: Ink(0.45) });
|
|
403
|
+
that.elem.style.letterSpacing = "1px";
|
|
404
|
+
return group;
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
const endField = function() {
|
|
408
|
+
endGroup();
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
// GROUP: Title, description and a component on the right
|
|
412
|
+
const startSettingLine = function(title, desc) {
|
|
413
|
+
HGroup({ width: "100%", height: "auto", align: "left center", gap: 16 });
|
|
414
|
+
that.elem.style.justifyContent = "space-between";
|
|
415
|
+
VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
|
|
416
|
+
setFlex(that, "1 1 auto");
|
|
417
|
+
Label({ text: title, fontSize: 15, textColor: Ink(0.9) });
|
|
418
|
+
if (desc) Label({ text: desc, fontSize: 12, textColor: Ink(0.45), width: "100%" });
|
|
419
|
+
endGroup();
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
const endSettingLine = function() {
|
|
423
|
+
endGroup();
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
const createDivider = function() {
|
|
427
|
+
Box({ width: "100%", height: 1, color: Ink(0.06) });
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
// Dark style for the InputB family
|
|
431
|
+
const INPUT_PARAMS = {
|
|
432
|
+
width: "100%",
|
|
433
|
+
leftPadding: 14,
|
|
434
|
+
rightPadding: 36,
|
|
435
|
+
backgroundColor: FIELD_COLOR,
|
|
436
|
+
selectedBackgroundColor: T.surface3,
|
|
437
|
+
lineColor: "transparent",
|
|
438
|
+
selectedLineColor: "transparent",
|
|
439
|
+
backBorderColor: CARD_BORDER_COLOR,
|
|
440
|
+
selectedBackBorderColor: ACCENT_COLOR,
|
|
441
|
+
backBorderTopRound: 8,
|
|
442
|
+
backBorderBottomRound: 8,
|
|
443
|
+
requiredColor: ERROR_COLOR,
|
|
444
|
+
warningColor: ERROR_COLOR,
|
|
445
|
+
};
|
|
446
|
+
|
|
447
|
+
// WHY: InputB has fixed text colors for light backgrounds.
|
|
448
|
+
const styleInput = function(input) {
|
|
449
|
+
input.title.textColor = Ink(0.45);
|
|
450
|
+
input.title.fontSize = 11;
|
|
451
|
+
input.title.elem.style.letterSpacing = "1px";
|
|
452
|
+
input.input.textColor = Ink(0.9);
|
|
453
|
+
input.input.fontSize = 16;
|
|
454
|
+
input.input.height = 34;
|
|
455
|
+
input.warningBall.borderColor = CARD_COLOR;
|
|
456
|
+
return input;
|
|
457
|
+
};
|
|
458
|
+
|
|
459
|
+
const createTinySelect = function(list, onSelect) {
|
|
460
|
+
return TinySelect({
|
|
461
|
+
list: list,
|
|
462
|
+
height: 44,
|
|
463
|
+
fontSize: 15,
|
|
464
|
+
color: FIELD_COLOR,
|
|
465
|
+
border: 1,
|
|
466
|
+
borderColor: CARD_BORDER_COLOR,
|
|
467
|
+
round: 8,
|
|
468
|
+
labelBoldFont: 0,
|
|
469
|
+
labelTextColor: Ink(0.9),
|
|
470
|
+
arrowIcon: LIB_PATH + "comp/tiny-select/arrow.svg",
|
|
471
|
+
arrowSize: 18,
|
|
472
|
+
invertIconColor: T.invertIcon,
|
|
473
|
+
listFontSize: 14,
|
|
474
|
+
listTextColor: Ink(0.85),
|
|
475
|
+
listOverTextColor: ACCENT_COLOR,
|
|
476
|
+
listBackgroundColor: FIELD_COLOR,
|
|
477
|
+
listBorderColor: Ink(0.15),
|
|
478
|
+
onSelect: onSelect,
|
|
479
|
+
});
|
|
480
|
+
};
|
|
481
|
+
|
|
482
|
+
const createRadioButton = function(group, value, labelText, onChange) {
|
|
483
|
+
const radio = RadioButton({
|
|
484
|
+
group: group,
|
|
485
|
+
value: value,
|
|
486
|
+
labelText: labelText,
|
|
487
|
+
style: {
|
|
488
|
+
mark: { width: 20, height: 20, color: "transparent", borderColor: Ink(0.35) },
|
|
489
|
+
checkedMark: { color: "transparent", borderColor: ACCENT_COLOR },
|
|
490
|
+
hoverMark: { borderColor: Ink(0.7) },
|
|
491
|
+
dot: { color: ACCENT_COLOR },
|
|
492
|
+
label: { fontSize: 14, textColor: Ink(0.9) },
|
|
493
|
+
},
|
|
494
|
+
onChange: onChange,
|
|
495
|
+
});
|
|
496
|
+
radioList.push(radio);
|
|
497
|
+
return radio;
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
const createCheckBox = function(labelText, onChange) {
|
|
501
|
+
return CheckBox({
|
|
502
|
+
labelText: labelText,
|
|
503
|
+
style: {
|
|
504
|
+
layout: { padding: [0, 0] },
|
|
505
|
+
mark: { width: 20, height: 20, color: "transparent", borderColor: Ink(0.35) },
|
|
506
|
+
checkedMark: { color: PRIMARY_COLOR, borderColor: PRIMARY_COLOR },
|
|
507
|
+
hoverMark: { borderColor: Ink(0.7) },
|
|
508
|
+
tick: { color: Ink(1) },
|
|
509
|
+
label: { fontSize: 14, textColor: Ink(0.9) },
|
|
510
|
+
},
|
|
511
|
+
onChange: onChange,
|
|
512
|
+
});
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
const createToggle = function(onChange) {
|
|
516
|
+
return Toggle({
|
|
517
|
+
width: 52,
|
|
518
|
+
height: 30,
|
|
519
|
+
spacing: 3,
|
|
520
|
+
backgroundStyle: { color: T.surface3, selectedColor: PRIMARY_COLOR, border: 1, borderColor: CARD_BORDER_COLOR },
|
|
521
|
+
buttonStyle: { color: Ink(0.35), selectedColor: Ink(0.95) },
|
|
522
|
+
onChange: onChange,
|
|
523
|
+
});
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
const createButton = function(text, iconFile, onClick, params = {}) {
|
|
527
|
+
const btn = SmartButton({
|
|
528
|
+
styleName: "classic",
|
|
529
|
+
labelText: text,
|
|
530
|
+
iconFile: (iconFile) ? ASSETS + iconFile : "",
|
|
531
|
+
onClick: onClick,
|
|
532
|
+
style: {
|
|
533
|
+
layout: { gap: 8, padding: [14, 8] },
|
|
534
|
+
icon: { width: 18, height: 18 },
|
|
535
|
+
label: { fontSize: 14, textColor: Ink(0.9) },
|
|
536
|
+
box: { color: params.color || FIELD_COLOR, border: 1, borderColor: CARD_BORDER_COLOR, round: 8 },
|
|
537
|
+
hover: { color: params.hoverColor || T.surface3 },
|
|
538
|
+
active: { color: params.activeColor || T.surface4 },
|
|
539
|
+
},
|
|
540
|
+
});
|
|
541
|
+
if (btn.icon) btn.icon.elem.style.filter = T.iconFilter; // WHY: Panel icons are black.
|
|
542
|
+
return btn;
|
|
543
|
+
};
|
|
544
|
+
|
|
545
|
+
const SELECT_FILE_STYLE = {
|
|
546
|
+
zone: { color: FIELD_COLOR, border: 2, borderColor: Ink(0.12), round: 10 },
|
|
547
|
+
zoneHover: { color: T.surface3, borderColor: Ink(0.3) },
|
|
548
|
+
zoneDragOver: { color: T.tableHighlight, borderColor: ACCENT_COLOR },
|
|
549
|
+
icon: { color: Ink(0.45), dragOverColor: ACCENT_COLOR },
|
|
550
|
+
title: { fontSize: 14, textColor: Ink(0.9) },
|
|
551
|
+
desc: { fontSize: 13, textColor: Ink(0.5) },
|
|
552
|
+
hint: { textColor: Ink(0.4) },
|
|
553
|
+
item: { color: FIELD_COLOR, borderColor: Ink(0.1) },
|
|
554
|
+
itemName: { textColor: Ink(0.85) },
|
|
555
|
+
itemSize: { textColor: Ink(0.45) },
|
|
556
|
+
badge: { color: Ink(0.08), textColor: Ink(0.6) },
|
|
557
|
+
removeButton: { textColor: Ink(0.45), hoverColor: ERROR_COLOR },
|
|
558
|
+
};
|
|
559
|
+
|
|
560
|
+
// *** SECTIONS:
|
|
561
|
+
|
|
562
|
+
const startSection = function() {
|
|
563
|
+
const section = VGroup({ width: "100%", height: "auto", align: "left top", gap: 16 });
|
|
564
|
+
sectionList.push(section);
|
|
565
|
+
return section;
|
|
566
|
+
};
|
|
567
|
+
|
|
568
|
+
const endSection = function() {
|
|
569
|
+
endGroup();
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
const initGeneral = function() {
|
|
573
|
+
|
|
574
|
+
startSection();
|
|
575
|
+
|
|
576
|
+
startCard("Panel", "Name and contact information of this panel");
|
|
577
|
+
|
|
578
|
+
startFieldRow();
|
|
579
|
+
|
|
580
|
+
fields.panelName = styleInput(InputB({
|
|
581
|
+
...INPUT_PARAMS,
|
|
582
|
+
titleText: "PANEL NAME",
|
|
583
|
+
inputValue: draft.panelName, // WHY: An empty required field shows a warning ball with a delayed motion; filling it later does not hide it.
|
|
584
|
+
placeholder: "My Panel",
|
|
585
|
+
isRequired: 1,
|
|
586
|
+
requiredText: "Panel name is required",
|
|
587
|
+
maxChar: 24,
|
|
588
|
+
onEdit: function() {
|
|
589
|
+
setDraft("panelName", fields.panelName.getInputValue());
|
|
590
|
+
topBar.setPanelName(draft.panelName); // Preview
|
|
591
|
+
},
|
|
592
|
+
}));
|
|
593
|
+
setFlex(fields.panelName, "1 1 260px");
|
|
594
|
+
|
|
595
|
+
fields.supportEmail = styleInput(EmailInputB({
|
|
596
|
+
...INPUT_PARAMS,
|
|
597
|
+
titleText: "SUPPORT E-MAIL",
|
|
598
|
+
inputValue: draft.supportEmail,
|
|
599
|
+
onEdit: function() {
|
|
600
|
+
setDraft("supportEmail", fields.supportEmail.getInputValue());
|
|
601
|
+
},
|
|
602
|
+
}));
|
|
603
|
+
setFlex(fields.supportEmail, "1 1 260px");
|
|
604
|
+
|
|
605
|
+
endGroup();
|
|
606
|
+
|
|
607
|
+
startField("Logo", null);
|
|
608
|
+
|
|
609
|
+
const logoFile = SelectFile({
|
|
610
|
+
width: "100%",
|
|
611
|
+
zoneHeight: 150,
|
|
612
|
+
accept: "image/png,image/svg+xml",
|
|
613
|
+
maxSize: 512 * 1024,
|
|
614
|
+
titleText: "Drop the panel logo here",
|
|
615
|
+
descText: "or click to select (PNG or SVG, square)",
|
|
616
|
+
style: SELECT_FILE_STYLE,
|
|
617
|
+
onChange: function(self) {
|
|
618
|
+
// NOTE: Only the name is kept in this template. Upload self.files[0].file to your storage.
|
|
619
|
+
if (self.files.length) setDraft("logoName", self.files[0].name);
|
|
620
|
+
},
|
|
621
|
+
});
|
|
622
|
+
selectFiles.push(logoFile);
|
|
623
|
+
|
|
624
|
+
lblLogo = Label({ text: "", fontSize: 13, textColor: Ink(0.5) });
|
|
625
|
+
|
|
626
|
+
endField();
|
|
627
|
+
|
|
628
|
+
endCard();
|
|
629
|
+
|
|
630
|
+
startCard("Localization", "Language, time zone and date format of the panel");
|
|
631
|
+
|
|
632
|
+
startFieldRow();
|
|
633
|
+
|
|
634
|
+
startField("Language");
|
|
635
|
+
selects.language = createTinySelect(LANGUAGES, function(index, id) { setDraft("language", id); });
|
|
636
|
+
endField();
|
|
637
|
+
|
|
638
|
+
startField("Time zone");
|
|
639
|
+
selects.timeZone = createTinySelect(TIME_ZONES, function(index, id) { setDraft("timeZone", id); });
|
|
640
|
+
endField();
|
|
641
|
+
|
|
642
|
+
endGroup();
|
|
643
|
+
|
|
644
|
+
startField("Date format", null);
|
|
645
|
+
|
|
646
|
+
HGroup({ width: "100%", height: "auto", align: "left center", gap: 24 });
|
|
647
|
+
that.elem.style.flexWrap = "wrap";
|
|
648
|
+
|
|
649
|
+
DATE_FORMATS.forEach(function(format) {
|
|
650
|
+
createRadioButton("settingsDateFormat", format, format, function(self) {
|
|
651
|
+
lblDatePreview.text = "Preview: " + formatDateBy(self.value, new Date());
|
|
652
|
+
setDraft("dateFormat", self.value);
|
|
653
|
+
});
|
|
654
|
+
});
|
|
655
|
+
|
|
656
|
+
endGroup();
|
|
657
|
+
|
|
658
|
+
lblDatePreview = Label({ text: "", fontSize: 13, textColor: Ink(0.5) });
|
|
659
|
+
|
|
660
|
+
endField();
|
|
661
|
+
|
|
662
|
+
endCard();
|
|
663
|
+
|
|
664
|
+
endSection();
|
|
665
|
+
|
|
666
|
+
};
|
|
667
|
+
|
|
668
|
+
const initAccount = function() {
|
|
669
|
+
|
|
670
|
+
startSection();
|
|
671
|
+
|
|
672
|
+
startCard("Profile", "");
|
|
673
|
+
|
|
674
|
+
startFieldRow();
|
|
675
|
+
|
|
676
|
+
fields.fullName = styleInput(InputB({
|
|
677
|
+
...INPUT_PARAMS,
|
|
678
|
+
titleText: "FULL NAME",
|
|
679
|
+
inputValue: draft.fullName,
|
|
680
|
+
placeholder: "Your name",
|
|
681
|
+
isRequired: 1,
|
|
682
|
+
requiredText: "Full name is required",
|
|
683
|
+
maxChar: 40,
|
|
684
|
+
onEdit: function() {
|
|
685
|
+
setDraft("fullName", fields.fullName.getInputValue());
|
|
686
|
+
},
|
|
687
|
+
}));
|
|
688
|
+
setFlex(fields.fullName, "1 1 260px");
|
|
689
|
+
|
|
690
|
+
fields.email = styleInput(EmailInputB({
|
|
691
|
+
...INPUT_PARAMS,
|
|
692
|
+
titleText: "E-MAIL",
|
|
693
|
+
inputValue: draft.email,
|
|
694
|
+
onEdit: function() {
|
|
695
|
+
setDraft("email", fields.email.getInputValue());
|
|
696
|
+
},
|
|
697
|
+
}));
|
|
698
|
+
setFlex(fields.email, "1 1 260px");
|
|
699
|
+
|
|
700
|
+
endGroup();
|
|
701
|
+
|
|
702
|
+
endCard();
|
|
703
|
+
|
|
704
|
+
// PASSWORD: An action, not a setting. (Not in the draft)
|
|
705
|
+
startCard("Change Password", "At least 8 characters, with a letter and a number");
|
|
706
|
+
|
|
707
|
+
const passwordParams = {
|
|
708
|
+
...INPUT_PARAMS,
|
|
709
|
+
isRequired: 0, // WHY: Required balls are shown on empty fields at start. Checked on the button click.
|
|
710
|
+
minChar: 8,
|
|
711
|
+
minCharWarningText: "At least 8 characters",
|
|
712
|
+
showPasswordIconFile: LIB_PATH + "comp/password-input-b/show-btn.png",
|
|
713
|
+
hidePasswordIconFile: LIB_PATH + "comp/password-input-b/hide-btn.png",
|
|
714
|
+
showPasswordIconInvert: 1,
|
|
715
|
+
rightPadding: 50,
|
|
716
|
+
};
|
|
717
|
+
|
|
718
|
+
startFieldRow();
|
|
719
|
+
|
|
720
|
+
const inputCurrent = styleInput(PasswordInputB({ ...passwordParams, titleText: "CURRENT PASSWORD", placeholder: "" }));
|
|
721
|
+
setFlex(inputCurrent, "1 1 200px");
|
|
722
|
+
|
|
723
|
+
const inputNew = styleInput(PasswordInputB({ ...passwordParams, titleText: "NEW PASSWORD", placeholder: "" }));
|
|
724
|
+
setFlex(inputNew, "1 1 200px");
|
|
725
|
+
|
|
726
|
+
const inputConfirm = styleInput(PasswordInputB({ ...passwordParams, titleText: "CONFIRM PASSWORD", placeholder: "" }));
|
|
727
|
+
setFlex(inputConfirm, "1 1 200px");
|
|
728
|
+
|
|
729
|
+
endGroup();
|
|
730
|
+
|
|
731
|
+
HGroup({ width: "100%", height: "auto", align: "left center", gap: 16 });
|
|
732
|
+
|
|
733
|
+
createButton("Update Password", "", function() {
|
|
734
|
+
|
|
735
|
+
const showMessage = function(text, color) {
|
|
736
|
+
lblAccountMessage.text = text;
|
|
737
|
+
lblAccountMessage.textColor = color;
|
|
738
|
+
};
|
|
739
|
+
|
|
740
|
+
if (!inputCurrent.getInputValue()) return showMessage("Enter your current password.", ERROR_COLOR);
|
|
741
|
+
if (!inputNew.isValid()) return showMessage("New password: " + inputNew.warningText, ERROR_COLOR);
|
|
742
|
+
if (inputNew.getInputValue() != inputConfirm.getInputValue()) return showMessage("New passwords do not match.", ERROR_COLOR);
|
|
743
|
+
|
|
744
|
+
// TODO: Change the password with your service.
|
|
745
|
+
[inputCurrent, inputNew, inputConfirm].forEach(function(input) { input.setInputValue(""); });
|
|
746
|
+
showMessage("Password is updated.", ACCENT_COLOR);
|
|
747
|
+
|
|
748
|
+
});
|
|
749
|
+
|
|
750
|
+
lblAccountMessage = Label({ text: "", fontSize: 13 });
|
|
751
|
+
|
|
752
|
+
endGroup();
|
|
753
|
+
|
|
754
|
+
endCard();
|
|
755
|
+
|
|
756
|
+
startCard("Security", "");
|
|
757
|
+
|
|
758
|
+
startSettingLine("Two-factor authentication", "Ask for a code from an authenticator app when signing in");
|
|
759
|
+
toggles.twoFactor = createToggle(function(self) { setDraft("twoFactor", self.value); });
|
|
760
|
+
endSettingLine();
|
|
761
|
+
|
|
762
|
+
createDivider();
|
|
763
|
+
|
|
764
|
+
startSettingLine("Session timeout", "Sign out automatically when the panel is not used");
|
|
765
|
+
|
|
766
|
+
HGroup({ width: "auto", height: "auto", align: "right center", gap: 16 });
|
|
767
|
+
|
|
768
|
+
sliderTimeout = Slider({
|
|
769
|
+
width: 200,
|
|
770
|
+
trackHeight: 10,
|
|
771
|
+
minThumbHeight: 28,
|
|
772
|
+
trackColor: ACCENT_COLOR,
|
|
773
|
+
trackBackgroundColor: Ink(0.1),
|
|
774
|
+
thumbColor: Ink(0.9),
|
|
775
|
+
showValueOnSet: 0,
|
|
776
|
+
showValueOnDrag: 0, // WHY: Slider shows 0-100. Minutes are shown in lblTimeout.
|
|
777
|
+
onDragMove: function(value) {
|
|
778
|
+
lblTimeout.text = sliderToTimeout(value) + " min";
|
|
779
|
+
},
|
|
780
|
+
onDragEnd: function() {
|
|
781
|
+
setDraft("sessionTimeout", sliderToTimeout(sliderTimeout.getValue()));
|
|
782
|
+
},
|
|
783
|
+
});
|
|
784
|
+
|
|
785
|
+
lblTimeout = Label({ text: "", fontSize: 15, textColor: Ink(0.9), width: 70 });
|
|
786
|
+
that.elem.style.fontFamily = "opensans-bold";
|
|
787
|
+
|
|
788
|
+
endGroup();
|
|
789
|
+
|
|
790
|
+
endSettingLine();
|
|
791
|
+
|
|
792
|
+
createDivider();
|
|
793
|
+
|
|
794
|
+
VGroup({ width: "100%", height: "auto", align: "left top", gap: 12 });
|
|
795
|
+
|
|
796
|
+
startSettingLine("Active sessions", "Devices that are signed in to this account");
|
|
797
|
+
createButton("Sign Out Other Sessions", "", function() {
|
|
798
|
+
if (sessionList.length < 2) return;
|
|
799
|
+
Theme.confirm({
|
|
800
|
+
titleText: "Sign Out Other Sessions",
|
|
801
|
+
messageText: "All devices except this one will be signed out.",
|
|
802
|
+
confirmText: "Sign Out",
|
|
803
|
+
onAnswer: function(isConfirmed) {
|
|
804
|
+
if (!isConfirmed || !box) return;
|
|
805
|
+
// TODO: Sign out other sessions with your service.
|
|
806
|
+
sessionList = sessionList.slice(0, 1);
|
|
807
|
+
renderSessions();
|
|
808
|
+
},
|
|
809
|
+
});
|
|
810
|
+
});
|
|
811
|
+
endSettingLine();
|
|
812
|
+
|
|
813
|
+
grpSessionTable = HGroup({ width: "100%", height: "auto", align: "left top" });
|
|
814
|
+
that.elem.style.overflowX = "auto";
|
|
815
|
+
endGroup();
|
|
816
|
+
|
|
817
|
+
endGroup();
|
|
818
|
+
|
|
819
|
+
endCard();
|
|
820
|
+
|
|
821
|
+
endSection();
|
|
822
|
+
|
|
823
|
+
};
|
|
824
|
+
|
|
825
|
+
const renderSessions = function() {
|
|
826
|
+
|
|
827
|
+
if (sessionTable) sessionTable.remove();
|
|
828
|
+
|
|
829
|
+
const previous = getDefaultContainerBox();
|
|
830
|
+
setDefaultContainerBox(grpSessionTable);
|
|
831
|
+
|
|
832
|
+
sessionTable = TinyTable({
|
|
833
|
+
columns: Theme.tableColumns(["DEVICE", "LOCATION", "LAST ACTIVE"], ["44%", "30%", "25%"]),
|
|
834
|
+
rows: sessionList,
|
|
835
|
+
allowHtml: 1, // (the texts are made by the panel, user texts are escaped)
|
|
836
|
+
style: Theme.tableStyle({ headerColor: FIELD_COLOR, bodyColor: CARD_COLOR, borderColor: CARD_BORDER_COLOR }),
|
|
837
|
+
onCellCreate: function(cell) {
|
|
838
|
+
if (cell.columnIndex == 2 && cell.value == "Active now") cell.label.textColor = ACCENT_COLOR;
|
|
839
|
+
},
|
|
840
|
+
});
|
|
841
|
+
Theme.fillTableWidth(sessionTable);
|
|
842
|
+
sessionTable.elem.style.minWidth = "480px";
|
|
843
|
+
|
|
844
|
+
setDefaultContainerBox(previous);
|
|
845
|
+
|
|
846
|
+
};
|
|
847
|
+
|
|
848
|
+
const initNotifications = function() {
|
|
849
|
+
|
|
850
|
+
startSection();
|
|
851
|
+
|
|
852
|
+
startCard("Notifications", "Choose how you get informed");
|
|
853
|
+
|
|
854
|
+
// Header
|
|
855
|
+
HGroup({ width: "100%", height: "auto", align: "left center", gap: 0 });
|
|
856
|
+
Label({ text: "EVENT", fontSize: 11, textColor: Ink(0.45) });
|
|
857
|
+
setFlex(that, "1 1 auto");
|
|
858
|
+
["E-MAIL", "PUSH"].forEach(function(text) {
|
|
859
|
+
Label({ text: text, fontSize: 11, textColor: Ink(0.45), width: 80, textAlign: "center" });
|
|
860
|
+
});
|
|
861
|
+
endGroup();
|
|
862
|
+
|
|
863
|
+
NOTIFY_EVENTS.forEach(function(event) {
|
|
864
|
+
|
|
865
|
+
createDivider();
|
|
866
|
+
|
|
867
|
+
HGroup({ width: "100%", height: "auto", align: "left center", gap: 0 });
|
|
868
|
+
|
|
869
|
+
VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
|
|
870
|
+
setFlex(that, "1 1 auto");
|
|
871
|
+
Label({ text: event.title, fontSize: 15, textColor: Ink(0.9) });
|
|
872
|
+
Label({ text: event.desc, fontSize: 12, textColor: Ink(0.45) });
|
|
873
|
+
endGroup();
|
|
874
|
+
|
|
875
|
+
notifyCheckBoxes[event.key] = {};
|
|
876
|
+
|
|
877
|
+
["email", "push"].forEach(function(channel) {
|
|
878
|
+
HGroup({ width: 80, height: "auto", align: "center center" });
|
|
879
|
+
notifyCheckBoxes[event.key][channel] = createCheckBox("", function(self) {
|
|
880
|
+
if (isRendering) return;
|
|
881
|
+
draft.notify[event.key][channel] = self.checked;
|
|
882
|
+
updateFooter();
|
|
883
|
+
});
|
|
884
|
+
endGroup();
|
|
885
|
+
});
|
|
886
|
+
|
|
887
|
+
endGroup();
|
|
888
|
+
|
|
889
|
+
});
|
|
890
|
+
|
|
891
|
+
endCard();
|
|
892
|
+
|
|
893
|
+
startCard("Schedule", "");
|
|
894
|
+
|
|
895
|
+
startSettingLine("Quiet hours", "Push notifications are not sent in these hours (security alerts are always sent)");
|
|
896
|
+
toggles.quietHours = createToggle(function(self) {
|
|
897
|
+
selectTimes.forEach(function(selectTime) { selectTime.setEnabled(self.value); });
|
|
898
|
+
setDraft("quietHours", self.value);
|
|
899
|
+
});
|
|
900
|
+
endSettingLine();
|
|
901
|
+
|
|
902
|
+
HGroup({ width: "100%", height: "auto", align: "left bottom", gap: 16 });
|
|
903
|
+
that.elem.style.flexWrap = "wrap";
|
|
904
|
+
|
|
905
|
+
[["From", "quietFrom"], ["To", "quietTo"]].forEach(function(item) {
|
|
906
|
+
startField(item[0], "0 0 auto");
|
|
907
|
+
const selectTime = SelectTime({
|
|
908
|
+
width: 130,
|
|
909
|
+
height: 44,
|
|
910
|
+
minuteStep: 30,
|
|
911
|
+
showClearButton: 0,
|
|
912
|
+
style: {
|
|
913
|
+
field: { color: FIELD_COLOR, border: 1, borderColor: CARD_BORDER_COLOR, round: 8 },
|
|
914
|
+
fieldHover: { borderColor: Ink(0.3) },
|
|
915
|
+
fieldFocus: { borderColor: ACCENT_COLOR },
|
|
916
|
+
fieldText: { fontSize: 15, textColor: Ink(0.9) },
|
|
917
|
+
icon: { color: Ink(0.55) },
|
|
918
|
+
panel: { color: FIELD_COLOR, borderColor: Ink(0.12), shadow: "0 8px 24px " + Black(0.5) },
|
|
919
|
+
columnTitle: { textColor: Ink(0.45), activeTextColor: Ink(0.9) },
|
|
920
|
+
cell: { textColor: Ink(0.85), hoverColor: Ink(0.08) },
|
|
921
|
+
selectedCell: { color: PRIMARY_COLOR, textColor: Ink(1) },
|
|
922
|
+
disabledCell: { textColor: Ink(0.2) },
|
|
923
|
+
footerButton: { textColor: ACCENT_COLOR },
|
|
924
|
+
},
|
|
925
|
+
onChange: function(self) {
|
|
926
|
+
if (self.value) setDraft(item[1], self.value);
|
|
927
|
+
},
|
|
928
|
+
});
|
|
929
|
+
selectTimes.push(selectTime);
|
|
930
|
+
endField();
|
|
931
|
+
});
|
|
932
|
+
|
|
933
|
+
endGroup();
|
|
934
|
+
|
|
935
|
+
createDivider();
|
|
936
|
+
|
|
937
|
+
startSettingLine("Weekly report day", "The weekly report is sent on this day at 09:00");
|
|
938
|
+
selects.reportDay = createTinySelect(WEEK_DAYS, function(index, id) { setDraft("reportDay", id); });
|
|
939
|
+
endSettingLine();
|
|
940
|
+
|
|
941
|
+
endCard();
|
|
942
|
+
|
|
943
|
+
endSection();
|
|
944
|
+
|
|
945
|
+
};
|
|
946
|
+
|
|
947
|
+
// One theme of the panel: a small preview (page, card, action color) and its name.
|
|
948
|
+
const createThemeItem = function(item) {
|
|
949
|
+
|
|
950
|
+
const isSelected = (item.name == currentThemeName);
|
|
951
|
+
|
|
952
|
+
const itemBox = VGroup({
|
|
953
|
+
width: 190, height: "auto", align: "left top", gap: 0,
|
|
954
|
+
color: FIELD_COLOR, border: 2, borderColor: (isSelected) ? ACCENT_COLOR : Ink(0.12),
|
|
955
|
+
round: 10, clickable: 1,
|
|
956
|
+
});
|
|
957
|
+
itemBox.elem.style.cursor = "pointer";
|
|
958
|
+
itemBox.clipContent = 1;
|
|
959
|
+
|
|
960
|
+
// PREVIEW: The page of that theme with a card and two buttons on it.
|
|
961
|
+
const preview = Box({ width: "100%", height: 74, color: item.page });
|
|
962
|
+
createIn(preview, function() {
|
|
963
|
+
Box(12, 12, 100, 30, { color: item.surface, border: 1, borderColor: (item.isDark) ? White(0.12) : Black(0.12), round: 6 });
|
|
964
|
+
Box(12, 50, 46, 12, { color: item.primary, round: 4 });
|
|
965
|
+
Box(64, 50, 46, 12, { color: item.surface2, border: 1, borderColor: (item.isDark) ? White(0.12) : Black(0.12), round: 4 });
|
|
966
|
+
Box(124, 12, 54, 50, { color: item.surface, border: 1, borderColor: (item.isDark) ? White(0.12) : Black(0.12), round: 6 });
|
|
967
|
+
});
|
|
968
|
+
|
|
969
|
+
VGroup({ width: "100%", height: "auto", align: "left top", gap: 2, padding: [12, 10] });
|
|
970
|
+
|
|
971
|
+
HGroup({ width: "100%", height: "auto", align: "left center", gap: 8 });
|
|
972
|
+
that.elem.style.justifyContent = "space-between";
|
|
973
|
+
Label({ text: item.label, fontSize: 14, textColor: Ink(0.9) });
|
|
974
|
+
that.elem.style.fontFamily = "opensans-bold";
|
|
975
|
+
if (isSelected) {
|
|
976
|
+
Label({ text: "Selected", fontSize: 11, textColor: Theme.textOn(ACCENT_COLOR), color: ACCENT_COLOR, padding: [8, 2], round: 100 });
|
|
977
|
+
that.elem.style.whiteSpace = "nowrap";
|
|
978
|
+
}
|
|
979
|
+
endGroup();
|
|
980
|
+
|
|
981
|
+
Label({ text: item.desc, fontSize: 12, textColor: Ink(0.45), width: "100%" });
|
|
982
|
+
|
|
983
|
+
endGroup();
|
|
984
|
+
|
|
985
|
+
endGroup();
|
|
986
|
+
|
|
987
|
+
itemBox.on("click", function() { selectTheme(item.name); });
|
|
988
|
+
|
|
989
|
+
return itemBox;
|
|
990
|
+
|
|
991
|
+
};
|
|
992
|
+
|
|
993
|
+
// The panel is created again with the new colors (index.htm builds the top bar and the menu once).
|
|
994
|
+
const selectTheme = function(name) {
|
|
995
|
+
|
|
996
|
+
if (name == currentThemeName) return;
|
|
997
|
+
|
|
998
|
+
// WHY: The page is loaded again, so the draft of this page is lost.
|
|
999
|
+
if (isDirty()) {
|
|
1000
|
+
Theme.confirm({
|
|
1001
|
+
titleText: "Change Theme",
|
|
1002
|
+
messageText: "The panel opens again with the new colors. The changes you did not save are lost.",
|
|
1003
|
+
confirmText: "Change Theme",
|
|
1004
|
+
onAnswer: function(isConfirmed) { if (isConfirmed) applyTheme(name); },
|
|
1005
|
+
});
|
|
1006
|
+
return;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
applyTheme(name);
|
|
1010
|
+
|
|
1011
|
+
};
|
|
1012
|
+
|
|
1013
|
+
const applyTheme = function(name) {
|
|
1014
|
+
basic.storage.save(SettingsPage.SECTION_KEY, 3); // WHY: This page opens again on Appearance.
|
|
1015
|
+
Theme.select(name, SettingsPage.KEY); // Saves the theme and loads the panel again.
|
|
1016
|
+
};
|
|
1017
|
+
|
|
1018
|
+
const initAppearance = function() {
|
|
1019
|
+
|
|
1020
|
+
startSection();
|
|
1021
|
+
|
|
1022
|
+
startCard("Theme", "The colors of the panel. The panel opens again when the theme changes.");
|
|
1023
|
+
|
|
1024
|
+
HGroup({ width: "100%", height: "auto", align: "left top", gap: 14 });
|
|
1025
|
+
that.elem.style.flexWrap = "wrap";
|
|
1026
|
+
|
|
1027
|
+
Theme.getList().forEach(function(item) { createThemeItem(item); });
|
|
1028
|
+
|
|
1029
|
+
endGroup();
|
|
1030
|
+
|
|
1031
|
+
endCard();
|
|
1032
|
+
|
|
1033
|
+
startCard("Panel Color", "Color of the top bar. You see it now; it is kept after Save.");
|
|
1034
|
+
|
|
1035
|
+
HGroup({ width: "100%", height: "auto", align: "left center", gap: 24 });
|
|
1036
|
+
that.elem.style.flexWrap = "wrap";
|
|
1037
|
+
|
|
1038
|
+
SettingsPage.PANEL_COLORS.forEach(function(item) {
|
|
1039
|
+
const swatch = "<span style='display:inline-block; width:14px; height:14px; border-radius:4px; vertical-align:-2px; margin-right:6px; background:" + item.color + "; border:1px solid " + Ink(0.2) + "'></span>";
|
|
1040
|
+
createRadioButton("settingsPanelColor", item.color, swatch + item.name, function(self) {
|
|
1041
|
+
topBar.setBackgroundColor(self.value); // Preview
|
|
1042
|
+
setDraft("panelColor", self.value);
|
|
1043
|
+
});
|
|
1044
|
+
});
|
|
1045
|
+
|
|
1046
|
+
endGroup();
|
|
1047
|
+
|
|
1048
|
+
endCard();
|
|
1049
|
+
|
|
1050
|
+
startCard("Start Page", "");
|
|
1051
|
+
|
|
1052
|
+
startSettingLine("Page after sign in", "This page is opened when the panel starts");
|
|
1053
|
+
selects.startPage = createTinySelect(START_PAGES, function(index, id) { setDraft("startPage", id); });
|
|
1054
|
+
endSettingLine();
|
|
1055
|
+
|
|
1056
|
+
endCard();
|
|
1057
|
+
|
|
1058
|
+
endSection();
|
|
1059
|
+
|
|
1060
|
+
};
|
|
1061
|
+
|
|
1062
|
+
const initAdvanced = function() {
|
|
1063
|
+
|
|
1064
|
+
startSection();
|
|
1065
|
+
|
|
1066
|
+
startCard("API Key", "Use this key to connect your apps. Keep it secret.");
|
|
1067
|
+
|
|
1068
|
+
HGroup({ width: "100%", height: "auto", align: "left center", gap: 10 });
|
|
1069
|
+
that.elem.style.flexWrap = "wrap";
|
|
1070
|
+
|
|
1071
|
+
lblApiKey = Label({
|
|
1072
|
+
text: "",
|
|
1073
|
+
fontSize: 14,
|
|
1074
|
+
textColor: Ink(0.85),
|
|
1075
|
+
color: FIELD_COLOR,
|
|
1076
|
+
border: 1,
|
|
1077
|
+
borderColor: CARD_BORDER_COLOR,
|
|
1078
|
+
round: 8,
|
|
1079
|
+
padding: [14, 10],
|
|
1080
|
+
});
|
|
1081
|
+
lblApiKey.elem.style.fontFamily = "monospace";
|
|
1082
|
+
setFlex(lblApiKey, "1 1 320px");
|
|
1083
|
+
|
|
1084
|
+
const btnShowKey = createButton("Show", "", function() {
|
|
1085
|
+
isApiKeyVisible = (isApiKeyVisible) ? 0 : 1;
|
|
1086
|
+
btnShowKey.setText((isApiKeyVisible) ? "Hide" : "Show");
|
|
1087
|
+
lblApiKey.text = (isApiKeyVisible) ? draft.apiKey : maskApiKey(draft.apiKey);
|
|
1088
|
+
});
|
|
1089
|
+
|
|
1090
|
+
const btnCopyKey = createButton("Copy", "", function() {
|
|
1091
|
+
navigator.clipboard.writeText(draft.apiKey).then(function() {
|
|
1092
|
+
btnCopyKey.setText("Copied");
|
|
1093
|
+
setTimeout(function() { if (box) btnCopyKey.setText("Copy"); }, 1500);
|
|
1094
|
+
});
|
|
1095
|
+
});
|
|
1096
|
+
|
|
1097
|
+
createButton("Regenerate", "", function() {
|
|
1098
|
+
Theme.confirm({
|
|
1099
|
+
titleText: "Regenerate API Key",
|
|
1100
|
+
messageText: "The current key stops working now. Apps that use it must be updated.",
|
|
1101
|
+
confirmText: "Regenerate",
|
|
1102
|
+
onAnswer: function(isConfirmed) {
|
|
1103
|
+
if (!isConfirmed || !box) return;
|
|
1104
|
+
// WHY: A new key is an action on the server. It is saved now, not with the Save button.
|
|
1105
|
+
const key = createApiKey();
|
|
1106
|
+
saved.apiKey = key;
|
|
1107
|
+
draft.apiKey = key;
|
|
1108
|
+
SettingsPage.save(saved);
|
|
1109
|
+
lblApiKey.text = (isApiKeyVisible) ? key : maskApiKey(key);
|
|
1110
|
+
showFooterMessage("A new API key is created.", ACCENT_COLOR, 1);
|
|
1111
|
+
},
|
|
1112
|
+
});
|
|
1113
|
+
});
|
|
1114
|
+
|
|
1115
|
+
endGroup();
|
|
1116
|
+
|
|
1117
|
+
endCard();
|
|
1118
|
+
|
|
1119
|
+
startCard("Maintenance", "");
|
|
1120
|
+
|
|
1121
|
+
startSettingLine("Maintenance mode", "Users see a maintenance page. Admins can still use the panel.");
|
|
1122
|
+
toggles.maintenance = createToggle(function(self) {
|
|
1123
|
+
if (isRendering) return;
|
|
1124
|
+
if (self.value !== 1) return setDraft("maintenance", 0);
|
|
1125
|
+
// Ask before turning on.
|
|
1126
|
+
Theme.confirm({
|
|
1127
|
+
titleText: "Maintenance Mode",
|
|
1128
|
+
messageText: "Your users will not be able to use the app until it is turned off. (After Save)",
|
|
1129
|
+
confirmText: "Turn On",
|
|
1130
|
+
onAnswer: function(isConfirmed) {
|
|
1131
|
+
if (!box) return;
|
|
1132
|
+
if (isConfirmed) {
|
|
1133
|
+
setDraft("maintenance", 1);
|
|
1134
|
+
} else {
|
|
1135
|
+
isRendering = 1;
|
|
1136
|
+
toggles.maintenance.setValue(0);
|
|
1137
|
+
isRendering = 0;
|
|
1138
|
+
}
|
|
1139
|
+
},
|
|
1140
|
+
});
|
|
1141
|
+
});
|
|
1142
|
+
endSettingLine();
|
|
1143
|
+
|
|
1144
|
+
endCard();
|
|
1145
|
+
|
|
1146
|
+
startCard("Backup", "Export the settings to a file, or import them from a file");
|
|
1147
|
+
|
|
1148
|
+
HGroup({ width: "100%", height: "auto", align: "left top", gap: 16 });
|
|
1149
|
+
that.elem.style.flexWrap = "wrap";
|
|
1150
|
+
|
|
1151
|
+
VGroup({ width: "auto", height: "auto", align: "left top", gap: 8 });
|
|
1152
|
+
setFlex(that, "0 0 auto");
|
|
1153
|
+
|
|
1154
|
+
createButton("Export Settings", "arrow_down.png", function() {
|
|
1155
|
+
const data = SettingsPage.clone(saved);
|
|
1156
|
+
delete data.apiKey; // WHY: A secret must not be in a file.
|
|
1157
|
+
const link = document.createElement("a");
|
|
1158
|
+
link.href = URL.createObjectURL(new Blob([JSON.stringify(data, null, 2)], { type: "application/json" }));
|
|
1159
|
+
link.download = "panel-settings.json";
|
|
1160
|
+
link.click();
|
|
1161
|
+
URL.revokeObjectURL(link.href);
|
|
1162
|
+
});
|
|
1163
|
+
Label({ text: "Saved settings (without the API key)", fontSize: 12, textColor: Ink(0.45) });
|
|
1164
|
+
|
|
1165
|
+
endGroup();
|
|
1166
|
+
|
|
1167
|
+
const importFile = SelectFile({
|
|
1168
|
+
width: "auto",
|
|
1169
|
+
zoneHeight: 100,
|
|
1170
|
+
accept: ".json,application/json",
|
|
1171
|
+
maxSize: 100 * 1024,
|
|
1172
|
+
showIcon: 0,
|
|
1173
|
+
showList: 0,
|
|
1174
|
+
titleText: "Drop a settings file here",
|
|
1175
|
+
descText: "or click to select (.json)",
|
|
1176
|
+
style: SELECT_FILE_STYLE,
|
|
1177
|
+
onChange: function(self) {
|
|
1178
|
+
if (!self.files.length) return;
|
|
1179
|
+
self.files[0].file.text().then(function(text) {
|
|
1180
|
+
if (!box) return;
|
|
1181
|
+
try {
|
|
1182
|
+
const imported = JSON.parse(text);
|
|
1183
|
+
if (!imported || typeof imported !== "object" || Array.isArray(imported)) throw new Error();
|
|
1184
|
+
delete imported.apiKey;
|
|
1185
|
+
// Missing keys come from the current draft.
|
|
1186
|
+
mergeIntoIfMissing(imported, SettingsPage.clone(draft)); // NOTE: Changes "imported", returns nothing.
|
|
1187
|
+
draft = imported;
|
|
1188
|
+
fillForm(draft);
|
|
1189
|
+
showFooterMessage("Settings are imported. Check them and press Save.", ACCENT_COLOR);
|
|
1190
|
+
} catch (e) {
|
|
1191
|
+
showFooterMessage("The file is not a valid settings file.", ERROR_COLOR, 1);
|
|
1192
|
+
}
|
|
1193
|
+
self.clear(1);
|
|
1194
|
+
});
|
|
1195
|
+
},
|
|
1196
|
+
onError: function(self, errors) {
|
|
1197
|
+
showFooterMessage(errors[0].message, ERROR_COLOR, 1);
|
|
1198
|
+
},
|
|
1199
|
+
});
|
|
1200
|
+
setFlex(importFile, "1 1 280px");
|
|
1201
|
+
selectFiles.push(importFile);
|
|
1202
|
+
|
|
1203
|
+
endGroup();
|
|
1204
|
+
|
|
1205
|
+
endCard();
|
|
1206
|
+
|
|
1207
|
+
startCard("Reset", "");
|
|
1208
|
+
|
|
1209
|
+
startSettingLine("Reset to defaults", "All settings (except the API key) get their default values. Press Save to keep them.");
|
|
1210
|
+
|
|
1211
|
+
HoldToConfirmButton({
|
|
1212
|
+
height: 40,
|
|
1213
|
+
labelText: "Hold to Reset",
|
|
1214
|
+
completedText: "RESET",
|
|
1215
|
+
iconFile: LIB_PATH + "comp/hold-to-confirm-button/trash.png",
|
|
1216
|
+
holdingIconFile: LIB_PATH + "comp/hold-to-confirm-button/trash-red.png",
|
|
1217
|
+
holdDuration: 1500,
|
|
1218
|
+
resetDelay: 1500,
|
|
1219
|
+
style: {
|
|
1220
|
+
layout: { gap: 6, padding: [14, 0] },
|
|
1221
|
+
icon: { width: 20, height: 20 },
|
|
1222
|
+
label: { fontSize: 14, textColor: Ink(0.9) },
|
|
1223
|
+
holdingLabel: { fontSize: 14, textColor: "#B03A2E" },
|
|
1224
|
+
completedLabel: { fontSize: 14, textColor: T.primaryActive },
|
|
1225
|
+
box: { color: FIELD_COLOR, border: 1, borderColor: CARD_BORDER_COLOR, round: 8 },
|
|
1226
|
+
holdingBox: { color: "#FFD1CB", borderColor: ERROR_COLOR, round: 8 },
|
|
1227
|
+
completedBox: { color: "#DFEFE6", borderColor: ACCENT_COLOR, round: 8 },
|
|
1228
|
+
},
|
|
1229
|
+
onConfirm: function() {
|
|
1230
|
+
const apiKey = draft.apiKey;
|
|
1231
|
+
draft = SettingsPage.clone(SettingsPage.DEFAULTS);
|
|
1232
|
+
draft.apiKey = apiKey;
|
|
1233
|
+
fillForm(draft);
|
|
1234
|
+
},
|
|
1235
|
+
});
|
|
1236
|
+
that.icon.elem.style.filter = T.iconFilter; // WHY: Only the normal icon is on a dark background.
|
|
1237
|
+
|
|
1238
|
+
endSettingLine();
|
|
1239
|
+
|
|
1240
|
+
endCard();
|
|
1241
|
+
|
|
1242
|
+
endSection();
|
|
1243
|
+
|
|
1244
|
+
};
|
|
1245
|
+
|
|
1246
|
+
// *** PUBLIC FUNCTIONS:
|
|
1247
|
+
|
|
1248
|
+
box.destroy = function() {
|
|
1249
|
+
|
|
1250
|
+
clearTimeout(saveTimer);
|
|
1251
|
+
clearTimeout(messageTimer);
|
|
1252
|
+
if (saveTimer && typeof waiting !== "undefined") waiting.close();
|
|
1253
|
+
|
|
1254
|
+
// WHY: Unsaved preview (panel name, color) must not stay after leaving the page.
|
|
1255
|
+
SettingsPage.applyToPanel(saved);
|
|
1256
|
+
|
|
1257
|
+
// WHY: These components have objects, events or static lists on the page. box.remove() does not remove them.
|
|
1258
|
+
radioList.forEach(function(radio) { radio.remove(); });
|
|
1259
|
+
selectTimes.forEach(function(selectTime) { selectTime.remove(); });
|
|
1260
|
+
selectFiles.forEach(function(selectFile) { selectFile.remove(); });
|
|
1261
|
+
|
|
1262
|
+
SettingsPage.refreshOpenPage = null;
|
|
1263
|
+
|
|
1264
|
+
box.remove();
|
|
1265
|
+
box = null;
|
|
1266
|
+
|
|
1267
|
+
};
|
|
1268
|
+
|
|
1269
|
+
// *** PAGE VIEW:
|
|
1270
|
+
|
|
1271
|
+
// BOX: Scrollable container
|
|
1272
|
+
// WHY: page does not scroll. Scrollable content must be inside a Box with scrollY: 1.
|
|
1273
|
+
startBox(0, 0, "100%", "100%", {
|
|
1274
|
+
color: "transparent",
|
|
1275
|
+
scrollY: 1,
|
|
1276
|
+
});
|
|
1277
|
+
|
|
1278
|
+
VGroup({
|
|
1279
|
+
width: "100%",
|
|
1280
|
+
height: "auto", // Grows with content, so the Box can scroll.
|
|
1281
|
+
align: "center top",
|
|
1282
|
+
padding: [24, 24, 24, 110], // Bottom: space for the footer
|
|
1283
|
+
});
|
|
1284
|
+
|
|
1285
|
+
// GROUP: Content (max width for easy reading)
|
|
1286
|
+
VGroup({ width: "100%", height: "auto", align: "left top", gap: 20 });
|
|
1287
|
+
that.elem.style.maxWidth = "960px";
|
|
1288
|
+
|
|
1289
|
+
VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
|
|
1290
|
+
|
|
1291
|
+
Label({ text: "Settings", fontSize: 26, textColor: Ink(0.95) });
|
|
1292
|
+
that.elem.style.fontFamily = "opensans-bold";
|
|
1293
|
+
|
|
1294
|
+
Label({ text: "Manage the panel and your account", fontSize: 14, textColor: Ink(0.5) });
|
|
1295
|
+
|
|
1296
|
+
endGroup();
|
|
1297
|
+
|
|
1298
|
+
sectionTabs = Tabs({
|
|
1299
|
+
variant: "pill",
|
|
1300
|
+
styleName: T.compStyle,
|
|
1301
|
+
tabs: Theme.indexTabs(SECTIONS), // (the key of a tab is its index: self.value)
|
|
1302
|
+
onChange: function(self) {
|
|
1303
|
+
showSection(self.value);
|
|
1304
|
+
},
|
|
1305
|
+
style: Theme.tabsStyle({ barColor: CARD_COLOR, borderColor: CARD_BORDER_COLOR, barPadding: 4, barRound: 10, tabRound: 7, padding: [16, 7], activeColor: PRIMARY_COLOR }),
|
|
1306
|
+
});
|
|
1307
|
+
|
|
1308
|
+
initGeneral();
|
|
1309
|
+
initAccount();
|
|
1310
|
+
initNotifications();
|
|
1311
|
+
initAppearance();
|
|
1312
|
+
initAdvanced();
|
|
1313
|
+
|
|
1314
|
+
endGroup();
|
|
1315
|
+
|
|
1316
|
+
endGroup();
|
|
1317
|
+
|
|
1318
|
+
endBox();
|
|
1319
|
+
|
|
1320
|
+
// FOOTER: Unsaved changes
|
|
1321
|
+
footer = HGroup({
|
|
1322
|
+
width: "100%",
|
|
1323
|
+
height: "auto",
|
|
1324
|
+
align: "center center",
|
|
1325
|
+
padding: [24, 20],
|
|
1326
|
+
opacity: 0,
|
|
1327
|
+
});
|
|
1328
|
+
footer.bottom = 0;
|
|
1329
|
+
footer.setMotion("opacity 0.2s, transform 0.2s");
|
|
1330
|
+
footer.elem.style.transform = "translateY(20px)";
|
|
1331
|
+
|
|
1332
|
+
HGroup({
|
|
1333
|
+
width: "100%",
|
|
1334
|
+
height: "auto",
|
|
1335
|
+
align: "left center",
|
|
1336
|
+
gap: 10,
|
|
1337
|
+
padding: [20, 12],
|
|
1338
|
+
color: T.surface3,
|
|
1339
|
+
border: 1,
|
|
1340
|
+
borderColor: Ink(0.15),
|
|
1341
|
+
round: 12,
|
|
1342
|
+
clickable: 1,
|
|
1343
|
+
});
|
|
1344
|
+
that.elem.style.maxWidth = "960px";
|
|
1345
|
+
that.elem.style.boxShadow = "0 8px 24px " + Black(0.5);
|
|
1346
|
+
|
|
1347
|
+
lblFooter = Label({ text: "", fontSize: 14, textColor: Ink(0.85) });
|
|
1348
|
+
setFlex(lblFooter, "1 1 auto");
|
|
1349
|
+
|
|
1350
|
+
btnDiscard = createButton("Discard", "", discardChanges);
|
|
1351
|
+
|
|
1352
|
+
btnSave = createButton("Save Changes", "", saveSettings, { color: PRIMARY_COLOR, hoverColor: T.primaryHover, activeColor: T.primaryActive });
|
|
1353
|
+
|
|
1354
|
+
endGroup();
|
|
1355
|
+
|
|
1356
|
+
endGroup();
|
|
1357
|
+
|
|
1358
|
+
// WHY: Hidden after the content is created. Objects created in a hidden (display: none) group are not flex items.
|
|
1359
|
+
footer.visible = 0;
|
|
1360
|
+
|
|
1361
|
+
// *** PAGE INIT CODE:
|
|
1362
|
+
|
|
1363
|
+
// WHY: After a theme change the panel is loaded again. The user comes back to Appearance.
|
|
1364
|
+
const savedSection = basic.storage.load(SettingsPage.SECTION_KEY);
|
|
1365
|
+
if (savedSection !== null && savedSection !== undefined) {
|
|
1366
|
+
basic.storage.remove(SettingsPage.SECTION_KEY);
|
|
1367
|
+
box.sectionIndex = savedSection;
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
showSection(box.sectionIndex);
|
|
1371
|
+
renderSessions();
|
|
1372
|
+
fillForm(draft);
|
|
1373
|
+
|
|
1374
|
+
return box.endPage();
|
|
1375
|
+
|
|
1376
|
+
};
|
|
1377
|
+
|
|
1378
|
+
SettingsPage.KEY = "Settings";
|
|
1379
|
+
|
|
1380
|
+
// The section of the page after a reload. (Used by the theme change.)
|
|
1381
|
+
SettingsPage.SECTION_KEY = "appid_settings_section";
|
|
1382
|
+
|
|
1383
|
+
// *** STATIC:
|
|
1384
|
+
|
|
1385
|
+
SettingsPage.STORAGE_KEY = "adminPanel.settings";
|
|
1386
|
+
|
|
1387
|
+
SettingsPage.PANEL_COLORS = [
|
|
1388
|
+
{ name: "Forest", color: "#2C5A38" },
|
|
1389
|
+
{ name: "Teal", color: "#3D7A6B" },
|
|
1390
|
+
{ name: "Ocean", color: "#344F6C" },
|
|
1391
|
+
{ name: "Wine", color: "#583432" },
|
|
1392
|
+
{ name: "Graphite", color: "#2C2C2A" },
|
|
1393
|
+
];
|
|
1394
|
+
|
|
1395
|
+
SettingsPage.DEFAULTS = {
|
|
1396
|
+
// General
|
|
1397
|
+
panelName: "MY PANEL",
|
|
1398
|
+
supportEmail: "support@mypanel.com",
|
|
1399
|
+
logoName: "",
|
|
1400
|
+
language: "en",
|
|
1401
|
+
timeZone: "Europe/Istanbul",
|
|
1402
|
+
dateFormat: "DD.MM.YYYY",
|
|
1403
|
+
// Account
|
|
1404
|
+
fullName: "Bugra Ozden",
|
|
1405
|
+
email: "demo@example.com",
|
|
1406
|
+
twoFactor: 0,
|
|
1407
|
+
sessionTimeout: 30, // Minutes
|
|
1408
|
+
// Notifications
|
|
1409
|
+
notify: {
|
|
1410
|
+
signup: { email: 1, push: 0 },
|
|
1411
|
+
order: { email: 1, push: 1 },
|
|
1412
|
+
report: { email: 1, push: 0 },
|
|
1413
|
+
security: { email: 1, push: 1 },
|
|
1414
|
+
},
|
|
1415
|
+
quietHours: 1,
|
|
1416
|
+
quietFrom: "22:00",
|
|
1417
|
+
quietTo: "08:00",
|
|
1418
|
+
reportDay: "mon",
|
|
1419
|
+
// Appearance
|
|
1420
|
+
panelColor: "#2C5A38",
|
|
1421
|
+
startPage: "Home",
|
|
1422
|
+
// Advanced
|
|
1423
|
+
maintenance: 0,
|
|
1424
|
+
apiKey: "sk_live_7f3a9c2e1b8d4f6a0e5c3b9d2a7f1e4c",
|
|
1425
|
+
};
|
|
1426
|
+
|
|
1427
|
+
SettingsPage.clone = function(value) {
|
|
1428
|
+
return JSON.parse(JSON.stringify(value));
|
|
1429
|
+
};
|
|
1430
|
+
|
|
1431
|
+
// Saved settings. Missing keys (new settings in a new version) get the default values.
|
|
1432
|
+
SettingsPage.load = function() {
|
|
1433
|
+
// TODO: Load the settings from your service.
|
|
1434
|
+
const stored = basic.storage.load(SettingsPage.STORAGE_KEY);
|
|
1435
|
+
const settings = (stored && typeof stored === "object") ? stored : {};
|
|
1436
|
+
mergeIntoIfMissing(settings, SettingsPage.clone(SettingsPage.DEFAULTS)); // NOTE: Changes "settings", returns nothing.
|
|
1437
|
+
return settings;
|
|
1438
|
+
};
|
|
1439
|
+
|
|
1440
|
+
SettingsPage.save = function(settings) {
|
|
1441
|
+
// TODO: Save the settings to your service.
|
|
1442
|
+
basic.storage.save(SettingsPage.STORAGE_KEY, settings);
|
|
1443
|
+
};
|
|
1444
|
+
|
|
1445
|
+
// Set by the Settings page while it is open. (null: the page is closed)
|
|
1446
|
+
SettingsPage.refreshOpenPage = null;
|
|
1447
|
+
|
|
1448
|
+
// Saves the settings from outside of the Settings page (top bar, user menu), uses them in the panel
|
|
1449
|
+
// and updates the Settings page if it is open.
|
|
1450
|
+
SettingsPage.saveAndApply = function(settings) {
|
|
1451
|
+
SettingsPage.save(settings);
|
|
1452
|
+
SettingsPage.applyToPanel(settings);
|
|
1453
|
+
if (SettingsPage.refreshOpenPage) SettingsPage.refreshOpenPage(settings);
|
|
1454
|
+
};
|
|
1455
|
+
|
|
1456
|
+
// Uses the settings in the panel. (Called by index.htm on start, and by the page for preview and after save.)
|
|
1457
|
+
SettingsPage.applyToPanel = function(settings) {
|
|
1458
|
+
if (!window.topBar) return;
|
|
1459
|
+
topBar.setBackgroundColor(settings.panelColor);
|
|
1460
|
+
topBar.setPanelName(settings.panelName);
|
|
1461
|
+
if (topBar.applySettings) topBar.applySettings(settings); // Language, maintenance mode, user name
|
|
1462
|
+
};
|