create-basicjs 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/create-basicjs.js +2 -2
- package/bin/verify-package.js +16 -0
- package/package.json +4 -1
- package/payload/starter/AGENTS.md +84 -0
- package/payload/starter/CLAUDE.md +1 -0
- package/payload/starter/README.md +45 -0
- package/payload/starter/_basic/VERSION +1 -0
- package/payload/starter/_basic/assets/categories/cappuccino.png +0 -0
- package/payload/starter/_basic/assets/categories/chocolate-milk.png +0 -0
- package/payload/starter/_basic/assets/categories/coffee-cup.png +0 -0
- package/payload/starter/_basic/assets/categories/coffee.png +0 -0
- package/payload/starter/_basic/assets/categories/frappe.png +0 -0
- package/payload/starter/_basic/assets/categories/iced-caffee.png +0 -0
- package/payload/starter/_basic/assets/categories/milkshake.png +0 -0
- package/payload/starter/_basic/assets/categories/orange-juice.png +0 -0
- package/payload/starter/_basic/assets/categories/tea.png +0 -0
- package/payload/starter/_basic/assets/data-table/palette.svg +2 -0
- package/payload/starter/_basic/assets/data-table/people.js +104 -0
- package/payload/starter/_basic/assets/data-table/trash.svg +2 -0
- package/payload/starter/_basic/assets/fruids/brokoli.png +0 -0
- package/payload/starter/_basic/assets/fruids/cilek.png +0 -0
- package/payload/starter/_basic/assets/fruids/domates.png +0 -0
- package/payload/starter/_basic/assets/fruids/elma.png +0 -0
- package/payload/starter/_basic/assets/fruids/havuc.png +0 -0
- package/payload/starter/_basic/assets/fruids/karpuz.png +0 -0
- package/payload/starter/_basic/assets/fruids/limon.png +0 -0
- package/payload/starter/_basic/assets/fruids/muz.png +0 -0
- package/payload/starter/_basic/assets/fruids/nar.png +0 -0
- package/payload/starter/_basic/assets/fruids/patlican.png +0 -0
- package/payload/starter/_basic/assets/fruids/yabanmersini.png +0 -0
- package/payload/starter/_basic/assets/fruids/yesilbiber.png +0 -0
- package/payload/starter/_basic/assets/icons/alert-black.png +0 -0
- package/payload/starter/_basic/assets/icons/alert.png +0 -0
- package/payload/starter/_basic/assets/icons/arrow-drop.svg +3 -0
- package/payload/starter/_basic/assets/icons/arrow-rise.svg +3 -0
- package/payload/starter/_basic/assets/icons/close.svg +1 -0
- package/payload/starter/_basic/assets/icons/lamp-on.png +0 -0
- package/payload/starter/_basic/assets/icons/lamp.png +0 -0
- package/payload/starter/_basic/assets/icons/lock.png +0 -0
- package/payload/starter/_basic/assets/icons/panel.png +0 -0
- package/payload/starter/_basic/assets/icons/plant.png +0 -0
- package/payload/starter/_basic/assets/icons/trash.png +0 -0
- package/payload/starter/_basic/assets/icons/trash.svg +2 -0
- package/payload/starter/_basic/assets/tab-bar/settings.png +0 -0
- package/payload/starter/_basic/assets/tab-bar/status.png +0 -0
- package/payload/starter/_basic/assets/tab-bar/transactions.png +0 -0
- package/payload/starter/_basic/assets/tutorial/blueberries.png +0 -0
- package/payload/starter/_basic/assets/tutorial/carrot.png +0 -0
- package/payload/starter/_basic/assets/tutorial/olives.png +0 -0
- package/payload/starter/_basic/assets/tutorial/strawberry.png +0 -0
- package/payload/starter/_basic/assets/ui-bottom-bar/setting.svg +11 -0
- package/payload/starter/_basic/basic/LICENSE +14 -0
- package/payload/starter/_basic/basic/basic.css +277 -0
- package/payload/starter/_basic/basic/basic.js +3767 -0
- package/payload/starter/_basic/basic/basic.min.css +1 -0
- package/payload/starter/_basic/basic/basic.min.js +65 -0
- package/payload/starter/_basic/basic/font/open-sans/LICENSE.txt +206 -0
- package/payload/starter/_basic/basic/font/open-sans/OpenSans-Bold.ttf +0 -0
- package/payload/starter/_basic/basic/font/open-sans/OpenSans-Regular.ttf +0 -0
- package/payload/starter/_basic/basic/scroll-bar.js +536 -0
- package/payload/starter/_basic/basic/scroll-bar.min.js +2 -0
- package/payload/starter/_basic/comp/action-button/add.png +0 -0
- package/payload/starter/_basic/comp/action-button.js +522 -0
- package/payload/starter/_basic/comp/action-tab-bar.js +383 -0
- package/payload/starter/_basic/comp/app-bar.js +236 -0
- package/payload/starter/_basic/comp/badge-v2.js +246 -0
- package/payload/starter/_basic/comp/bottom-bar.js +547 -0
- package/payload/starter/_basic/comp/breadcrumbs.js +522 -0
- package/payload/starter/_basic/comp/chart-box/chart-4.5.1.umd.min.js +13 -0
- package/payload/starter/_basic/comp/chart-box/chart-js-LICENSE.md +9 -0
- package/payload/starter/_basic/comp/chart-box.js +868 -0
- package/payload/starter/_basic/comp/check-box.js +374 -0
- package/payload/starter/_basic/comp/context-menu.js +634 -0
- package/payload/starter/_basic/comp/currency-input-b.js +190 -0
- package/payload/starter/_basic/comp/data-table/arrow.svg +2 -0
- package/payload/starter/_basic/comp/data-table.js +865 -0
- package/payload/starter/_basic/comp/dialog.js +854 -0
- package/payload/starter/_basic/comp/email-input-b.js +57 -0
- package/payload/starter/_basic/comp/filters.js +493 -0
- package/payload/starter/_basic/comp/form.js +590 -0
- package/payload/starter/_basic/comp/full-screen-select/arrow.svg +2 -0
- package/payload/starter/_basic/comp/full-screen-select/cancel.svg +2 -0
- package/payload/starter/_basic/comp/full-screen-select.js +611 -0
- package/payload/starter/_basic/comp/gauge.js +435 -0
- package/payload/starter/_basic/comp/hold-to-confirm-button/trash-red.png +0 -0
- package/payload/starter/_basic/comp/hold-to-confirm-button/trash.png +0 -0
- package/payload/starter/_basic/comp/hold-to-confirm-button.js +280 -0
- package/payload/starter/_basic/comp/input-b.js +759 -0
- package/payload/starter/_basic/comp/item-list.js +1396 -0
- package/payload/starter/_basic/comp/label-editor.js +1137 -0
- package/payload/starter/_basic/comp/left-menu/_Material Symbols & Icons - Google Fonts.webloc +8 -0
- package/payload/starter/_basic/comp/left-menu/data-table.png +0 -0
- package/payload/starter/_basic/comp/left-menu/home.png +0 -0
- package/payload/starter/_basic/comp/left-menu/reports.png +0 -0
- package/payload/starter/_basic/comp/left-menu/setting.png +0 -0
- package/payload/starter/_basic/comp/left-menu.js +476 -0
- package/payload/starter/_basic/comp/line-progress-bar.js +192 -0
- package/payload/starter/_basic/comp/loading-screen.js +382 -0
- package/payload/starter/_basic/comp/login-page-v2.js +586 -0
- package/payload/starter/_basic/comp/mini-graph-box.js +483 -0
- package/payload/starter/_basic/comp/notice.js +227 -0
- package/payload/starter/_basic/comp/number-input-b.js +121 -0
- package/payload/starter/_basic/comp/numeric-keyboard.js +296 -0
- package/payload/starter/_basic/comp/page-control.js +745 -0
- package/payload/starter/_basic/comp/page-header.js +190 -0
- package/payload/starter/_basic/comp/password-input-b/hide-btn.png +0 -0
- package/payload/starter/_basic/comp/password-input-b/hide-btn2.png +0 -0
- package/payload/starter/_basic/comp/password-input-b/show-btn.png +0 -0
- package/payload/starter/_basic/comp/password-input-b/show-btn2.png +0 -0
- package/payload/starter/_basic/comp/password-input-b.js +164 -0
- package/payload/starter/_basic/comp/period-bar.js +435 -0
- package/payload/starter/_basic/comp/phone-input-b.js +287 -0
- package/payload/starter/_basic/comp/progress-bar.js +676 -0
- package/payload/starter/_basic/comp/property-panel.js +2740 -0
- package/payload/starter/_basic/comp/radio-button.js +467 -0
- package/payload/starter/_basic/comp/rich-text-editor.js +1061 -0
- package/payload/starter/_basic/comp/scrolling-text.js +296 -0
- package/payload/starter/_basic/comp/search-input-v2/clear-round.svg +1 -0
- package/payload/starter/_basic/comp/search-input-v2/clear.svg +1 -0
- package/payload/starter/_basic/comp/search-input-v2/filter.png +0 -0
- package/payload/starter/_basic/comp/search-input-v2/filter.svg +1 -0
- package/payload/starter/_basic/comp/search-input-v2/search.svg +1 -0
- package/payload/starter/_basic/comp/search-input-v2.js +427 -0
- package/payload/starter/_basic/comp/search-results.js +560 -0
- package/payload/starter/_basic/comp/select-box.js +1740 -0
- package/payload/starter/_basic/comp/select-color.js +603 -0
- package/payload/starter/_basic/comp/select-date.js +1003 -0
- package/payload/starter/_basic/comp/select-file.js +732 -0
- package/payload/starter/_basic/comp/select-time.js +979 -0
- package/payload/starter/_basic/comp/settings-row.js +298 -0
- package/payload/starter/_basic/comp/side-panel.js +573 -0
- package/payload/starter/_basic/comp/slider-field.js +776 -0
- package/payload/starter/_basic/comp/slider.js +368 -0
- package/payload/starter/_basic/comp/smart-button/alert-black.png +0 -0
- package/payload/starter/_basic/comp/smart-button/clock.png +0 -0
- package/payload/starter/_basic/comp/smart-button.js +896 -0
- package/payload/starter/_basic/comp/smart-table/clock.png +0 -0
- package/payload/starter/_basic/comp/smart-table/down.png +0 -0
- package/payload/starter/_basic/comp/smart-table/scroll.png +0 -0
- package/payload/starter/_basic/comp/smart-table/sort.png +0 -0
- package/payload/starter/_basic/comp/smart-table/up.png +0 -0
- package/payload/starter/_basic/comp/smart-table.js +1321 -0
- package/payload/starter/_basic/comp/sortable-list.js +1172 -0
- package/payload/starter/_basic/comp/spark-line-box.js +729 -0
- package/payload/starter/_basic/comp/stepper.js +699 -0
- package/payload/starter/_basic/comp/tabs.js +1317 -0
- package/payload/starter/_basic/comp/tag-input.js +1067 -0
- package/payload/starter/_basic/comp/tap-effect.js +168 -0
- package/payload/starter/_basic/comp/textarea-b.js +184 -0
- package/payload/starter/_basic/comp/time-line.js +324 -0
- package/payload/starter/_basic/comp/tiny-select/arrow.svg +1 -0
- package/payload/starter/_basic/comp/tiny-select.js +282 -0
- package/payload/starter/_basic/comp/tiny-table.js +279 -0
- package/payload/starter/_basic/comp/toast.js +838 -0
- package/payload/starter/_basic/comp/toggle.js +636 -0
- package/payload/starter/_basic/comp/tooltip.js +471 -0
- package/payload/starter/_basic/comp/tree-view.js +1096 -0
- package/payload/starter/_basic/comp/ui-effects.js +1091 -0
- package/payload/starter/_basic/comp/ui-standards.js +402 -0
- package/payload/starter/_basic/comp/url-input-b.js +145 -0
- package/payload/starter/_basic/comp/web-view.js +534 -0
- package/payload/starter/_basic/docs/basic-js-animated-rules.md +90 -0
- package/payload/starter/_basic/docs/basic-js-code-rules.md +91 -0
- package/payload/starter/_basic/docs/basic-js-components.md +134 -0
- package/payload/starter/_basic/docs/basic-js-core.md +131 -0
- package/payload/starter/_basic/docs/component-index.md +522 -0
- package/payload/starter/_basic/docs/component-template.js +416 -0
- package/payload/starter/_basic/docs/handbook/00-introduction.md +125 -0
- package/payload/starter/_basic/docs/handbook/00-what-is-new.md +96 -0
- package/payload/starter/_basic/docs/handbook/01-label.md +104 -0
- package/payload/starter/_basic/docs/handbook/02-box.md +166 -0
- package/payload/starter/_basic/docs/handbook/03-image.md +81 -0
- package/payload/starter/_basic/docs/handbook/04-common-properties.md +159 -0
- package/payload/starter/_basic/docs/handbook/05-autolayout.md +332 -0
- package/payload/starter/_basic/docs/handbook/06-button.md +103 -0
- package/payload/starter/_basic/docs/handbook/07-input.md +78 -0
- package/payload/starter/_basic/docs/handbook/08-page.md +120 -0
- package/payload/starter/_basic/docs/handbook/09-useful-examples.md +309 -0
- package/payload/starter/_basic/docs/handbook/10-motion.md +132 -0
- package/payload/starter/_basic/docs/handbook/11-other-functions.md +92 -0
- package/payload/starter/_basic/docs/handbook/12-utilities.md +123 -0
- package/payload/starter/_basic/docs/handbook/13-sound.md +88 -0
- package/payload/starter/_basic/docs/what-is-new.md +402 -0
- package/payload/starter/_basic/examples/action-button.htm +81 -0
- package/payload/starter/_basic/examples/action-tab-bar.htm +97 -0
- package/payload/starter/_basic/examples/app-bar.htm +140 -0
- package/payload/starter/_basic/examples/badgeV2.htm +68 -0
- package/payload/starter/_basic/examples/bottom-bar/grid.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/grids.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/home.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/homes.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/icon1.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/icon1s.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/icon2.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/icon2s.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/icon3.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/icon3s.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/icon4.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/icon4s.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/search.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/searchs.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/settings.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/settingss.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/tasks.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar/taskss.png +0 -0
- package/payload/starter/_basic/examples/bottom-bar-2.htm +187 -0
- package/payload/starter/_basic/examples/bottom-bar.htm +46 -0
- package/payload/starter/_basic/examples/breadcrumbs.htm +284 -0
- package/payload/starter/_basic/examples/chart-box.htm +287 -0
- package/payload/starter/_basic/examples/check-box-1.htm +220 -0
- package/payload/starter/_basic/examples/check-box-2.htm +212 -0
- package/payload/starter/_basic/examples/check-box-3.htm +179 -0
- package/payload/starter/_basic/examples/context-menu.htm +269 -0
- package/payload/starter/_basic/examples/currency-input-b.htm +71 -0
- package/payload/starter/_basic/examples/data-table-2.htm +67 -0
- package/payload/starter/_basic/examples/data-table-3.htm +72 -0
- package/payload/starter/_basic/examples/data-table-4.htm +144 -0
- package/payload/starter/_basic/examples/data-table-5.htm +152 -0
- package/payload/starter/_basic/examples/data-table.htm +178 -0
- package/payload/starter/_basic/examples/dialog-centered.htm +130 -0
- package/payload/starter/_basic/examples/dialog.htm +209 -0
- package/payload/starter/_basic/examples/email-input-b.htm +67 -0
- package/payload/starter/_basic/examples/filters.htm +115 -0
- package/payload/starter/_basic/examples/form-1.htm +123 -0
- package/payload/starter/_basic/examples/full-screen-select.htm +114 -0
- package/payload/starter/_basic/examples/gauge.htm +133 -0
- package/payload/starter/_basic/examples/hold-to-confirm-button.htm +144 -0
- package/payload/starter/_basic/examples/input-b-ex1.htm +132 -0
- package/payload/starter/_basic/examples/input-b-ex2.htm +136 -0
- package/payload/starter/_basic/examples/input-b-ex3-style.htm +113 -0
- package/payload/starter/_basic/examples/input-b-ex4-custom-unit.htm +112 -0
- package/payload/starter/_basic/examples/input-b-ex5-warning-icon.htm +80 -0
- package/payload/starter/_basic/examples/input-b-ex6-dark.htm +108 -0
- package/payload/starter/_basic/examples/input-b-ex7-ozden.htm +153 -0
- package/payload/starter/_basic/examples/item-list-2.htm +253 -0
- package/payload/starter/_basic/examples/item-list.htm +176 -0
- package/payload/starter/_basic/examples/label-editor.htm +196 -0
- package/payload/starter/_basic/examples/left-menu.htm +81 -0
- package/payload/starter/_basic/examples/line-progress-bar.htm +145 -0
- package/payload/starter/_basic/examples/loading-screen.htm +217 -0
- package/payload/starter/_basic/examples/login-page-dark-v2.htm +269 -0
- package/payload/starter/_basic/examples/login-page-v2.htm +269 -0
- package/payload/starter/_basic/examples/mini-graph-box.htm +229 -0
- package/payload/starter/_basic/examples/notice.htm +79 -0
- package/payload/starter/_basic/examples/number-input-b.htm +68 -0
- package/payload/starter/_basic/examples/numeric-keyboard.htm +100 -0
- package/payload/starter/_basic/examples/page-control.htm +262 -0
- package/payload/starter/_basic/examples/page-header.htm +117 -0
- package/payload/starter/_basic/examples/password-input-b.htm +70 -0
- package/payload/starter/_basic/examples/period-bar.htm +94 -0
- package/payload/starter/_basic/examples/phone-input-b-select-country.htm +298 -0
- package/payload/starter/_basic/examples/phone-input-b.htm +72 -0
- package/payload/starter/_basic/examples/progress-bar-ozden.htm +168 -0
- package/payload/starter/_basic/examples/progress-bar.htm +296 -0
- package/payload/starter/_basic/examples/property-panel.htm +216 -0
- package/payload/starter/_basic/examples/radio-button-1.htm +264 -0
- package/payload/starter/_basic/examples/radio-button-2.htm +256 -0
- package/payload/starter/_basic/examples/radio-button-3.htm +168 -0
- package/payload/starter/_basic/examples/rich-text-editor.htm +228 -0
- package/payload/starter/_basic/examples/scrolling-text.htm +75 -0
- package/payload/starter/_basic/examples/search-input-v2-ozden.htm +128 -0
- package/payload/starter/_basic/examples/search-input-v2-place.htm +80 -0
- package/payload/starter/_basic/examples/search-input-v2.htm +65 -0
- package/payload/starter/_basic/examples/search-results.htm +193 -0
- package/payload/starter/_basic/examples/select-box-ozden-item.htm +114 -0
- package/payload/starter/_basic/examples/select-box-ozden-text.htm +64 -0
- package/payload/starter/_basic/examples/select-box.htm +254 -0
- package/payload/starter/_basic/examples/select-color.htm +215 -0
- package/payload/starter/_basic/examples/select-date.htm +244 -0
- package/payload/starter/_basic/examples/select-file.htm +268 -0
- package/payload/starter/_basic/examples/select-time.htm +249 -0
- package/payload/starter/_basic/examples/settings-row.htm +193 -0
- package/payload/starter/_basic/examples/side-panel-2.htm +270 -0
- package/payload/starter/_basic/examples/side-panel.htm +219 -0
- package/payload/starter/_basic/examples/slider-field.htm +223 -0
- package/payload/starter/_basic/examples/slider.htm +180 -0
- package/payload/starter/_basic/examples/smart-button-2.htm +220 -0
- package/payload/starter/_basic/examples/smart-button-3-ozden.htm +320 -0
- package/payload/starter/_basic/examples/smart-button-4-dark.htm +102 -0
- package/payload/starter/_basic/examples/smart-button-5-features.htm +205 -0
- package/payload/starter/_basic/examples/smart-button.htm +252 -0
- package/payload/starter/_basic/examples/smart-table-1.htm +142 -0
- package/payload/starter/_basic/examples/smart-table-2.htm +191 -0
- package/payload/starter/_basic/examples/smart-table-3.htm +359 -0
- package/payload/starter/_basic/examples/smart-table-4.htm +158 -0
- package/payload/starter/_basic/examples/sortable-list.htm +250 -0
- package/payload/starter/_basic/examples/spark-line-box.htm +285 -0
- package/payload/starter/_basic/examples/stepper-2.htm +172 -0
- package/payload/starter/_basic/examples/stepper.htm +255 -0
- package/payload/starter/_basic/examples/tabs-2/coffee.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i1-white.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i1.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i2-white.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i2.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i3-white.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i3.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i4-white.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i4.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i5-white.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/i5.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/lamp-on.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/lamp.png +0 -0
- package/payload/starter/_basic/examples/tabs-2/search.svg +2 -0
- package/payload/starter/_basic/examples/tabs-2.htm +188 -0
- package/payload/starter/_basic/examples/tabs.htm +300 -0
- package/payload/starter/_basic/examples/tag-input.htm +242 -0
- package/payload/starter/_basic/examples/tap-effect.htm +100 -0
- package/payload/starter/_basic/examples/textarea-b.htm +76 -0
- package/payload/starter/_basic/examples/time-line.htm +226 -0
- package/payload/starter/_basic/examples/tiny-select.htm +86 -0
- package/payload/starter/_basic/examples/tiny-table.htm +109 -0
- package/payload/starter/_basic/examples/toast.htm +262 -0
- package/payload/starter/_basic/examples/toggle-2.htm +163 -0
- package/payload/starter/_basic/examples/toggle-3.htm +218 -0
- package/payload/starter/_basic/examples/toggle.htm +93 -0
- package/payload/starter/_basic/examples/tooltip-2.htm +177 -0
- package/payload/starter/_basic/examples/tooltip-3.htm +212 -0
- package/payload/starter/_basic/examples/tooltip.htm +124 -0
- package/payload/starter/_basic/examples/tree-view.htm +285 -0
- package/payload/starter/_basic/examples/ui-effects.htm +463 -0
- package/payload/starter/_basic/examples/ui-standards.htm +261 -0
- package/payload/starter/_basic/examples/unfinished-login-page-dark-supabase.htm +221 -0
- package/payload/starter/_basic/examples/unfinished-login-page-supabase.htm +221 -0
- package/payload/starter/_basic/examples/url-input-b.htm +85 -0
- package/payload/starter/_basic/examples/web-view.htm +241 -0
- package/payload/starter/_basic/min/action-button.min.js +2 -0
- package/payload/starter/_basic/min/action-tab-bar.min.js +2 -0
- package/payload/starter/_basic/min/app-bar.min.js +2 -0
- package/payload/starter/_basic/min/badge-v2.min.js +2 -0
- package/payload/starter/_basic/min/bottom-bar.min.js +2 -0
- package/payload/starter/_basic/min/breadcrumbs.min.js +2 -0
- package/payload/starter/_basic/min/chart-box.min.js +2 -0
- package/payload/starter/_basic/min/check-box.min.js +2 -0
- package/payload/starter/_basic/min/context-menu.min.js +2 -0
- package/payload/starter/_basic/min/currency-input-b.min.js +2 -0
- package/payload/starter/_basic/min/data-table.min.js +2 -0
- package/payload/starter/_basic/min/dialog.min.js +2 -0
- package/payload/starter/_basic/min/email-input-b.min.js +2 -0
- package/payload/starter/_basic/min/filters.min.js +2 -0
- package/payload/starter/_basic/min/form.min.js +2 -0
- package/payload/starter/_basic/min/full-screen-select.min.js +2 -0
- package/payload/starter/_basic/min/gauge.min.js +2 -0
- package/payload/starter/_basic/min/hold-to-confirm-button.min.js +2 -0
- package/payload/starter/_basic/min/input-b.min.js +2 -0
- package/payload/starter/_basic/min/item-list.min.js +2 -0
- package/payload/starter/_basic/min/label-editor.min.js +2 -0
- package/payload/starter/_basic/min/left-menu.min.js +2 -0
- package/payload/starter/_basic/min/line-progress-bar.min.js +2 -0
- package/payload/starter/_basic/min/loading-screen.min.js +2 -0
- package/payload/starter/_basic/min/login-page-v2.min.js +2 -0
- package/payload/starter/_basic/min/mini-graph-box.min.js +2 -0
- package/payload/starter/_basic/min/notice.min.js +2 -0
- package/payload/starter/_basic/min/number-input-b.min.js +2 -0
- package/payload/starter/_basic/min/numeric-keyboard.min.js +2 -0
- package/payload/starter/_basic/min/page-control.min.js +2 -0
- package/payload/starter/_basic/min/page-header.min.js +2 -0
- package/payload/starter/_basic/min/password-input-b.min.js +2 -0
- package/payload/starter/_basic/min/period-bar.min.js +2 -0
- package/payload/starter/_basic/min/phone-input-b.min.js +2 -0
- package/payload/starter/_basic/min/progress-bar.min.js +2 -0
- package/payload/starter/_basic/min/property-panel.min.js +2 -0
- package/payload/starter/_basic/min/radio-button.min.js +2 -0
- package/payload/starter/_basic/min/rich-text-editor.min.js +2 -0
- package/payload/starter/_basic/min/scrolling-text.min.js +2 -0
- package/payload/starter/_basic/min/search-input-v2.min.js +2 -0
- package/payload/starter/_basic/min/search-results.min.js +2 -0
- package/payload/starter/_basic/min/select-box.min.js +2 -0
- package/payload/starter/_basic/min/select-color.min.js +2 -0
- package/payload/starter/_basic/min/select-date.min.js +2 -0
- package/payload/starter/_basic/min/select-file.min.js +2 -0
- package/payload/starter/_basic/min/select-time.min.js +2 -0
- package/payload/starter/_basic/min/settings-row.min.js +2 -0
- package/payload/starter/_basic/min/side-panel.min.js +2 -0
- package/payload/starter/_basic/min/slider-field.min.js +2 -0
- package/payload/starter/_basic/min/slider.min.js +2 -0
- package/payload/starter/_basic/min/smart-button.min.js +2 -0
- package/payload/starter/_basic/min/smart-table.min.js +2 -0
- package/payload/starter/_basic/min/sortable-list.min.js +2 -0
- package/payload/starter/_basic/min/spark-line-box.min.js +2 -0
- package/payload/starter/_basic/min/stepper.min.js +2 -0
- package/payload/starter/_basic/min/tabs.min.js +2 -0
- package/payload/starter/_basic/min/tag-input.min.js +2 -0
- package/payload/starter/_basic/min/tap-effect.min.js +2 -0
- package/payload/starter/_basic/min/textarea-b.min.js +2 -0
- package/payload/starter/_basic/min/time-line.min.js +2 -0
- package/payload/starter/_basic/min/tiny-select.min.js +2 -0
- package/payload/starter/_basic/min/tiny-table.min.js +2 -0
- package/payload/starter/_basic/min/toast.min.js +2 -0
- package/payload/starter/_basic/min/toggle.min.js +2 -0
- package/payload/starter/_basic/min/tooltip.min.js +2 -0
- package/payload/starter/_basic/min/tree-view.min.js +2 -0
- package/payload/starter/_basic/min/ui-effects.min.js +2 -0
- package/payload/starter/_basic/min/ui-standards.min.js +2 -0
- package/payload/starter/_basic/min/url-input-b.min.js +2 -0
- package/payload/starter/_basic/min/web-view.min.js +2 -0
- package/payload/starter/_basic/tools/build.js +175 -0
- package/payload/starter/_basic/tools/check.js +336 -0
- package/payload/starter/app/app.js +27 -0
- package/payload/starter/assets/.gitkeep +0 -0
- package/payload/starter/gitignore +3 -0
- package/payload/starter/index.htm +23 -0
- package/payload/templates/booking/TEMPLATE.md +77 -0
- package/payload/templates/booking/app/app.js +722 -0
- package/payload/templates/booking/app/settings.js +52 -0
- package/payload/templates/booking/app/store.js +265 -0
- package/payload/templates/booking/app/texts.js +148 -0
- package/payload/templates/booking/assets/app-icon.svg +1 -0
- package/payload/templates/booking/assets/tabs/account.svg +1 -0
- package/payload/templates/booking/assets/tabs/appointments.svg +1 -0
- package/payload/templates/booking/assets/tabs/home.svg +1 -0
- package/payload/templates/booking/assets/tabs/services.svg +1 -0
- package/payload/templates/booking/components/booking-ui.js +252 -0
- package/payload/templates/booking/index.htm +53 -0
- package/payload/templates/booking/pages/account.js +124 -0
- package/payload/templates/booking/pages/appointments.js +141 -0
- package/payload/templates/booking/pages/book.js +231 -0
- package/payload/templates/booking/pages/home.js +99 -0
- package/payload/templates/booking/pages/services.js +79 -0
- package/payload/templates/classic/TEMPLATE.md +104 -0
- package/payload/templates/classic/app/app.js +779 -0
- package/payload/templates/classic/app/settings.js +77 -0
- package/payload/templates/classic/assets/_attribute.txt +37 -0
- package/payload/templates/classic/assets/cards/dill.png +0 -0
- package/payload/templates/classic/assets/cards/fennel.png +0 -0
- package/payload/templates/classic/assets/cards/juniper.png +0 -0
- package/payload/templates/classic/assets/cards/olives.png +0 -0
- package/payload/templates/classic/assets/cards/oregano.png +0 -0
- package/payload/templates/classic/assets/cards/pepper.png +0 -0
- package/payload/templates/classic/assets/cards/rosehip.png +0 -0
- package/payload/templates/classic/assets/categories/cappuccino.png +0 -0
- package/payload/templates/classic/assets/categories/chocolate-milk.png +0 -0
- package/payload/templates/classic/assets/categories/coffee-cup.png +0 -0
- package/payload/templates/classic/assets/categories/coffee.png +0 -0
- package/payload/templates/classic/assets/categories/frappe.png +0 -0
- package/payload/templates/classic/assets/categories/iced-caffee.png +0 -0
- package/payload/templates/classic/assets/categories/milkshake.png +0 -0
- package/payload/templates/classic/assets/categories/orange-juice.png +0 -0
- package/payload/templates/classic/assets/categories/tea.png +0 -0
- package/payload/templates/classic/assets/example-tabs/coffee.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i1-white.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i1.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i2-white.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i2.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i3-white.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i3.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i4-white.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i4.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i5-white.png +0 -0
- package/payload/templates/classic/assets/example-tabs/i5.png +0 -0
- package/payload/templates/classic/assets/example-tabs/lamp-on.png +0 -0
- package/payload/templates/classic/assets/example-tabs/lamp.png +0 -0
- package/payload/templates/classic/assets/example-tabs/search.svg +2 -0
- package/payload/templates/classic/assets/files/ai.png +0 -0
- package/payload/templates/classic/assets/files/doc.png +0 -0
- package/payload/templates/classic/assets/files/folder.png +0 -0
- package/payload/templates/classic/assets/files/js.png +0 -0
- package/payload/templates/classic/assets/files/pdf.png +0 -0
- package/payload/templates/classic/assets/files/txt.png +0 -0
- package/payload/templates/classic/assets/files/xls.png +0 -0
- package/payload/templates/classic/assets/icons/arrow-drop.svg +3 -0
- package/payload/templates/classic/assets/icons/arrow-rise.svg +3 -0
- package/payload/templates/classic/assets/icons/download.svg +18 -0
- package/payload/templates/classic/assets/icons/lamp-on.png +0 -0
- package/payload/templates/classic/assets/icons/lamp.png +0 -0
- package/payload/templates/classic/assets/icons/lock-small.png +0 -0
- package/payload/templates/classic/assets/icons/lock.png +0 -0
- package/payload/templates/classic/assets/icons/logo.png +0 -0
- package/payload/templates/classic/assets/icons/trash-red.svg +2 -0
- package/payload/templates/classic/assets/icons/trash.svg +2 -0
- package/payload/templates/classic/assets/menu/t1.png +0 -0
- package/payload/templates/classic/assets/menu/t10.png +0 -0
- package/payload/templates/classic/assets/menu/t11.png +0 -0
- package/payload/templates/classic/assets/menu/t2.png +0 -0
- package/payload/templates/classic/assets/menu/t3.png +0 -0
- package/payload/templates/classic/assets/menu/t4.png +0 -0
- package/payload/templates/classic/assets/menu/t5.png +0 -0
- package/payload/templates/classic/assets/menu/t6.png +0 -0
- package/payload/templates/classic/assets/menu/t7.png +0 -0
- package/payload/templates/classic/assets/menu/t8.png +0 -0
- package/payload/templates/classic/assets/menu/t9.png +0 -0
- package/payload/templates/classic/assets/products/brokoli.png +0 -0
- package/payload/templates/classic/assets/products/cilek.png +0 -0
- package/payload/templates/classic/assets/products/domates.png +0 -0
- package/payload/templates/classic/assets/products/elma.png +0 -0
- package/payload/templates/classic/assets/products/havuc.png +0 -0
- package/payload/templates/classic/assets/products/karpuz.png +0 -0
- package/payload/templates/classic/assets/products/limon.png +0 -0
- package/payload/templates/classic/assets/products/muz.png +0 -0
- package/payload/templates/classic/assets/products/nar.png +0 -0
- package/payload/templates/classic/assets/products/patlican.png +0 -0
- package/payload/templates/classic/assets/products/yabanmersini.png +0 -0
- package/payload/templates/classic/assets/products/yesilbiber.png +0 -0
- package/payload/templates/classic/assets/tab-bar/settings.png +0 -0
- package/payload/templates/classic/assets/tab-bar/status.png +0 -0
- package/payload/templates/classic/assets/tab-bar/transactions.png +0 -0
- package/payload/templates/classic/assets/tabs/grid.png +0 -0
- package/payload/templates/classic/assets/tabs/grids.png +0 -0
- package/payload/templates/classic/assets/tabs/home.png +0 -0
- package/payload/templates/classic/assets/tabs/homes.png +0 -0
- package/payload/templates/classic/assets/tabs/search.png +0 -0
- package/payload/templates/classic/assets/tabs/searchs.png +0 -0
- package/payload/templates/classic/assets/tabs/settings.png +0 -0
- package/payload/templates/classic/assets/tabs/settingss.png +0 -0
- package/payload/templates/classic/assets/tabs/tasks.png +0 -0
- package/payload/templates/classic/assets/tabs/taskss.png +0 -0
- package/payload/templates/classic/html/privacy.htm +58 -0
- package/payload/templates/classic/index.htm +70 -0
- package/payload/templates/classic/pages/dialogs.js +205 -0
- package/payload/templates/classic/pages/example.js +296 -0
- package/payload/templates/classic/pages/examples.js +148 -0
- package/payload/templates/classic/pages/home.js +268 -0
- package/payload/templates/classic/pages/info-pages.js +95 -0
- package/payload/templates/classic/pages/lock.js +70 -0
- package/payload/templates/classic/pages/search.js +153 -0
- package/payload/templates/classic/pages/settings.js +184 -0
- package/payload/templates/classic/pages/tasks.js +221 -0
- package/payload/templates/classic/pages/template-pages.js +240 -0
- package/payload/templates/coffee-shop/TEMPLATE.md +63 -0
- package/payload/templates/coffee-shop/app/app.js +713 -0
- package/payload/templates/coffee-shop/app/settings.js +20 -0
- package/payload/templates/coffee-shop/app/store.js +52 -0
- package/payload/templates/coffee-shop/assets/cappuccino.png +0 -0
- package/payload/templates/coffee-shop/assets/chocolate-milk.png +0 -0
- package/payload/templates/coffee-shop/assets/coffee-art/cocoa.svg +1 -0
- package/payload/templates/coffee-shop/assets/coffee-art/filter.svg +1 -0
- package/payload/templates/coffee-shop/assets/coffee-art/frappe.svg +1 -0
- package/payload/templates/coffee-shop/assets/coffee-art/iced.svg +1 -0
- package/payload/templates/coffee-shop/assets/coffee-art/latte.svg +1 -0
- package/payload/templates/coffee-shop/assets/coffee-art/tea.svg +1 -0
- package/payload/templates/coffee-shop/assets/coffee.png +0 -0
- package/payload/templates/coffee-shop/assets/credits.txt +41 -0
- package/payload/templates/coffee-shop/assets/fonts/OFL.txt +93 -0
- package/payload/templates/coffee-shop/assets/fonts/gelasio-OFL.txt +93 -0
- package/payload/templates/coffee-shop/assets/fonts/gelasio.ttf +0 -0
- package/payload/templates/coffee-shop/assets/frappe.png +0 -0
- package/payload/templates/coffee-shop/assets/iced-caffee.png +0 -0
- package/payload/templates/coffee-shop/assets/tabs/cart.svg +1 -0
- package/payload/templates/coffee-shop/assets/tabs/home.svg +1 -0
- package/payload/templates/coffee-shop/assets/tabs/menu.svg +1 -0
- package/payload/templates/coffee-shop/assets/tabs/rewards.svg +1 -0
- package/payload/templates/coffee-shop/assets/tea.png +0 -0
- package/payload/templates/coffee-shop/components/coffee-ui.js +246 -0
- package/payload/templates/coffee-shop/index.htm +55 -0
- package/payload/templates/coffee-shop/pages/cart.js +82 -0
- package/payload/templates/coffee-shop/pages/drink.js +74 -0
- package/payload/templates/coffee-shop/pages/home.js +54 -0
- package/payload/templates/coffee-shop/pages/menu.js +53 -0
- package/payload/templates/coffee-shop/pages/rewards.js +38 -0
- package/payload/templates/forms/TEMPLATE.md +12 -0
- package/payload/templates/forms/app/app.js +30 -0
- package/payload/templates/forms/appointment-form.htm +969 -0
- package/payload/templates/forms/assets/error.png +0 -0
- package/payload/templates/forms/assets/logo.png +0 -0
- package/payload/templates/forms/assets/logo2.png +0 -0
- package/payload/templates/forms/assets/mail.png +0 -0
- package/payload/templates/forms/assets/success.png +0 -0
- package/payload/templates/forms/contact-form-iframe.htm +24 -0
- package/payload/templates/forms/contact-form-table.sql +11 -0
- package/payload/templates/forms/contact-form-to-mail.htm +358 -0
- package/payload/templates/forms/contact-form-to-supabase.htm +396 -0
- package/payload/templates/forms/dark-contact-form.htm +623 -0
- package/payload/templates/forms/event-registration-form.htm +1056 -0
- package/payload/templates/forms/feedback-form.htm +813 -0
- package/payload/templates/forms/order-form.htm +1187 -0
- package/payload/templates/forms/recruitment-form.htm +698 -0
- package/payload/templates/forms/service/PHPMailer/Exception.php +40 -0
- package/payload/templates/forms/service/PHPMailer/LICENSE +502 -0
- package/payload/templates/forms/service/PHPMailer/PHPMailer.php +5586 -0
- package/payload/templates/forms/service/PHPMailer/SMTP.php +1617 -0
- package/payload/templates/forms/service/readme.md +162 -0
- package/payload/templates/forms/service/send-form-mail.php +941 -0
- package/payload/templates/forms/support-ticket-form.htm +908 -0
- package/payload/templates/panel/TEMPLATE.md +16 -0
- package/payload/templates/panel/assets/_Material Symbols & Icons - Google Fonts.webloc +8 -0
- package/payload/templates/panel/assets/arrow_down.png +0 -0
- package/payload/templates/panel/assets/close.png +0 -0
- package/payload/templates/panel/assets/left-menu/bolt.png +0 -0
- package/payload/templates/panel/assets/left-menu/brick.png +0 -0
- package/payload/templates/panel/assets/left-menu/code.png +0 -0
- package/payload/templates/panel/assets/left-menu/dashboard.png +0 -0
- package/payload/templates/panel/assets/left-menu/data-table.png +0 -0
- package/payload/templates/panel/assets/left-menu/extension.png +0 -0
- package/payload/templates/panel/assets/left-menu/home.png +0 -0
- package/payload/templates/panel/assets/left-menu/reports.png +0 -0
- package/payload/templates/panel/assets/left-menu/setting.png +0 -0
- package/payload/templates/panel/assets/left-menu/url.png +0 -0
- package/payload/templates/panel/assets/light.png +0 -0
- package/payload/templates/panel/assets/maybe.png +0 -0
- package/payload/templates/panel/assets/panel-icon.png +0 -0
- package/payload/templates/panel/assets/top-bar/add.png +0 -0
- package/payload/templates/panel/assets/top-bar/add.svg +1 -0
- package/payload/templates/panel/assets/top-bar/apps.png +0 -0
- package/payload/templates/panel/assets/top-bar/apps.svg +1 -0
- package/payload/templates/panel/assets/top-bar/arrow-down.svg +1 -0
- package/payload/templates/panel/assets/top-bar/bell.svg +1 -0
- package/payload/templates/panel/assets/top-bar/bookmark.png +0 -0
- package/payload/templates/panel/assets/top-bar/bookmark.svg +1 -0
- package/payload/templates/panel/assets/top-bar/cancel.png +0 -0
- package/payload/templates/panel/assets/top-bar/close.svg +1 -0
- package/payload/templates/panel/assets/top-bar/comment.png +0 -0
- package/payload/templates/panel/assets/top-bar/filter.png +0 -0
- package/payload/templates/panel/assets/top-bar/keyboard.svg +1 -0
- package/payload/templates/panel/assets/top-bar/notification.png +0 -0
- package/payload/templates/panel/assets/top-bar/search.png +0 -0
- package/payload/templates/panel/assets/top-bar/search.svg +1 -0
- package/payload/templates/panel/assets/top-bar/user.png +0 -0
- package/payload/templates/panel/assets/top-bar/user.svg +1 -0
- package/payload/templates/panel/assets/warning.png +0 -0
- package/payload/templates/panel/common/bridge.js +1 -0
- package/payload/templates/panel/common/bridge.min.js +0 -0
- package/payload/templates/panel/common/components.js +12 -0
- package/payload/templates/panel/common/full-view.js +107 -0
- package/payload/templates/panel/common/full-view.min.js +1 -0
- package/payload/templates/panel/common/main-view.js +53 -0
- package/payload/templates/panel/common/main-view.min.js +1 -0
- package/payload/templates/panel/common/module-page.js +46 -0
- package/payload/templates/panel/common/module-page.min.js +1 -0
- package/payload/templates/panel/common/right-view.js +77 -0
- package/payload/templates/panel/common/right-view.min.js +1 -0
- package/payload/templates/panel/common/start-page.js +31 -0
- package/payload/templates/panel/common/start-page.min.js +1 -0
- package/payload/templates/panel/common/theme.js +491 -0
- package/payload/templates/panel/common/top-bar-v25-07-29-1.js +330 -0
- package/payload/templates/panel/common/top-bar-v25-07-29-2.js +265 -0
- package/payload/templates/panel/common/top-bar.js +855 -0
- package/payload/templates/panel/common/top-bar.min.js +1 -0
- package/payload/templates/panel/common/ui-standards.css +77 -0
- package/payload/templates/panel/common/ui-standards.js +133 -0
- package/payload/templates/panel/common/ui-standards.min.css +1 -0
- package/payload/templates/panel/common/ui-standards.min.js +1 -0
- package/payload/templates/panel/index.htm +642 -0
- package/payload/templates/panel/managers/database.js +1 -0
- package/payload/templates/panel/managers/database.min.js +1 -0
- package/payload/templates/panel/managers/login.js +2 -0
- package/payload/templates/panel/managers/login.min.js +1 -0
- package/payload/templates/panel/module1/empty-main.htm +27 -0
- package/payload/templates/panel/module10/greenhouse.htm +1362 -0
- package/payload/templates/panel/module11/arduino-projects.htm +1125 -0
- package/payload/templates/panel/module2/empty-full.htm +27 -0
- package/payload/templates/panel/module3/empty-right.htm +27 -0
- package/payload/templates/panel/module4/empty-main-topbar.htm +27 -0
- package/payload/templates/panel/module5/empty-right-topbar.htm +27 -0
- package/payload/templates/panel/module6/energy-hub.htm +1508 -0
- package/payload/templates/panel/module7/3d-printers.htm +1259 -0
- package/payload/templates/panel/module8/cold-rooms.htm +1251 -0
- package/payload/templates/panel/module9/elevator-fleet.htm +1489 -0
- package/payload/templates/panel/pages/_page-template.js +36 -0
- package/payload/templates/panel/pages/_page-template.min.js +1 -0
- package/payload/templates/panel/pages/activity.js +1072 -0
- package/payload/templates/panel/pages/contents.js +1555 -0
- package/payload/templates/panel/pages/contents.min.js +1 -0
- package/payload/templates/panel/pages/customers.js +1171 -0
- package/payload/templates/panel/pages/edit-user.js +381 -0
- package/payload/templates/panel/pages/edit-user.min.js +1 -0
- package/payload/templates/panel/pages/edit-users-table.min.js +1 -0
- package/payload/templates/panel/pages/home.js +637 -0
- package/payload/templates/panel/pages/home.min.js +1 -0
- package/payload/templates/panel/pages/media.js +1538 -0
- package/payload/templates/panel/pages/notifications.js +542 -0
- package/payload/templates/panel/pages/notifications.min.js +1 -0
- package/payload/templates/panel/pages/orders.js +1147 -0
- package/payload/templates/panel/pages/products.js +1281 -0
- package/payload/templates/panel/pages/reports.js +1138 -0
- package/payload/templates/panel/pages/reports.min.js +1 -0
- package/payload/templates/panel/pages/roles.js +1096 -0
- package/payload/templates/panel/pages/settings.js +1462 -0
- package/payload/templates/panel/pages/settings.min.js +1 -0
- package/payload/templates/panel/pages/user-actions.js +456 -0
- package/payload/templates/panel/pages/user-actions.min.js +2 -0
- package/payload/templates/panel/pages/user-list.js +1113 -0
- package/payload/templates/panel/pages/users.js +334 -0
- package/payload/templates/panel/pages/users.min.js +1 -0
- package/payload/templates/shop/TEMPLATE.md +69 -0
- package/payload/templates/shop/app/app.js +727 -0
- package/payload/templates/shop/app/art.js +89 -0
- package/payload/templates/shop/app/settings.js +45 -0
- package/payload/templates/shop/app/store.js +239 -0
- package/payload/templates/shop/app/texts.js +232 -0
- package/payload/templates/shop/assets/app-icon.svg +1 -0
- package/payload/templates/shop/assets/tabs/account.svg +1 -0
- package/payload/templates/shop/assets/tabs/cart.svg +1 -0
- package/payload/templates/shop/assets/tabs/home.svg +1 -0
- package/payload/templates/shop/assets/tabs/shop.svg +1 -0
- package/payload/templates/shop/components/shop-ui.js +343 -0
- package/payload/templates/shop/index.htm +57 -0
- package/payload/templates/shop/pages/account.js +190 -0
- package/payload/templates/shop/pages/cart.js +116 -0
- package/payload/templates/shop/pages/checkout.js +134 -0
- package/payload/templates/shop/pages/favorites.js +37 -0
- package/payload/templates/shop/pages/home.js +86 -0
- package/payload/templates/shop/pages/orders.js +132 -0
- package/payload/templates/shop/pages/product.js +168 -0
- package/payload/templates/shop/pages/shop.js +113 -0
- package/payload/templates/starter/TEMPLATE.md +107 -0
- package/payload/templates/starter/app/app.js +660 -0
- package/payload/templates/starter/app/settings.js +57 -0
- package/payload/templates/starter/assets/app-icon.svg +5 -0
- package/payload/templates/starter/assets/products/brokoli.png +0 -0
- package/payload/templates/starter/assets/products/cilek.png +0 -0
- package/payload/templates/starter/assets/products/domates.png +0 -0
- package/payload/templates/starter/assets/products/elma.png +0 -0
- package/payload/templates/starter/assets/products/havuc.png +0 -0
- package/payload/templates/starter/assets/products/karpuz.png +0 -0
- package/payload/templates/starter/assets/products/limon.png +0 -0
- package/payload/templates/starter/assets/products/muz.png +0 -0
- package/payload/templates/starter/assets/products/nar.png +0 -0
- package/payload/templates/starter/assets/products/patlican.png +0 -0
- package/payload/templates/starter/assets/products/yabanmersini.png +0 -0
- package/payload/templates/starter/assets/products/yesilbiber.png +0 -0
- package/payload/templates/starter/assets/tabs/grid.png +0 -0
- package/payload/templates/starter/assets/tabs/grids.png +0 -0
- package/payload/templates/starter/assets/tabs/home.png +0 -0
- package/payload/templates/starter/assets/tabs/homes.png +0 -0
- package/payload/templates/starter/assets/tabs/settings.png +0 -0
- package/payload/templates/starter/assets/tabs/settingss.png +0 -0
- package/payload/templates/starter/assets/tabs/tasks.png +0 -0
- package/payload/templates/starter/assets/tabs/taskss.png +0 -0
- package/payload/templates/starter/html/about.htm +54 -0
- package/payload/templates/starter/index.htm +57 -0
- package/payload/templates/starter/pages/about.js +23 -0
- package/payload/templates/starter/pages/home.js +81 -0
- package/payload/templates/starter/pages/product.js +45 -0
- package/payload/templates/starter/pages/products.js +61 -0
- package/payload/templates/starter/pages/settings.js +103 -0
- package/payload/templates/starter/pages/tasks.js +187 -0
- package/payload/templates/starter/pages/website.js +29 -0
|
@@ -0,0 +1,1096 @@
|
|
|
1
|
+
/* Bismillah */
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
|
|
5
|
+
Roles & Permissions Page (Template) - v26.09
|
|
6
|
+
|
|
7
|
+
- Roles of the panel users and what each role can do.
|
|
8
|
+
- A permission matrix (module x action), role members, new / duplicate / delete role.
|
|
9
|
+
- Changes are kept in a draft. A bar at the bottom shows "unsaved changes" with Discard and Save.
|
|
10
|
+
- Rules:
|
|
11
|
+
- "Create", "Edit" and "Delete" need "View". (Checking them checks "View"; unchecking "View" unchecks them.)
|
|
12
|
+
- System roles can not be deleted. The permissions of "Admin" can not be changed.
|
|
13
|
+
- "Admin" must have at least one member. Removed members get the default role ("Viewer").
|
|
14
|
+
- Test data is saved to the browser (basic.storage). Replace RolesPage.load() and RolesPage.save()
|
|
15
|
+
with your service calls. NOTE: Always check the permissions on the server too.
|
|
16
|
+
|
|
17
|
+
COMPONENTS:
|
|
18
|
+
- SmartButton (comp-m4): Role list, actions
|
|
19
|
+
- InputB (comp-m2): Role name and description
|
|
20
|
+
- Tabs (comp-m4): Permissions / Members
|
|
21
|
+
- CheckBox (comp-m3): Permission matrix
|
|
22
|
+
- TinySelect (comp-m2): Add a member
|
|
23
|
+
- SearchInput (comp-m2): Filter members
|
|
24
|
+
- ContextMenu (comp-m4): Role actions
|
|
25
|
+
- Dialog, LoadingScreen (comp-m4; Theme.confirm, waiting): Confirm, save
|
|
26
|
+
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
RolesPageDefaults = {
|
|
30
|
+
color: "transparent",
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const RolesPage = function(params = {}) {
|
|
34
|
+
|
|
35
|
+
// BOX: Page container
|
|
36
|
+
let box = startPage(params, RolesPageDefaults, mainView);
|
|
37
|
+
|
|
38
|
+
mainView.setKey(RolesPage.KEY);
|
|
39
|
+
|
|
40
|
+
// *** PRIVATE VARIABLES:
|
|
41
|
+
|
|
42
|
+
const ASSETS = "assets/";
|
|
43
|
+
const LIB_PATH = "_basic/";
|
|
44
|
+
|
|
45
|
+
const CARD_COLOR = T.surface;
|
|
46
|
+
const CARD_BORDER_COLOR = Ink(0.1);
|
|
47
|
+
const FIELD_COLOR = T.surface2;
|
|
48
|
+
const PRIMARY_COLOR = T.primary;
|
|
49
|
+
const ACCENT_COLOR = T.accent;
|
|
50
|
+
const SELECTED_COLOR = "rgba(101, 162, 147, 0.18)";
|
|
51
|
+
const ERROR_COLOR = T.danger;
|
|
52
|
+
|
|
53
|
+
const MODULES = RolesPage.MODULES;
|
|
54
|
+
const ACTIONS = RolesPage.ACTIONS;
|
|
55
|
+
|
|
56
|
+
let data = RolesPage.load(); // { roles, users }
|
|
57
|
+
let selectedRoleId = data.roles[0].id;
|
|
58
|
+
let draft = null; // Selected role + memberIds, changed by the user
|
|
59
|
+
let saved = null; // Same shape, as it is saved (to find changes)
|
|
60
|
+
|
|
61
|
+
let memberSearch = "";
|
|
62
|
+
let saveTimer = null;
|
|
63
|
+
let isRendering = 0; // WHY: Component setters call onChange. Values written by code are not user changes.
|
|
64
|
+
|
|
65
|
+
// Components
|
|
66
|
+
let grpRoleList, lblRoleCount;
|
|
67
|
+
let inputName, inputDescription, lblSystemInfo, btnRoleMenu, roleMenu;
|
|
68
|
+
let tabs, grpPermissionsCard, grpMatrixHost, lblPermissionCount;
|
|
69
|
+
let grpMembersCard, grpMembersHost, addMemberSelect;
|
|
70
|
+
let matrixChecks = {}; // "users.edit" -> CheckBox
|
|
71
|
+
let rowChecks = {}; // "users" -> CheckBox
|
|
72
|
+
let columnChecks = {}; // "edit" -> CheckBox
|
|
73
|
+
let footer, lblFooter, btnDiscard, btnSave;
|
|
74
|
+
|
|
75
|
+
// *** PRIVATE FUNCTIONS:
|
|
76
|
+
|
|
77
|
+
const clone = function(value) {
|
|
78
|
+
return JSON.parse(JSON.stringify(value));
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const getRole = function(id) {
|
|
82
|
+
return data.roles.find(function(role) { return role.id == id; });
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const getMemberIds = function(roleId) {
|
|
86
|
+
return data.users.filter(function(user) { return user.roleId == roleId; }).map(function(user) { return user.id; });
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const createDraft = function(roleId) {
|
|
90
|
+
const role = clone(getRole(roleId));
|
|
91
|
+
role.memberIds = getMemberIds(roleId);
|
|
92
|
+
return role;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const isDirty = function() {
|
|
96
|
+
return JSON.stringify(draft) != JSON.stringify(saved);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const isPermissionLocked = function() {
|
|
100
|
+
return draft.isLocked == 1;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const hasPermission = function(key) {
|
|
104
|
+
return draft.permissions.includes(key);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
// Sets one permission with the "View" rule.
|
|
108
|
+
const setPermission = function(moduleId, action, value) {
|
|
109
|
+
|
|
110
|
+
const module = MODULES.find(function(m) { return m.id == moduleId; });
|
|
111
|
+
const set = new Set(draft.permissions);
|
|
112
|
+
const key = moduleId + "." + action;
|
|
113
|
+
|
|
114
|
+
if (value) {
|
|
115
|
+
set.add(key);
|
|
116
|
+
if (action != "view") set.add(moduleId + ".view"); // WHY: Create, edit and delete need view.
|
|
117
|
+
} else {
|
|
118
|
+
set.delete(key);
|
|
119
|
+
if (action == "view") {
|
|
120
|
+
module.actions.forEach(function(a) { set.delete(moduleId + "." + a); });
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// WHY: Keep the order of the matrix, so the JSON compare (isDirty) does not see a change by order.
|
|
125
|
+
draft.permissions = RolesPage.getAllPermissionKeys().filter(function(k) { return set.has(k); });
|
|
126
|
+
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const uniqueRoleName = function(name) {
|
|
130
|
+
let result = name;
|
|
131
|
+
let index = 2;
|
|
132
|
+
while (data.roles.some(function(role) { return role.name.toLowerCase() == result.toLowerCase(); })) {
|
|
133
|
+
result = name + " " + index++;
|
|
134
|
+
}
|
|
135
|
+
return result;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
// Asks before losing unsaved changes.
|
|
139
|
+
const confirmDiscard = function(onConfirm) {
|
|
140
|
+
if (!isDirty()) return onConfirm();
|
|
141
|
+
Theme.confirm({
|
|
142
|
+
titleText: "Discard Changes?",
|
|
143
|
+
messageText: "You have unsaved changes in <b>" + escapeHtml(saved.name) + "</b>.",
|
|
144
|
+
confirmText: "Discard",
|
|
145
|
+
onAnswer: function(isConfirmed) {
|
|
146
|
+
if (isConfirmed && box) onConfirm();
|
|
147
|
+
},
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
const selectRole = function(roleId) {
|
|
152
|
+
selectedRoleId = roleId;
|
|
153
|
+
saved = createDraft(roleId);
|
|
154
|
+
draft = clone(saved);
|
|
155
|
+
memberSearch = "";
|
|
156
|
+
renderAll();
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
// *** ROLE ACTIONS:
|
|
160
|
+
|
|
161
|
+
const createRole = function(copyFrom) {
|
|
162
|
+
|
|
163
|
+
const role = {
|
|
164
|
+
id: "role-" + Date.now(),
|
|
165
|
+
name: uniqueRoleName((copyFrom) ? copyFrom.name + " (copy)" : "New Role"),
|
|
166
|
+
description: (copyFrom) ? copyFrom.description : "",
|
|
167
|
+
isSystem: 0,
|
|
168
|
+
isLocked: 0,
|
|
169
|
+
permissions: (copyFrom) ? copyFrom.permissions.slice() : ["dashboard.view"],
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
// TODO: Create the role with your service.
|
|
173
|
+
data.roles.push(role);
|
|
174
|
+
RolesPage.save(data);
|
|
175
|
+
|
|
176
|
+
selectRole(role.id);
|
|
177
|
+
|
|
178
|
+
// Ready to rename
|
|
179
|
+
inputName.input.inputElement.focus();
|
|
180
|
+
inputName.input.inputElement.select();
|
|
181
|
+
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
const deleteRole = function(role) {
|
|
185
|
+
|
|
186
|
+
const memberCount = getMemberIds(role.id).length;
|
|
187
|
+
|
|
188
|
+
Theme.confirm({
|
|
189
|
+
titleText: "Delete Role",
|
|
190
|
+
messageText: "<b>" + escapeHtml(role.name) + "</b> will be deleted." + ((memberCount) ? " Its " + memberCount + " member" + ((memberCount > 1) ? "s" : "") + " will get the <b>Viewer</b> role." : ""),
|
|
191
|
+
confirmText: "Delete",
|
|
192
|
+
onAnswer: function(isConfirmed) {
|
|
193
|
+
if (!isConfirmed || !box) return;
|
|
194
|
+
// TODO: Delete the role with your service.
|
|
195
|
+
data.users.forEach(function(user) { if (user.roleId == role.id) user.roleId = RolesPage.DEFAULT_ROLE_ID; });
|
|
196
|
+
data.roles = data.roles.filter(function(r) { return r.id != role.id; });
|
|
197
|
+
RolesPage.save(data);
|
|
198
|
+
selectRole(data.roles[0].id);
|
|
199
|
+
},
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
// An active user (a user without a status is active; User List can suspend one)
|
|
205
|
+
const isActiveUser = function(userId) {
|
|
206
|
+
const user = data.users.find(function(u) { return u.id == userId; });
|
|
207
|
+
return !!user && (user.status || "active") == "active";
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
// Returns an error text, or "".
|
|
211
|
+
const validate = function() {
|
|
212
|
+
const name = draft.name.trim();
|
|
213
|
+
if (!name) return "Role name is required.";
|
|
214
|
+
if (data.roles.some(function(role) { return role.id != draft.id && role.name.toLowerCase() == name.toLowerCase(); })) return "Another role has the name \"" + escapeHtml(name) + "\".";
|
|
215
|
+
// WHY active: a suspended admin can not sign in (the same rule as User List)
|
|
216
|
+
if (draft.id == "admin" && !draft.memberIds.some(isActiveUser)) return "Admin must have at least one active member.";
|
|
217
|
+
return "";
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
const saveRole = function() {
|
|
221
|
+
|
|
222
|
+
const error = validate();
|
|
223
|
+
if (error) return showFooterMessage(error, ERROR_COLOR);
|
|
224
|
+
|
|
225
|
+
btnSave.elem.inert = true;
|
|
226
|
+
if (typeof waiting !== "undefined") waiting.open();
|
|
227
|
+
|
|
228
|
+
// TEST: Like a server request
|
|
229
|
+
saveTimer = setTimeout(function() {
|
|
230
|
+
|
|
231
|
+
if (!box) return;
|
|
232
|
+
|
|
233
|
+
// TODO: Save the role and the members with your service.
|
|
234
|
+
const role = getRole(draft.id);
|
|
235
|
+
role.name = draft.name.trim();
|
|
236
|
+
role.description = draft.description.trim();
|
|
237
|
+
role.permissions = draft.permissions.slice();
|
|
238
|
+
|
|
239
|
+
data.users.forEach(function(user) {
|
|
240
|
+
const isMember = draft.memberIds.includes(user.id);
|
|
241
|
+
if (isMember) user.roleId = role.id;
|
|
242
|
+
else if (user.roleId == role.id) user.roleId = RolesPage.DEFAULT_ROLE_ID; // Removed members
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
RolesPage.save(data);
|
|
246
|
+
|
|
247
|
+
if (typeof waiting !== "undefined") waiting.close();
|
|
248
|
+
btnSave.elem.inert = false;
|
|
249
|
+
|
|
250
|
+
selectRole(role.id);
|
|
251
|
+
showFooterMessage("Changes are saved.", ACCENT_COLOR, 1);
|
|
252
|
+
|
|
253
|
+
}, 500);
|
|
254
|
+
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
// *** RENDER:
|
|
258
|
+
|
|
259
|
+
// Creates the content of a container again. (One group is started and ended in it.)
|
|
260
|
+
// WHY: setDefaultContainerBox() is not in the start/end list of basic.js. After more than one
|
|
261
|
+
// top-level object, the next objects were created in another container. One wrapper group is safe.
|
|
262
|
+
const renderInto = function(container, buildContent, gap = 0) {
|
|
263
|
+
if (container.wrapper) container.wrapper.remove();
|
|
264
|
+
const previous = getDefaultContainerBox();
|
|
265
|
+
setDefaultContainerBox(container);
|
|
266
|
+
container.wrapper = VGroup({ width: "100%", height: "auto", align: "left top", gap: gap });
|
|
267
|
+
buildContent();
|
|
268
|
+
endGroup();
|
|
269
|
+
setDefaultContainerBox(previous);
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
const renderAll = function() {
|
|
273
|
+
renderRoleList();
|
|
274
|
+
renderRoleHeader();
|
|
275
|
+
renderMatrix();
|
|
276
|
+
renderMembers();
|
|
277
|
+
updateFooter();
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
const renderRoleList = function() {
|
|
281
|
+
|
|
282
|
+
lblRoleCount.text = data.roles.length + " roles";
|
|
283
|
+
|
|
284
|
+
renderInto(grpRoleList, function() {
|
|
285
|
+
|
|
286
|
+
data.roles.forEach(function(role) {
|
|
287
|
+
|
|
288
|
+
const isSelected = role.id == selectedRoleId;
|
|
289
|
+
const memberCount = getMemberIds(role.id).length;
|
|
290
|
+
const tag = (role.isSystem) ? " <span style='font-size:11px; padding:1px 6px; border-radius:6px; background:" + Ink(0.08) + "; color:" + Ink(0.55) + "'>SYSTEM</span>" : "";
|
|
291
|
+
|
|
292
|
+
SmartButton({
|
|
293
|
+
styleName: "classic",
|
|
294
|
+
width: "100%",
|
|
295
|
+
labelText: escapeHtml(role.name) + tag + "<br><span style='font-size:12px; color:" + Ink(0.45) + "'>" + memberCount + " member" + ((memberCount == 1) ? "" : "s") + " · " + role.permissions.length + " permissions</span>",
|
|
296
|
+
iconFile: "",
|
|
297
|
+
onClick: function() {
|
|
298
|
+
if (role.id == selectedRoleId) return;
|
|
299
|
+
confirmDiscard(function() { selectRole(role.id); });
|
|
300
|
+
},
|
|
301
|
+
style: {
|
|
302
|
+
layout: { gap: 8, padding: [12, 8], align: "left center" },
|
|
303
|
+
label: { fontSize: 15, textColor: Ink(0.92) },
|
|
304
|
+
box: { color: (isSelected) ? SELECTED_COLOR : "transparent", border: 0, round: 8 },
|
|
305
|
+
hover: { color: (isSelected) ? SELECTED_COLOR : Ink(0.06) },
|
|
306
|
+
active: { color: Ink(0.1) },
|
|
307
|
+
},
|
|
308
|
+
});
|
|
309
|
+
that.label.elem.style.whiteSpace = "normal";
|
|
310
|
+
that.label.elem.style.lineHeight = "20px";
|
|
311
|
+
that.elem.setAttribute("aria-current", (isSelected) ? "true" : "false");
|
|
312
|
+
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
}, 4);
|
|
316
|
+
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
const renderRoleHeader = function() {
|
|
320
|
+
|
|
321
|
+
isRendering = 1;
|
|
322
|
+
inputName.setInputValue(draft.name);
|
|
323
|
+
inputDescription.setInputValue(draft.description);
|
|
324
|
+
isRendering = 0;
|
|
325
|
+
|
|
326
|
+
const canDelete = !draft.isSystem;
|
|
327
|
+
roleMenu.setItemEnabled("delete", canDelete);
|
|
328
|
+
|
|
329
|
+
lblSystemInfo.visible = (draft.isSystem) ? 1 : 0;
|
|
330
|
+
lblSystemInfo.text = (draft.isLocked)
|
|
331
|
+
? "🔒 System role. It has all permissions and can not be changed or deleted."
|
|
332
|
+
: "System role. It can be changed, but not deleted. New users get this role.";
|
|
333
|
+
|
|
334
|
+
// Admin name is also locked.
|
|
335
|
+
setInteractive(inputName, !draft.isLocked);
|
|
336
|
+
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
const renderMatrix = function() {
|
|
340
|
+
|
|
341
|
+
matrixChecks = {};
|
|
342
|
+
rowChecks = {};
|
|
343
|
+
columnChecks = {};
|
|
344
|
+
|
|
345
|
+
const COLUMN_WIDTH = 96;
|
|
346
|
+
|
|
347
|
+
renderInto(grpMatrixHost, function() {
|
|
348
|
+
|
|
349
|
+
// Header
|
|
350
|
+
HGroup({ width: "100%", height: 44, align: "left center", color: FIELD_COLOR, round: 8, padding: [14, 0] });
|
|
351
|
+
|
|
352
|
+
Label({ text: "MODULE", fontSize: 12, textColor: Ink(0.5) });
|
|
353
|
+
that.elem.style.flex = "1 1 auto";
|
|
354
|
+
that.elem.style.letterSpacing = "1px";
|
|
355
|
+
|
|
356
|
+
ACTIONS.forEach(function(action) {
|
|
357
|
+
HGroup({ width: COLUMN_WIDTH, height: "auto", align: "center center" });
|
|
358
|
+
columnChecks[action.id] = createCheckBox(action.name, function(self) {
|
|
359
|
+
// Toggle the column
|
|
360
|
+
MODULES.forEach(function(module) {
|
|
361
|
+
if (module.actions.includes(action.id)) setPermission(module.id, action.id, self.checked);
|
|
362
|
+
});
|
|
363
|
+
afterPermissionChange();
|
|
364
|
+
}, 12);
|
|
365
|
+
columnChecks[action.id].label.textColor = Ink(0.5);
|
|
366
|
+
endGroup();
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
endGroup();
|
|
370
|
+
|
|
371
|
+
// Rows
|
|
372
|
+
MODULES.forEach(function(module, index) {
|
|
373
|
+
|
|
374
|
+
HGroup({ width: "100%", height: "auto", align: "left center", padding: [14, 12] });
|
|
375
|
+
that.elem.style.borderBottom = (index < MODULES.length - 1) ? "1px solid " + Ink(0.06) : "none";
|
|
376
|
+
|
|
377
|
+
HGroup({ width: "auto", height: "auto", align: "left center", gap: 12 });
|
|
378
|
+
that.elem.style.flex = "1 1 auto";
|
|
379
|
+
that.elem.style.minWidth = "0";
|
|
380
|
+
|
|
381
|
+
// Toggle the row
|
|
382
|
+
rowChecks[module.id] = createCheckBox("", function(self) {
|
|
383
|
+
module.actions.forEach(function(action) { setPermission(module.id, action, self.checked); });
|
|
384
|
+
afterPermissionChange();
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
|
|
388
|
+
Label({ text: module.name, fontSize: 15, textColor: Ink(0.92) });
|
|
389
|
+
Label({ text: module.desc, fontSize: 12, textColor: Ink(0.45) });
|
|
390
|
+
endGroup();
|
|
391
|
+
|
|
392
|
+
endGroup();
|
|
393
|
+
|
|
394
|
+
ACTIONS.forEach(function(action) {
|
|
395
|
+
HGroup({ width: COLUMN_WIDTH, height: "auto", align: "center center" });
|
|
396
|
+
if (module.actions.includes(action.id)) {
|
|
397
|
+
const key = module.id + "." + action.id;
|
|
398
|
+
matrixChecks[key] = createCheckBox("", function(self) {
|
|
399
|
+
setPermission(module.id, action.id, self.checked);
|
|
400
|
+
afterPermissionChange();
|
|
401
|
+
});
|
|
402
|
+
matrixChecks[key].elem.setAttribute("aria-label", module.name + ": " + action.name);
|
|
403
|
+
} else {
|
|
404
|
+
Label({ text: "—", fontSize: 14, textColor: Ink(0.2) });
|
|
405
|
+
that.elem.title = "Not used for this module";
|
|
406
|
+
}
|
|
407
|
+
endGroup();
|
|
408
|
+
});
|
|
409
|
+
|
|
410
|
+
endGroup();
|
|
411
|
+
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
});
|
|
415
|
+
|
|
416
|
+
const locked = isPermissionLocked();
|
|
417
|
+
setInteractive(grpMatrixHost, !locked, 0.55);
|
|
418
|
+
|
|
419
|
+
updateMatrixChecks();
|
|
420
|
+
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
// Writes the draft permissions to the check boxes (row and column checks too).
|
|
424
|
+
const updateMatrixChecks = function() {
|
|
425
|
+
|
|
426
|
+
Object.keys(matrixChecks).forEach(function(key) {
|
|
427
|
+
matrixChecks[key].setChecked(hasPermission(key) ? 1 : 0, 1);
|
|
428
|
+
});
|
|
429
|
+
|
|
430
|
+
MODULES.forEach(function(module) {
|
|
431
|
+
const all = module.actions.every(function(action) { return hasPermission(module.id + "." + action); });
|
|
432
|
+
rowChecks[module.id].setChecked(all ? 1 : 0, 1);
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
ACTIONS.forEach(function(action) {
|
|
436
|
+
const modules = MODULES.filter(function(module) { return module.actions.includes(action.id); });
|
|
437
|
+
const all = modules.every(function(module) { return hasPermission(module.id + "." + action.id); });
|
|
438
|
+
columnChecks[action.id].setChecked(all ? 1 : 0, 1);
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
const total = RolesPage.getAllPermissionKeys().length;
|
|
442
|
+
lblPermissionCount.text = draft.permissions.length + " of " + total + " permissions";
|
|
443
|
+
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
const afterPermissionChange = function() {
|
|
447
|
+
updateMatrixChecks();
|
|
448
|
+
updateFooter();
|
|
449
|
+
};
|
|
450
|
+
|
|
451
|
+
const renderMembers = function() {
|
|
452
|
+
|
|
453
|
+
const members = draft.memberIds.map(function(id) { return data.users.find(function(user) { return user.id == id; }); }).filter(Boolean);
|
|
454
|
+
const search = memberSearch.trim().toLowerCase();
|
|
455
|
+
const shown = members.filter(function(user) {
|
|
456
|
+
return !search || user.name.toLowerCase().includes(search) || user.email.toLowerCase().includes(search);
|
|
457
|
+
});
|
|
458
|
+
|
|
459
|
+
tabs.updateTab(1, { text: "Members (" + members.length + ")" });
|
|
460
|
+
|
|
461
|
+
// Add member: users that are not in the draft
|
|
462
|
+
const others = data.users.filter(function(user) { return !draft.memberIds.includes(user.id); });
|
|
463
|
+
isRendering = 1;
|
|
464
|
+
addMemberSelect.setList([{ id: "", label: "Add a member..." }].concat(others.map(function(user) {
|
|
465
|
+
const role = getRole(user.roleId);
|
|
466
|
+
return { id: String(user.id), label: escapeHtml(user.name + " (" + ((role) ? role.name : "—") + ")") };
|
|
467
|
+
})), 0);
|
|
468
|
+
isRendering = 0;
|
|
469
|
+
|
|
470
|
+
const isDefaultRole = draft.id == RolesPage.DEFAULT_ROLE_ID;
|
|
471
|
+
|
|
472
|
+
renderInto(grpMembersHost, function() {
|
|
473
|
+
|
|
474
|
+
if (shown.length == 0) {
|
|
475
|
+
Label({
|
|
476
|
+
text: (members.length) ? "No member matches the search." : "This role has no members yet.",
|
|
477
|
+
width: "100%",
|
|
478
|
+
fontSize: 14,
|
|
479
|
+
textColor: Ink(0.5),
|
|
480
|
+
textAlign: "center",
|
|
481
|
+
padding: [16, 30],
|
|
482
|
+
});
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
shown.forEach(function(user, index) {
|
|
487
|
+
|
|
488
|
+
HGroup({ width: "100%", height: "auto", align: "left center", gap: 12, padding: [4, 10] });
|
|
489
|
+
if (index < shown.length - 1) that.elem.style.borderBottom = "1px solid " + Ink(0.06);
|
|
490
|
+
|
|
491
|
+
// Avatar (initials)
|
|
492
|
+
Label({
|
|
493
|
+
text: user.name.split(" ").map(function(part) { return part[0]; }).join("").slice(0, 2).toUpperCase(),
|
|
494
|
+
width: 38,
|
|
495
|
+
height: 38,
|
|
496
|
+
fontSize: 14,
|
|
497
|
+
textAlign: "center",
|
|
498
|
+
textColor: Theme.textOn(RolesPage.getAvatarColor(user.id)), // (Ink() was black on the dark avatars of the light theme)
|
|
499
|
+
color: RolesPage.getAvatarColor(user.id),
|
|
500
|
+
round: 100,
|
|
501
|
+
});
|
|
502
|
+
that.elem.style.lineHeight = "38px";
|
|
503
|
+
that.elem.style.flexShrink = "0";
|
|
504
|
+
|
|
505
|
+
VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
|
|
506
|
+
that.elem.style.flex = "1 1 auto";
|
|
507
|
+
that.elem.style.minWidth = "0";
|
|
508
|
+
Label({ text: escapeHtml(user.name), fontSize: 15, textColor: Ink(0.92) });
|
|
509
|
+
Label({ text: escapeHtml(user.email), fontSize: 12, textColor: Ink(0.45) });
|
|
510
|
+
endGroup();
|
|
511
|
+
|
|
512
|
+
// WHY: Everybody must have a role. Members of the default role can only move to another role.
|
|
513
|
+
if (!isDefaultRole) {
|
|
514
|
+
const isLastAdmin = draft.id == "admin" && isActiveUser(user.id) && draft.memberIds.filter(isActiveUser).length == 1;
|
|
515
|
+
const btn = createButton("Remove", "", function() {
|
|
516
|
+
draft.memberIds = draft.memberIds.filter(function(id) { return id != user.id; });
|
|
517
|
+
renderMembers();
|
|
518
|
+
updateFooter();
|
|
519
|
+
});
|
|
520
|
+
if (isLastAdmin) setInteractive(btn, false);
|
|
521
|
+
btn.elem.title = (isLastAdmin) ? "Admin must have at least one active member" : "The user gets the Viewer role";
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
endGroup();
|
|
525
|
+
|
|
526
|
+
});
|
|
527
|
+
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
// *** FOOTER:
|
|
533
|
+
|
|
534
|
+
const updateFooter = function() {
|
|
535
|
+
|
|
536
|
+
if (!footer) return;
|
|
537
|
+
|
|
538
|
+
if (isDirty()) {
|
|
539
|
+
lblFooter.text = "You have unsaved changes in <b>" + escapeHtml(saved.name) + "</b>.";
|
|
540
|
+
lblFooter.textColor = Ink(0.85);
|
|
541
|
+
btnDiscard.visible = 1;
|
|
542
|
+
btnSave.visible = 1;
|
|
543
|
+
showFooter(1);
|
|
544
|
+
} else if (!footer.messageTimer) {
|
|
545
|
+
showFooter(0);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
};
|
|
549
|
+
|
|
550
|
+
const showFooterMessage = function(text, color, autoHide = 0) {
|
|
551
|
+
|
|
552
|
+
clearTimeout(footer.messageTimer);
|
|
553
|
+
footer.messageTimer = null;
|
|
554
|
+
|
|
555
|
+
lblFooter.text = text;
|
|
556
|
+
lblFooter.textColor = color;
|
|
557
|
+
btnDiscard.visible = (isDirty()) ? 1 : 0;
|
|
558
|
+
btnSave.visible = (isDirty()) ? 1 : 0;
|
|
559
|
+
showFooter(1);
|
|
560
|
+
|
|
561
|
+
if (autoHide) {
|
|
562
|
+
footer.messageTimer = setTimeout(function() {
|
|
563
|
+
if (!box) return;
|
|
564
|
+
footer.messageTimer = null;
|
|
565
|
+
updateFooter();
|
|
566
|
+
}, 2000);
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
};
|
|
570
|
+
|
|
571
|
+
const showFooter = function(show) {
|
|
572
|
+
footer.visible = (show) ? 1 : 0;
|
|
573
|
+
};
|
|
574
|
+
|
|
575
|
+
// *** VIEW HELPERS:
|
|
576
|
+
|
|
577
|
+
// WHY: Some components have no enabled setting. "inert" blocks the mouse and keyboard for all the children.
|
|
578
|
+
const setInteractive = function(obj, enabled, disabledOpacity = 0.4) {
|
|
579
|
+
obj.elem.inert = !enabled;
|
|
580
|
+
obj.opacity = (enabled) ? 1 : disabledOpacity;
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
const escapeHtml = function(text) {
|
|
584
|
+
return String(text).replace(/[&<>"']/g, function(c) { return { "&": "&", "<": "<", ">": ">", "\"": """, "'": "'" }[c]; });
|
|
585
|
+
};
|
|
586
|
+
|
|
587
|
+
const setFlex = function(obj, flex) {
|
|
588
|
+
obj.elem.style.flex = flex;
|
|
589
|
+
obj.elem.style.minWidth = "0";
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
const startCard = function(params = {}) {
|
|
593
|
+
return VGroup({
|
|
594
|
+
width: "100%",
|
|
595
|
+
height: "auto",
|
|
596
|
+
align: "left top",
|
|
597
|
+
gap: 14,
|
|
598
|
+
padding: 16,
|
|
599
|
+
color: CARD_COLOR,
|
|
600
|
+
border: 1,
|
|
601
|
+
borderColor: CARD_BORDER_COLOR,
|
|
602
|
+
round: 12,
|
|
603
|
+
...params,
|
|
604
|
+
});
|
|
605
|
+
};
|
|
606
|
+
|
|
607
|
+
const createCheckBox = function(labelText, onChange, fontSize = 14) {
|
|
608
|
+
return CheckBox({
|
|
609
|
+
labelText: labelText,
|
|
610
|
+
labelPosition: "right",
|
|
611
|
+
style: {
|
|
612
|
+
layout: { gap: 8, padding: [0, 0] },
|
|
613
|
+
mark: { width: 20, height: 20, color: "transparent", borderColor: Ink(0.35) },
|
|
614
|
+
checkedMark: { color: PRIMARY_COLOR, borderColor: PRIMARY_COLOR },
|
|
615
|
+
hoverMark: { borderColor: Ink(0.7) },
|
|
616
|
+
tick: { color: Ink(1) },
|
|
617
|
+
label: { fontSize: fontSize, textColor: Ink(0.9) },
|
|
618
|
+
},
|
|
619
|
+
onChange: function(self) {
|
|
620
|
+
if (isRendering) return;
|
|
621
|
+
onChange(self);
|
|
622
|
+
},
|
|
623
|
+
});
|
|
624
|
+
};
|
|
625
|
+
|
|
626
|
+
const createButton = function(text, iconFile, onClick, params = {}) {
|
|
627
|
+
const btn = SmartButton({
|
|
628
|
+
styleName: "classic",
|
|
629
|
+
width: params.width || "auto",
|
|
630
|
+
labelText: text,
|
|
631
|
+
iconFile: (iconFile) ? ASSETS + iconFile : "",
|
|
632
|
+
onClick: onClick,
|
|
633
|
+
style: {
|
|
634
|
+
layout: { gap: 8, padding: [14, 8] },
|
|
635
|
+
icon: { width: 18, height: 18 },
|
|
636
|
+
label: { fontSize: 14, textColor: Ink(0.92) },
|
|
637
|
+
box: { color: (params.primary) ? PRIMARY_COLOR : FIELD_COLOR, border: 1, borderColor: CARD_BORDER_COLOR, round: 8 },
|
|
638
|
+
hover: { color: (params.primary) ? T.primaryHover : T.surface3 },
|
|
639
|
+
active: { color: (params.primary) ? T.primaryActive : T.surface4 },
|
|
640
|
+
},
|
|
641
|
+
});
|
|
642
|
+
if (btn.icon) btn.icon.elem.style.filter = T.iconFilter; // WHY: Panel icons are black.
|
|
643
|
+
return btn;
|
|
644
|
+
};
|
|
645
|
+
|
|
646
|
+
// Dark style for InputB
|
|
647
|
+
const createInput = function(params) {
|
|
648
|
+
const input = InputB({
|
|
649
|
+
width: "100%",
|
|
650
|
+
leftPadding: 14,
|
|
651
|
+
rightPadding: 36,
|
|
652
|
+
backgroundColor: FIELD_COLOR,
|
|
653
|
+
selectedBackgroundColor: T.surface3,
|
|
654
|
+
lineColor: "transparent",
|
|
655
|
+
selectedLineColor: "transparent",
|
|
656
|
+
backBorderColor: CARD_BORDER_COLOR,
|
|
657
|
+
selectedBackBorderColor: ACCENT_COLOR,
|
|
658
|
+
backBorderTopRound: 8,
|
|
659
|
+
backBorderBottomRound: 8,
|
|
660
|
+
requiredColor: ERROR_COLOR,
|
|
661
|
+
warningColor: ERROR_COLOR,
|
|
662
|
+
...params,
|
|
663
|
+
});
|
|
664
|
+
// WHY: InputB has fixed text colors for light backgrounds.
|
|
665
|
+
input.title.textColor = Ink(0.45);
|
|
666
|
+
input.title.fontSize = 11;
|
|
667
|
+
input.title.elem.style.letterSpacing = "1px";
|
|
668
|
+
input.input.textColor = Ink(0.9);
|
|
669
|
+
input.input.fontSize = 16;
|
|
670
|
+
input.input.height = 34;
|
|
671
|
+
input.warningBall.borderColor = CARD_COLOR;
|
|
672
|
+
return input;
|
|
673
|
+
};
|
|
674
|
+
|
|
675
|
+
// *** PUBLIC FUNCTIONS:
|
|
676
|
+
|
|
677
|
+
box.destroy = function() {
|
|
678
|
+
|
|
679
|
+
clearTimeout(saveTimer);
|
|
680
|
+
if (footer) clearTimeout(footer.messageTimer);
|
|
681
|
+
if (saveTimer && typeof waiting !== "undefined") waiting.close();
|
|
682
|
+
|
|
683
|
+
// WHY: The menu is created on the page. box.remove() does not remove it.
|
|
684
|
+
if (roleMenu) roleMenu.remove();
|
|
685
|
+
|
|
686
|
+
box.remove();
|
|
687
|
+
box = null;
|
|
688
|
+
|
|
689
|
+
};
|
|
690
|
+
|
|
691
|
+
// *** PAGE VIEW:
|
|
692
|
+
|
|
693
|
+
const initHeader = function() {
|
|
694
|
+
|
|
695
|
+
HGroup({ width: "100%", height: "auto", align: "left center", gap: 16 });
|
|
696
|
+
that.elem.style.flexWrap = "wrap";
|
|
697
|
+
that.elem.style.justifyContent = "space-between";
|
|
698
|
+
|
|
699
|
+
VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
|
|
700
|
+
|
|
701
|
+
Label({ text: "Roles & Permissions", fontSize: 26, textColor: Ink(0.95) });
|
|
702
|
+
that.elem.style.fontFamily = "opensans-bold";
|
|
703
|
+
|
|
704
|
+
Label({ text: "Control what each role can see and do in the panel", fontSize: 14, textColor: Ink(0.5) });
|
|
705
|
+
|
|
706
|
+
endGroup();
|
|
707
|
+
|
|
708
|
+
createButton("New Role", "top-bar/add.png", function() {
|
|
709
|
+
confirmDiscard(function() { createRole(null); });
|
|
710
|
+
}, { primary: 1 });
|
|
711
|
+
|
|
712
|
+
endGroup();
|
|
713
|
+
|
|
714
|
+
};
|
|
715
|
+
|
|
716
|
+
const initSidebar = function() {
|
|
717
|
+
|
|
718
|
+
const sidebar = startCard({ gap: 8, padding: 8 });
|
|
719
|
+
setFlex(sidebar, "0 0 280px");
|
|
720
|
+
|
|
721
|
+
HGroup({ width: "100%", height: "auto", align: "left center", padding: [8, 6] });
|
|
722
|
+
that.elem.style.justifyContent = "space-between";
|
|
723
|
+
Label({ text: "ROLES", fontSize: 11, textColor: Ink(0.45) });
|
|
724
|
+
that.elem.style.letterSpacing = "1px";
|
|
725
|
+
lblRoleCount = Label({ text: "", fontSize: 12, textColor: Ink(0.45) });
|
|
726
|
+
endGroup();
|
|
727
|
+
|
|
728
|
+
grpRoleList = VGroup({ width: "100%", height: "auto", align: "left top" });
|
|
729
|
+
endGroup();
|
|
730
|
+
|
|
731
|
+
endGroup();
|
|
732
|
+
|
|
733
|
+
};
|
|
734
|
+
|
|
735
|
+
const initRoleHeader = function() {
|
|
736
|
+
|
|
737
|
+
startCard();
|
|
738
|
+
|
|
739
|
+
HGroup({ width: "100%", height: "auto", align: "left top", gap: 12 });
|
|
740
|
+
|
|
741
|
+
inputName = createInput({
|
|
742
|
+
titleText: "ROLE NAME",
|
|
743
|
+
placeholder: "Ex: Editor",
|
|
744
|
+
maxChar: 40,
|
|
745
|
+
onEdit: function() {
|
|
746
|
+
if (isRendering) return;
|
|
747
|
+
draft.name = inputName.getInputValue();
|
|
748
|
+
updateFooter();
|
|
749
|
+
},
|
|
750
|
+
});
|
|
751
|
+
setFlex(inputName, "1 1 auto");
|
|
752
|
+
|
|
753
|
+
// BUTTON: Role actions
|
|
754
|
+
btnRoleMenu = createButton("•••", "", function() { });
|
|
755
|
+
btnRoleMenu.elem.setAttribute("aria-label", "Role actions");
|
|
756
|
+
btnRoleMenu.elem.style.marginTop = "12px";
|
|
757
|
+
|
|
758
|
+
endGroup();
|
|
759
|
+
|
|
760
|
+
inputDescription = createInput({
|
|
761
|
+
titleText: "DESCRIPTION",
|
|
762
|
+
placeholder: "What is this role for? (Optional)",
|
|
763
|
+
maxChar: 120,
|
|
764
|
+
onEdit: function() {
|
|
765
|
+
if (isRendering) return;
|
|
766
|
+
draft.description = inputDescription.getInputValue();
|
|
767
|
+
updateFooter();
|
|
768
|
+
},
|
|
769
|
+
});
|
|
770
|
+
|
|
771
|
+
lblSystemInfo = Label({ text: "", fontSize: 13, textColor: Ink(0.6), color: Ink(0.05), round: 8, padding: [12, 8], width: "100%" });
|
|
772
|
+
|
|
773
|
+
endGroup();
|
|
774
|
+
|
|
775
|
+
// MENU: Role actions
|
|
776
|
+
roleMenu = ContextMenu({
|
|
777
|
+
items: [
|
|
778
|
+
{ text: "Duplicate role", key: "duplicate" },
|
|
779
|
+
"-",
|
|
780
|
+
{ text: "Delete role...", key: "delete" },
|
|
781
|
+
],
|
|
782
|
+
onClick: function(self, item) {
|
|
783
|
+
const role = getRole(selectedRoleId);
|
|
784
|
+
if (item.key == "duplicate") confirmDiscard(function() { createRole(role); });
|
|
785
|
+
if (item.key == "delete") deleteRole(role);
|
|
786
|
+
},
|
|
787
|
+
style: {
|
|
788
|
+
menu: { color: FIELD_COLOR, borderColor: Ink(0.12), shadow: "0px 8px 24px " + Black(0.5) },
|
|
789
|
+
item: { textColor: Ink(0.85) },
|
|
790
|
+
itemHover: { textColor: Ink(1), color: Ink(0.08) },
|
|
791
|
+
disabled: { textColor: Ink(0.3) },
|
|
792
|
+
separator: { color: Ink(0.1) },
|
|
793
|
+
},
|
|
794
|
+
});
|
|
795
|
+
roleMenu.attachTo(btnRoleMenu, "click");
|
|
796
|
+
|
|
797
|
+
};
|
|
798
|
+
|
|
799
|
+
const initTabs = function() {
|
|
800
|
+
|
|
801
|
+
tabs = Tabs({
|
|
802
|
+
variant: "pill",
|
|
803
|
+
styleName: T.compStyle,
|
|
804
|
+
tabs: Theme.indexTabs(["Permissions", "Members (0)"]), // (the key of a tab is its index: self.value)
|
|
805
|
+
onChange: function(self) {
|
|
806
|
+
grpPermissionsCard.visible = (self.value == 0) ? 1 : 0;
|
|
807
|
+
grpMembersCard.visible = (self.value == 1) ? 1 : 0;
|
|
808
|
+
},
|
|
809
|
+
style: Theme.tabsStyle({ barColor: CARD_COLOR, borderColor: CARD_BORDER_COLOR, barPadding: 4, barRound: 10, tabRound: 7, padding: [16, 7], activeColor: PRIMARY_COLOR }),
|
|
810
|
+
});
|
|
811
|
+
|
|
812
|
+
};
|
|
813
|
+
|
|
814
|
+
const initPermissionsCard = function() {
|
|
815
|
+
|
|
816
|
+
grpPermissionsCard = startCard({ gap: 12 });
|
|
817
|
+
|
|
818
|
+
HGroup({ width: "100%", height: "auto", align: "left center", gap: 12 });
|
|
819
|
+
that.elem.style.justifyContent = "space-between";
|
|
820
|
+
that.elem.style.flexWrap = "wrap";
|
|
821
|
+
|
|
822
|
+
VGroup({ width: "auto", height: "auto", align: "left top", gap: 0 });
|
|
823
|
+
Label({ text: "Permissions", fontSize: 16, textColor: Ink(0.95) });
|
|
824
|
+
that.elem.style.fontFamily = "opensans-bold";
|
|
825
|
+
Label({ text: "Create, edit and delete need view. Use the row and column boxes to select many.", fontSize: 12, textColor: Ink(0.45) });
|
|
826
|
+
endGroup();
|
|
827
|
+
|
|
828
|
+
lblPermissionCount = Label({ text: "", fontSize: 13, textColor: ACCENT_COLOR });
|
|
829
|
+
|
|
830
|
+
endGroup();
|
|
831
|
+
|
|
832
|
+
// GROUP: Matrix (horizontal scroll on small widths)
|
|
833
|
+
HGroup({ width: "100%", height: "auto", align: "left top" });
|
|
834
|
+
that.elem.style.overflowX = "auto";
|
|
835
|
+
|
|
836
|
+
grpMatrixHost = VGroup({ width: "100%", height: "auto", align: "left top" });
|
|
837
|
+
grpMatrixHost.elem.style.minWidth = "620px";
|
|
838
|
+
endGroup();
|
|
839
|
+
|
|
840
|
+
endGroup();
|
|
841
|
+
|
|
842
|
+
endGroup();
|
|
843
|
+
|
|
844
|
+
};
|
|
845
|
+
|
|
846
|
+
const initMembersCard = function() {
|
|
847
|
+
|
|
848
|
+
grpMembersCard = startCard({ gap: 12 });
|
|
849
|
+
|
|
850
|
+
HGroup({ width: "100%", height: "auto", align: "left center", gap: 10 });
|
|
851
|
+
that.elem.style.flexWrap = "wrap";
|
|
852
|
+
|
|
853
|
+
SearchInput({
|
|
854
|
+
width: 260,
|
|
855
|
+
height: 40,
|
|
856
|
+
border: 1,
|
|
857
|
+
borderColor: CARD_BORDER_COLOR,
|
|
858
|
+
borderBottomStyle: "1px solid " + CARD_BORDER_COLOR,
|
|
859
|
+
round: 8,
|
|
860
|
+
color: FIELD_COLOR,
|
|
861
|
+
textColor: Ink(0.9),
|
|
862
|
+
fontSize: 14,
|
|
863
|
+
searchIconSize: 16,
|
|
864
|
+
placeholderText: "Search members",
|
|
865
|
+
invertIconColor: T.invertIcon,
|
|
866
|
+
searchIconFile: LIB_PATH + "comp/search-input-v2/search.svg",
|
|
867
|
+
clearIconFile: LIB_PATH + "comp/search-input-v2/clear.svg",
|
|
868
|
+
onSearch: function(text) {
|
|
869
|
+
memberSearch = text;
|
|
870
|
+
renderMembers();
|
|
871
|
+
},
|
|
872
|
+
});
|
|
873
|
+
that.position = "relative";
|
|
874
|
+
|
|
875
|
+
// Space
|
|
876
|
+
HGroup({ width: "auto", height: 1 });
|
|
877
|
+
that.elem.style.flex = "1 1 auto";
|
|
878
|
+
endGroup();
|
|
879
|
+
|
|
880
|
+
addMemberSelect = TinySelect({
|
|
881
|
+
list: [{ id: "", label: "Add a member..." }],
|
|
882
|
+
height: 40,
|
|
883
|
+
fontSize: 14,
|
|
884
|
+
color: FIELD_COLOR,
|
|
885
|
+
border: 1,
|
|
886
|
+
borderColor: CARD_BORDER_COLOR,
|
|
887
|
+
round: 8,
|
|
888
|
+
labelBoldFont: 0,
|
|
889
|
+
labelTextColor: Ink(0.9),
|
|
890
|
+
arrowIcon: LIB_PATH + "comp/tiny-select/arrow.svg",
|
|
891
|
+
arrowSize: 18,
|
|
892
|
+
invertIconColor: T.invertIcon,
|
|
893
|
+
listFontSize: 14,
|
|
894
|
+
listTextColor: Ink(0.85),
|
|
895
|
+
listOverTextColor: ACCENT_COLOR,
|
|
896
|
+
listBackgroundColor: FIELD_COLOR,
|
|
897
|
+
listBorderColor: Ink(0.15),
|
|
898
|
+
onSelect: function(index, id) {
|
|
899
|
+
if (isRendering || !id || !draft) return;
|
|
900
|
+
draft.memberIds.push(Number(id));
|
|
901
|
+
renderMembers();
|
|
902
|
+
updateFooter();
|
|
903
|
+
},
|
|
904
|
+
});
|
|
905
|
+
|
|
906
|
+
endGroup();
|
|
907
|
+
|
|
908
|
+
Label({ text: "A user has one role. Adding a user here moves them from their current role. Removed members get the Viewer role.", fontSize: 12, textColor: Ink(0.45), width: "100%" });
|
|
909
|
+
|
|
910
|
+
grpMembersHost = VGroup({ width: "100%", height: "auto", align: "left top" });
|
|
911
|
+
endGroup();
|
|
912
|
+
|
|
913
|
+
endGroup();
|
|
914
|
+
|
|
915
|
+
};
|
|
916
|
+
|
|
917
|
+
const initFooter = function() {
|
|
918
|
+
|
|
919
|
+
footer = HGroup({
|
|
920
|
+
width: "100%",
|
|
921
|
+
height: "auto",
|
|
922
|
+
align: "center center",
|
|
923
|
+
padding: [24, 20],
|
|
924
|
+
});
|
|
925
|
+
footer.bottom = 0;
|
|
926
|
+
|
|
927
|
+
HGroup({
|
|
928
|
+
width: "100%",
|
|
929
|
+
height: "auto",
|
|
930
|
+
align: "left center",
|
|
931
|
+
gap: 10,
|
|
932
|
+
padding: [20, 12],
|
|
933
|
+
color: T.surface3,
|
|
934
|
+
border: 1,
|
|
935
|
+
borderColor: Ink(0.15),
|
|
936
|
+
round: 12,
|
|
937
|
+
clickable: 1,
|
|
938
|
+
});
|
|
939
|
+
that.elem.style.maxWidth = "960px";
|
|
940
|
+
that.elem.style.boxShadow = "0 8px 24px " + Black(0.5);
|
|
941
|
+
|
|
942
|
+
lblFooter = Label({ text: "", fontSize: 14, textColor: Ink(0.85) });
|
|
943
|
+
setFlex(lblFooter, "1 1 auto");
|
|
944
|
+
|
|
945
|
+
btnDiscard = createButton("Discard", "", function() {
|
|
946
|
+
draft = clone(saved);
|
|
947
|
+
renderAll();
|
|
948
|
+
});
|
|
949
|
+
|
|
950
|
+
btnSave = createButton("Save Changes", "", saveRole, { primary: 1 });
|
|
951
|
+
|
|
952
|
+
endGroup();
|
|
953
|
+
|
|
954
|
+
endGroup();
|
|
955
|
+
|
|
956
|
+
// WHY: Hidden after the content is created. Objects created in a hidden (display: none) group are not flex items.
|
|
957
|
+
footer.visible = 0;
|
|
958
|
+
|
|
959
|
+
};
|
|
960
|
+
|
|
961
|
+
// *** PAGE INIT CODE:
|
|
962
|
+
|
|
963
|
+
// BOX: Scrollable container
|
|
964
|
+
// WHY: page does not scroll. Scrollable content must be inside a Box with scrollY: 1.
|
|
965
|
+
startBox(0, 0, "100%", "100%", {
|
|
966
|
+
color: "transparent",
|
|
967
|
+
scrollY: 1,
|
|
968
|
+
});
|
|
969
|
+
|
|
970
|
+
VGroup({
|
|
971
|
+
width: "100%",
|
|
972
|
+
height: "auto", // Grows with content, so the Box can scroll.
|
|
973
|
+
align: "left top",
|
|
974
|
+
gap: 16,
|
|
975
|
+
padding: [24, 24, 24, 110], // Bottom: space for the footer
|
|
976
|
+
});
|
|
977
|
+
|
|
978
|
+
initHeader();
|
|
979
|
+
|
|
980
|
+
HGroup({ width: "100%", height: "auto", align: "left top", gap: 16 });
|
|
981
|
+
that.elem.style.flexWrap = "wrap";
|
|
982
|
+
|
|
983
|
+
initSidebar();
|
|
984
|
+
|
|
985
|
+
const main = VGroup({ width: "auto", height: "auto", align: "left top", gap: 14 });
|
|
986
|
+
setFlex(main, "1 1 560px");
|
|
987
|
+
|
|
988
|
+
initRoleHeader();
|
|
989
|
+
initTabs();
|
|
990
|
+
initPermissionsCard();
|
|
991
|
+
initMembersCard();
|
|
992
|
+
|
|
993
|
+
endGroup();
|
|
994
|
+
|
|
995
|
+
endGroup();
|
|
996
|
+
|
|
997
|
+
endGroup();
|
|
998
|
+
|
|
999
|
+
endBox();
|
|
1000
|
+
|
|
1001
|
+
initFooter();
|
|
1002
|
+
|
|
1003
|
+
// WHY: Hidden after the content is created.
|
|
1004
|
+
grpMembersCard.visible = 0;
|
|
1005
|
+
|
|
1006
|
+
selectRole(selectedRoleId);
|
|
1007
|
+
|
|
1008
|
+
return box.endPage();
|
|
1009
|
+
|
|
1010
|
+
};
|
|
1011
|
+
|
|
1012
|
+
RolesPage.KEY = "Roles";
|
|
1013
|
+
|
|
1014
|
+
// *** STATIC:
|
|
1015
|
+
|
|
1016
|
+
RolesPage.STORAGE_KEY = "adminPanel.roles";
|
|
1017
|
+
RolesPage.DEFAULT_ROLE_ID = "viewer";
|
|
1018
|
+
|
|
1019
|
+
RolesPage.ACTIONS = [
|
|
1020
|
+
{ id: "view", name: "View" },
|
|
1021
|
+
{ id: "create", name: "Create" },
|
|
1022
|
+
{ id: "edit", name: "Edit" },
|
|
1023
|
+
{ id: "delete", name: "Delete" },
|
|
1024
|
+
];
|
|
1025
|
+
|
|
1026
|
+
// actions: The actions that are used for the module.
|
|
1027
|
+
RolesPage.MODULES = [
|
|
1028
|
+
{ id: "dashboard", name: "Dashboard", desc: "Home page and summary", actions: ["view"] },
|
|
1029
|
+
{ id: "reports", name: "Reports", desc: "Sales reports and exports", actions: ["view"] },
|
|
1030
|
+
{ id: "users", name: "Users", desc: "Customer accounts", actions: ["view", "create", "edit", "delete"] },
|
|
1031
|
+
{ id: "contents", name: "Contents", desc: "Pages, posts and products", actions: ["view", "create", "edit", "delete"] },
|
|
1032
|
+
{ id: "media", name: "Media Library", desc: "Images and files", actions: ["view", "create", "edit", "delete"] },
|
|
1033
|
+
{ id: "roles", name: "Roles & Permissions", desc: "This page", actions: ["view", "edit"] },
|
|
1034
|
+
{ id: "settings", name: "Settings", desc: "Panel and account settings", actions: ["view", "edit"] },
|
|
1035
|
+
];
|
|
1036
|
+
|
|
1037
|
+
// "dashboard.view", "users.view", "users.create", ...
|
|
1038
|
+
RolesPage.getAllPermissionKeys = function() {
|
|
1039
|
+
const keys = [];
|
|
1040
|
+
RolesPage.MODULES.forEach(function(module) {
|
|
1041
|
+
module.actions.forEach(function(action) { keys.push(module.id + "." + action); });
|
|
1042
|
+
});
|
|
1043
|
+
return keys;
|
|
1044
|
+
};
|
|
1045
|
+
|
|
1046
|
+
RolesPage.getDefaultData = function() {
|
|
1047
|
+
|
|
1048
|
+
const all = RolesPage.getAllPermissionKeys();
|
|
1049
|
+
const viewOnly = all.filter(function(key) { return key.endsWith(".view") && !key.startsWith("roles.") && !key.startsWith("settings."); });
|
|
1050
|
+
|
|
1051
|
+
return {
|
|
1052
|
+
roles: [
|
|
1053
|
+
{ id: "admin", name: "Admin", description: "Full access to everything.", isSystem: 1, isLocked: 1, permissions: all },
|
|
1054
|
+
{ id: "editor", name: "Editor", description: "Manages contents and media.", isSystem: 0, isLocked: 0,
|
|
1055
|
+
permissions: ["dashboard.view", "reports.view", "users.view", "contents.view", "contents.create", "contents.edit", "contents.delete", "media.view", "media.create", "media.edit", "media.delete"] },
|
|
1056
|
+
{ id: "support", name: "Support", description: "Helps customers with their accounts.", isSystem: 0, isLocked: 0,
|
|
1057
|
+
permissions: ["dashboard.view", "users.view", "users.edit", "contents.view"] },
|
|
1058
|
+
{ id: "marketing", name: "Marketing", description: "Campaigns, banners and reports.", isSystem: 0, isLocked: 0,
|
|
1059
|
+
permissions: ["dashboard.view", "reports.view", "contents.view", "contents.edit", "media.view", "media.create", "media.edit"] },
|
|
1060
|
+
{ id: "viewer", name: "Viewer", description: "Can see, but can not change anything.", isSystem: 1, isLocked: 0, permissions: viewOnly },
|
|
1061
|
+
],
|
|
1062
|
+
users: [
|
|
1063
|
+
{ id: 1, name: "Bugra Ozden", email: "demo@example.com", roleId: "admin" },
|
|
1064
|
+
{ id: 2, name: "Alper Kaya", email: "a.kaya@company.net", roleId: "admin" },
|
|
1065
|
+
{ id: 3, name: "Deniz Arslan", email: "deniz_arslan@studio.com", roleId: "editor" },
|
|
1066
|
+
{ id: 4, name: "Ceren Aktas", email: "ceren.aktas@webco.com", roleId: "editor" },
|
|
1067
|
+
{ id: 5, name: "Zeynep Karaca", email: "zkaraca@brandworks.com", roleId: "marketing" },
|
|
1068
|
+
{ id: 6, name: "Selin Koc", email: "selin.koc@analytics.io", roleId: "marketing" },
|
|
1069
|
+
{ id: 7, name: "Duygu Sahin", email: "duygu.sahin@testlab.com", roleId: "support" },
|
|
1070
|
+
{ id: 8, name: "Kemal Aydin", email: "kemal_aydin@securelab.com", roleId: "support" },
|
|
1071
|
+
{ id: 9, name: "Pinar Erdogan", email: "p.erdogan@people.io", roleId: "support" },
|
|
1072
|
+
{ id: 10, name: "Nilufer Celik", email: "n.celik@datahouse.org", roleId: "viewer" },
|
|
1073
|
+
{ id: 11, name: "Frank Weber", email: "frank.weber@infrateam.de", roleId: "viewer" },
|
|
1074
|
+
{ id: 12, name: "Baran Cetin", email: "baran.cetin@devstack.net", roleId: "viewer" },
|
|
1075
|
+
],
|
|
1076
|
+
};
|
|
1077
|
+
|
|
1078
|
+
};
|
|
1079
|
+
|
|
1080
|
+
// TODO: Load the roles and users from your service.
|
|
1081
|
+
RolesPage.load = function() {
|
|
1082
|
+
const stored = basic.storage.load(RolesPage.STORAGE_KEY);
|
|
1083
|
+
if (stored && Array.isArray(stored.roles) && Array.isArray(stored.users) && stored.roles.length) return stored;
|
|
1084
|
+
return RolesPage.getDefaultData();
|
|
1085
|
+
};
|
|
1086
|
+
|
|
1087
|
+
// TODO: Save with your service.
|
|
1088
|
+
RolesPage.save = function(data) {
|
|
1089
|
+
basic.storage.save(RolesPage.STORAGE_KEY, data);
|
|
1090
|
+
};
|
|
1091
|
+
|
|
1092
|
+
RolesPage.AVATAR_COLORS = ["#3D7A6B", "#344F6C", "#583432", "#6B5B2E", "#4A3F6B", "#2E5E6B"];
|
|
1093
|
+
|
|
1094
|
+
RolesPage.getAvatarColor = function(userId) {
|
|
1095
|
+
return RolesPage.AVATAR_COLORS[userId % RolesPage.AVATAR_COLORS.length];
|
|
1096
|
+
};
|