@propbinder/mobile-design 0.0.1 → 0.0.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/ng-package.json +7 -0
- package/package.json +12 -39
- package/src/animations/page-transitions.ts +86 -0
- package/src/assets/fonts/Brockmann-Bold.otf +0 -0
- package/src/assets/fonts/Brockmann-BoldItalic.otf +0 -0
- package/src/assets/fonts/Brockmann-Medium.otf +0 -0
- package/src/assets/fonts/Brockmann-MediumItalic.otf +0 -0
- package/src/assets/fonts/Brockmann-Regular.otf +0 -0
- package/src/assets/fonts/Brockmann-RegularItalic.otf +0 -0
- package/src/assets/fonts/Brockmann-SemiBold.otf +0 -0
- package/src/assets/fonts/Brockmann-SemiBoldItalic.otf +0 -0
- package/src/assets/fonts/Brockmann_desktop_license.pdf +0 -0
- package/src/assets/fonts/brockmann-medium-webfont.woff2 +0 -0
- package/src/assets/fonts/brockmann-regular-webfont.woff2 +0 -0
- package/src/assets/fonts/brockmann-semibold-webfont.woff2 +0 -0
- package/src/components/action-list-item/ds-mobile-action-list-item.ts +83 -0
- package/src/components/action-list-item/index.ts +2 -0
- package/src/components/app-layout/ds-mobile-app-layout.css +343 -0
- package/src/components/app-layout/ds-mobile-app-layout.ts +271 -0
- package/src/components/app-layout/index.ts +2 -0
- package/src/components/avatar-with-badge/ds-avatar-with-badge.ts +130 -0
- package/src/components/avatar-with-badge/index.ts +2 -0
- package/src/components/bottom-sheet/ds-mobile-actions-bottom-sheet.ts +273 -0
- package/src/components/bottom-sheet/ds-mobile-bottom-sheet.css +110 -0
- package/src/components/bottom-sheet/ds-mobile-bottom-sheet.service.ts +167 -0
- package/src/components/bottom-sheet/ds-mobile-post-create-bottom-sheet.ts +656 -0
- package/src/components/bottom-sheet/index.ts +3 -0
- package/src/components/comment/ds-mobile-comment.ts +516 -0
- package/src/components/comment/index.ts +2 -0
- package/src/components/contact-list-item/ds-mobile-contact-list-item.ts +182 -0
- package/src/components/contact-list-item/index.ts +2 -0
- package/src/components/content/ds-mobile-content.ts +158 -0
- package/src/components/content/index.ts +2 -0
- package/src/components/ds-mobile-tabs.css +372 -0
- package/src/components/ds-mobile-tabs.ts +217 -0
- package/src/components/file-attachment/ds-mobile-file-attachment.ts +164 -0
- package/src/components/file-attachment/index.ts +2 -0
- package/src/components/handbook-detail-modal/ds-mobile-handbook-detail-modal.service.ts +98 -0
- package/src/components/handbook-detail-modal/ds-mobile-handbook-detail-modal.ts +514 -0
- package/src/components/handbook-detail-modal/index.ts +3 -0
- package/src/components/handbook-folder/ds-mobile-handbook-folder-mini.ts +130 -0
- package/src/components/handbook-folder/ds-mobile-handbook-folder.ts +444 -0
- package/src/components/handbook-folder/index.ts +4 -0
- package/src/components/header-content/ds-mobile-header-content.ts +211 -0
- package/src/components/header-content/index.ts +2 -0
- package/src/components/index.ts +45 -0
- package/src/components/inline-photo/ds-mobile-inline-photo.ts +269 -0
- package/src/components/inline-photo/index.ts +1 -0
- package/src/components/interactive-list-item-inquiry/ds-mobile-interactive-list-item-inquiry.css +60 -0
- package/src/components/interactive-list-item-inquiry/ds-mobile-interactive-list-item-inquiry.ts +280 -0
- package/src/components/interactive-list-item-inquiry/index.ts +2 -0
- package/src/components/interactive-list-item-message/ds-mobile-interactive-list-item-message.ts +197 -0
- package/src/components/interactive-list-item-message/index.ts +2 -0
- package/src/components/interactive-list-item-post/ds-mobile-interactive-list-item-post.css +70 -0
- package/src/components/interactive-list-item-post/ds-mobile-interactive-list-item-post.ts +594 -0
- package/src/components/interactive-list-item-post/ds-mobile-post-pdf-attachment.ts +124 -0
- package/src/components/interactive-list-item-post/index.ts +13 -0
- package/src/components/lightbox/ds-mobile-lightbox-footer.ts +331 -0
- package/src/components/lightbox/ds-mobile-lightbox-header.ts +173 -0
- package/src/components/lightbox/ds-mobile-lightbox-image.ts +464 -0
- package/src/components/lightbox/ds-mobile-lightbox-pdf.css +375 -0
- package/src/components/lightbox/ds-mobile-lightbox-pdf.ts +374 -0
- package/src/components/lightbox/ds-mobile-lightbox.css +587 -0
- package/src/components/lightbox/ds-mobile-lightbox.service.ts +293 -0
- package/src/components/lightbox/ds-mobile-lightbox.ts +529 -0
- package/src/components/lightbox/index.ts +22 -0
- package/src/components/list-item/ds-mobile-list-item.ts +499 -0
- package/src/components/list-item/index.ts +2 -0
- package/src/components/list-item-static/ds-mobile-list-item-static.ts +133 -0
- package/src/components/list-item-static/index.ts +2 -0
- package/src/components/logo/ds-logo.ts +85 -0
- package/src/components/logo/index.ts +2 -0
- package/src/components/modal/ds-mobile-modal.css +163 -0
- package/src/components/modal/ds-mobile-modal.service.ts +329 -0
- package/src/components/modal/index.ts +8 -0
- package/src/components/page-details/ds-mobile-page-details.css +285 -0
- package/src/components/page-details/ds-mobile-page-details.ts +128 -0
- package/src/components/page-details/index.ts +2 -0
- package/src/components/page-main/ds-mobile-page-main.css +346 -0
- package/src/components/page-main/ds-mobile-page-main.ts +331 -0
- package/src/components/page-main/index.ts +2 -0
- package/src/components/post-card/ds-mobile-post-card.ts +685 -0
- package/src/components/post-card/ds-mobile-post-pdf-attachment.ts +124 -0
- package/src/components/post-card/index.ts +11 -0
- package/src/components/post-composer/ds-mobile-post-composer.ts +140 -0
- package/src/components/post-composer/index.ts +2 -0
- package/src/components/post-detail-modal/ds-mobile-post-detail-modal.service.ts +104 -0
- package/src/components/post-detail-modal/ds-mobile-post-detail-modal.ts +1273 -0
- package/src/components/post-detail-modal/index.ts +9 -0
- package/src/components/shared/directives/index.ts +2 -0
- package/src/components/shared/directives/long-press.directive.ts +208 -0
- package/src/components/shared/index.ts +3 -0
- package/src/components/shared/mobile-common.css +94 -0
- package/src/components/shared/mobile-page-base.css +315 -0
- package/src/components/shared/mobile-page-base.ts +70 -0
- package/src/components/swiper/ds-mobile-swiper.ts +123 -0
- package/src/components/swiper/index.ts +2 -0
- package/src/components/tab-bar/ds-mobile-tab-bar.ts +132 -0
- package/src/components/tab-bar/index.ts +2 -0
- package/src/components/tabs/ds-mobile-tabs.css +405 -0
- package/src/components/tabs/ds-mobile-tabs.ts +204 -0
- package/src/components/tabs/index.ts +2 -0
- package/src/pages/community.page.ts +768 -0
- package/src/pages/handbook.page.ts +298 -0
- package/src/pages/home.page.ts +192 -0
- package/src/pages/index.ts +9 -0
- package/src/pages/inquiries.example.ts +212 -0
- package/src/pages/inquiry-detail.example.css +434 -0
- package/src/pages/inquiry-detail.example.ts +416 -0
- package/src/pages/mobile-tabs-example.component.ts +146 -0
- package/src/pages/post-create.page.ts +311 -0
- package/src/pages/post-detail.page.ts +295 -0
- package/src/pages/whitelabel-demo.page.ts +548 -0
- package/src/public-api.ts +5 -0
- package/src/services/user.service.ts +35 -0
- package/src/services/whitelabel.service.ts +171 -0
- package/src/styles/ionic.css +673 -0
- package/tsconfig.lib.json +17 -0
- package/tsconfig.lib.prod.json +9 -0
- package/tsconfig.spec.json +13 -0
- package/fesm2022/propbinder-mobile-design.mjs +0 -8294
- package/fesm2022/propbinder-mobile-design.mjs.map +0 -1
- package/index.d.ts +0 -2860
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
import { Component, OnInit, inject, signal } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { FormsModule } from '@angular/forms';
|
|
4
|
+
import { WhitelabelService } from '../services/whitelabel.service';
|
|
5
|
+
import { DsLogoComponent } from '../components/logo/ds-logo';
|
|
6
|
+
import { DsAvatarWithBadgeComponent } from '../components/avatar-with-badge/ds-avatar-with-badge';
|
|
7
|
+
import { IonContent, IonHeader, IonToolbar, IonTitle, IonButton } from '@ionic/angular/standalone';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Whitelabel Demo Page
|
|
11
|
+
*
|
|
12
|
+
* Demonstrates the whitelabeling system with live color and logo switching.
|
|
13
|
+
*/
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'app-whitelabel-demo',
|
|
16
|
+
standalone: true,
|
|
17
|
+
imports: [
|
|
18
|
+
CommonModule,
|
|
19
|
+
FormsModule,
|
|
20
|
+
IonContent,
|
|
21
|
+
IonHeader,
|
|
22
|
+
IonToolbar,
|
|
23
|
+
IonTitle,
|
|
24
|
+
IonButton,
|
|
25
|
+
DsLogoComponent,
|
|
26
|
+
DsAvatarWithBadgeComponent
|
|
27
|
+
],
|
|
28
|
+
styles: [`
|
|
29
|
+
:host {
|
|
30
|
+
display: block;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
ion-toolbar {
|
|
34
|
+
--background: var(--color-brand-secondary);
|
|
35
|
+
--color: white;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
ion-content {
|
|
39
|
+
--background: #f5f5f5;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.demo-container {
|
|
43
|
+
padding: 20px;
|
|
44
|
+
max-width: 800px;
|
|
45
|
+
margin: 0 auto;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.demo-section {
|
|
49
|
+
margin-bottom: 32px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.demo-section h2 {
|
|
53
|
+
margin-bottom: 16px;
|
|
54
|
+
font-size: 20px;
|
|
55
|
+
font-weight: 600;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.logo-showcase {
|
|
59
|
+
display: flex;
|
|
60
|
+
gap: 24px;
|
|
61
|
+
align-items: center;
|
|
62
|
+
padding: 24px;
|
|
63
|
+
background: white;
|
|
64
|
+
border-radius: 8px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.avatar-showcase {
|
|
68
|
+
display: flex;
|
|
69
|
+
gap: 16px;
|
|
70
|
+
align-items: center;
|
|
71
|
+
padding: 24px;
|
|
72
|
+
background: white;
|
|
73
|
+
border-radius: 8px;
|
|
74
|
+
flex-wrap: wrap;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.button-group {
|
|
78
|
+
display: flex;
|
|
79
|
+
gap: 12px;
|
|
80
|
+
flex-wrap: wrap;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.color-demo {
|
|
84
|
+
padding: 24px;
|
|
85
|
+
background: white;
|
|
86
|
+
border-radius: 8px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.color-swatch {
|
|
90
|
+
display: flex;
|
|
91
|
+
gap: 16px;
|
|
92
|
+
margin-top: 16px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.swatch {
|
|
96
|
+
flex: 1;
|
|
97
|
+
min-height: 100px;
|
|
98
|
+
border-radius: 8px;
|
|
99
|
+
display: flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
justify-content: center;
|
|
102
|
+
color: white;
|
|
103
|
+
font-weight: 600;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.swatch--primary {
|
|
107
|
+
background: var(--color-background-brand);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.swatch--secondary {
|
|
111
|
+
background: var(--color-brand-secondary);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.current-config {
|
|
115
|
+
padding: 16px;
|
|
116
|
+
background: #f5f5f5;
|
|
117
|
+
border-radius: 8px;
|
|
118
|
+
margin-top: 16px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.current-config pre {
|
|
122
|
+
margin: 0;
|
|
123
|
+
font-size: 12px;
|
|
124
|
+
overflow-x: auto;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.color-inputs {
|
|
128
|
+
display: flex;
|
|
129
|
+
flex-direction: column;
|
|
130
|
+
gap: 16px;
|
|
131
|
+
margin-top: 16px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.color-input-row {
|
|
135
|
+
display: flex;
|
|
136
|
+
align-items: center;
|
|
137
|
+
gap: 12px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.color-input-row label {
|
|
141
|
+
min-width: 100px;
|
|
142
|
+
font-weight: 600;
|
|
143
|
+
font-size: 14px;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.color-input-row input[type="color"] {
|
|
147
|
+
width: 50px;
|
|
148
|
+
height: 40px;
|
|
149
|
+
border: none;
|
|
150
|
+
border-radius: 8px;
|
|
151
|
+
cursor: pointer;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.color-input-row input[type="text"] {
|
|
155
|
+
flex: 1;
|
|
156
|
+
padding: 8px 12px;
|
|
157
|
+
border: 1px solid #ddd;
|
|
158
|
+
border-radius: 8px;
|
|
159
|
+
font-family: monospace;
|
|
160
|
+
font-size: 14px;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.logo-upload {
|
|
164
|
+
margin-top: 24px;
|
|
165
|
+
padding: 20px;
|
|
166
|
+
background: white;
|
|
167
|
+
border-radius: 8px;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.upload-section {
|
|
171
|
+
margin-bottom: 20px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.upload-section h3 {
|
|
175
|
+
font-size: 16px;
|
|
176
|
+
font-weight: 600;
|
|
177
|
+
margin-bottom: 12px;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.file-input-wrapper {
|
|
181
|
+
display: flex;
|
|
182
|
+
align-items: center;
|
|
183
|
+
gap: 12px;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.file-input-wrapper input[type="file"] {
|
|
187
|
+
display: none;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.upload-button {
|
|
191
|
+
padding: 10px 16px;
|
|
192
|
+
background: var(--color-background-brand);
|
|
193
|
+
color: white;
|
|
194
|
+
border: none;
|
|
195
|
+
border-radius: 8px;
|
|
196
|
+
cursor: pointer;
|
|
197
|
+
font-weight: 600;
|
|
198
|
+
font-size: 14px;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.upload-button:hover {
|
|
202
|
+
opacity: 0.9;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.file-name {
|
|
206
|
+
font-size: 14px;
|
|
207
|
+
color: #666;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.reset-button {
|
|
211
|
+
padding: 8px 12px;
|
|
212
|
+
background: #f5f5f5;
|
|
213
|
+
color: #666;
|
|
214
|
+
border: 1px solid #ddd;
|
|
215
|
+
border-radius: 8px;
|
|
216
|
+
cursor: pointer;
|
|
217
|
+
font-size: 14px;
|
|
218
|
+
}
|
|
219
|
+
`],
|
|
220
|
+
template: `
|
|
221
|
+
<ion-header>
|
|
222
|
+
<ion-toolbar>
|
|
223
|
+
<ion-title>Whitelabel Demo</ion-title>
|
|
224
|
+
</ion-toolbar>
|
|
225
|
+
</ion-header>
|
|
226
|
+
|
|
227
|
+
<ion-content>
|
|
228
|
+
<div class="demo-container">
|
|
229
|
+
<!-- Logo Section -->
|
|
230
|
+
<div class="demo-section">
|
|
231
|
+
<h2>Logos</h2>
|
|
232
|
+
<div class="logo-showcase">
|
|
233
|
+
<div>
|
|
234
|
+
<p style="margin-bottom: 8px; font-size: 12px; color: #666;">Full Logo (md)</p>
|
|
235
|
+
<ds-logo variant="full" size="md" />
|
|
236
|
+
</div>
|
|
237
|
+
<div>
|
|
238
|
+
<p style="margin-bottom: 8px; font-size: 12px; color: #666;">Logomark (sm)</p>
|
|
239
|
+
<ds-logo variant="mark" size="sm" />
|
|
240
|
+
</div>
|
|
241
|
+
<div>
|
|
242
|
+
<p style="margin-bottom: 8px; font-size: 12px; color: #666;">Logomark (md)</p>
|
|
243
|
+
<ds-logo variant="mark" size="md" />
|
|
244
|
+
</div>
|
|
245
|
+
<div>
|
|
246
|
+
<p style="margin-bottom: 8px; font-size: 12px; color: #666;">Logomark (lg)</p>
|
|
247
|
+
<ds-logo variant="mark" size="lg" />
|
|
248
|
+
</div>
|
|
249
|
+
</div>
|
|
250
|
+
|
|
251
|
+
<!-- Logo Upload Section -->
|
|
252
|
+
<div class="logo-upload">
|
|
253
|
+
<div class="upload-section">
|
|
254
|
+
<h3>Upload Full Logo</h3>
|
|
255
|
+
<div class="file-input-wrapper">
|
|
256
|
+
<input
|
|
257
|
+
#fullLogoInput
|
|
258
|
+
type="file"
|
|
259
|
+
accept="image/*"
|
|
260
|
+
(change)="handleFullLogoUpload($event)"
|
|
261
|
+
/>
|
|
262
|
+
<button class="upload-button" (click)="fullLogoInput.click()">
|
|
263
|
+
Choose File
|
|
264
|
+
</button>
|
|
265
|
+
@if (uploadedFullLogoName) {
|
|
266
|
+
<span class="file-name">{{ uploadedFullLogoName }}</span>
|
|
267
|
+
}
|
|
268
|
+
@if (uploadedFullLogoName) {
|
|
269
|
+
<button class="reset-button" (click)="resetFullLogo()">Reset</button>
|
|
270
|
+
}
|
|
271
|
+
</div>
|
|
272
|
+
</div>
|
|
273
|
+
|
|
274
|
+
<div class="upload-section">
|
|
275
|
+
<h3>Upload Logomark</h3>
|
|
276
|
+
<div class="file-input-wrapper">
|
|
277
|
+
<input
|
|
278
|
+
#logomarkInput
|
|
279
|
+
type="file"
|
|
280
|
+
accept="image/*"
|
|
281
|
+
(change)="handleLogomarkUpload($event)"
|
|
282
|
+
/>
|
|
283
|
+
<button class="upload-button" (click)="logomarkInput.click()">
|
|
284
|
+
Choose File
|
|
285
|
+
</button>
|
|
286
|
+
@if (uploadedLogomarkName) {
|
|
287
|
+
<span class="file-name">{{ uploadedLogomarkName }}</span>
|
|
288
|
+
}
|
|
289
|
+
@if (uploadedLogomarkName) {
|
|
290
|
+
<button class="reset-button" (click)="resetLogomark()">Reset</button>
|
|
291
|
+
}
|
|
292
|
+
</div>
|
|
293
|
+
</div>
|
|
294
|
+
|
|
295
|
+
<p style="font-size: 12px; color: #999; margin-top: 12px;">
|
|
296
|
+
Tip: Use SVG or PNG files with transparent backgrounds for best results
|
|
297
|
+
</p>
|
|
298
|
+
</div>
|
|
299
|
+
</div>
|
|
300
|
+
|
|
301
|
+
<!-- Avatar with Badge Section -->
|
|
302
|
+
<div class="demo-section">
|
|
303
|
+
<h2>Avatar with Logo Badge</h2>
|
|
304
|
+
<div class="avatar-showcase">
|
|
305
|
+
<div>
|
|
306
|
+
<p style="margin-bottom: 8px; font-size: 12px; color: #666;">Small</p>
|
|
307
|
+
<ds-avatar-with-badge
|
|
308
|
+
[type]="'initials'"
|
|
309
|
+
[initials]="'JD'"
|
|
310
|
+
[size]="'sm'"
|
|
311
|
+
[badgePosition]="'bottom-right'"
|
|
312
|
+
/>
|
|
313
|
+
</div>
|
|
314
|
+
<div>
|
|
315
|
+
<p style="margin-bottom: 8px; font-size: 12px; color: #666;">Medium</p>
|
|
316
|
+
<ds-avatar-with-badge
|
|
317
|
+
[type]="'initials'"
|
|
318
|
+
[initials]="'JD'"
|
|
319
|
+
[size]="'md'"
|
|
320
|
+
[badgePosition]="'bottom-right'"
|
|
321
|
+
/>
|
|
322
|
+
</div>
|
|
323
|
+
<div>
|
|
324
|
+
<p style="margin-bottom: 8px; font-size: 12px; color: #666;">Large</p>
|
|
325
|
+
<ds-avatar-with-badge
|
|
326
|
+
[type]="'initials'"
|
|
327
|
+
[initials]="'JD'"
|
|
328
|
+
[size]="'lg'"
|
|
329
|
+
[badgePosition]="'bottom-right'"
|
|
330
|
+
/>
|
|
331
|
+
</div>
|
|
332
|
+
<div>
|
|
333
|
+
<p style="margin-bottom: 8px; font-size: 12px; color: #666;">X-Large</p>
|
|
334
|
+
<ds-avatar-with-badge
|
|
335
|
+
[type]="'initials'"
|
|
336
|
+
[initials]="'JD'"
|
|
337
|
+
[size]="'xl'"
|
|
338
|
+
[badgePosition]="'bottom-right'"
|
|
339
|
+
/>
|
|
340
|
+
</div>
|
|
341
|
+
</div>
|
|
342
|
+
</div>
|
|
343
|
+
|
|
344
|
+
<!-- Color Section -->
|
|
345
|
+
<div class="demo-section">
|
|
346
|
+
<h2>Brand Colors</h2>
|
|
347
|
+
<div class="color-demo">
|
|
348
|
+
<p style="margin-bottom: 8px; color: #666;">Current brand colors:</p>
|
|
349
|
+
<div class="color-swatch">
|
|
350
|
+
<div class="swatch swatch--primary">
|
|
351
|
+
Primary<br/>
|
|
352
|
+
<span style="font-size: 11px; opacity: 0.9;">{{ whitelabelService.primaryColor() }}</span>
|
|
353
|
+
</div>
|
|
354
|
+
<div class="swatch swatch--secondary">
|
|
355
|
+
Secondary<br/>
|
|
356
|
+
<span style="font-size: 11px; opacity: 0.9;">{{ whitelabelService.secondaryColor() }}</span>
|
|
357
|
+
</div>
|
|
358
|
+
</div>
|
|
359
|
+
|
|
360
|
+
<!-- Custom Color Inputs -->
|
|
361
|
+
<div class="color-inputs">
|
|
362
|
+
<div class="color-input-row">
|
|
363
|
+
<label>Primary:</label>
|
|
364
|
+
<input
|
|
365
|
+
type="color"
|
|
366
|
+
[(ngModel)]="customPrimaryColor"
|
|
367
|
+
(change)="applyCustomColors()"
|
|
368
|
+
/>
|
|
369
|
+
<input
|
|
370
|
+
type="text"
|
|
371
|
+
[(ngModel)]="customPrimaryColor"
|
|
372
|
+
(change)="applyCustomColors()"
|
|
373
|
+
placeholder="#6B5FF5"
|
|
374
|
+
/>
|
|
375
|
+
</div>
|
|
376
|
+
<div class="color-input-row">
|
|
377
|
+
<label>Secondary:</label>
|
|
378
|
+
<input
|
|
379
|
+
type="color"
|
|
380
|
+
[(ngModel)]="customSecondaryColor"
|
|
381
|
+
(change)="applyCustomColors()"
|
|
382
|
+
/>
|
|
383
|
+
<input
|
|
384
|
+
type="text"
|
|
385
|
+
[(ngModel)]="customSecondaryColor"
|
|
386
|
+
(change)="applyCustomColors()"
|
|
387
|
+
placeholder="#221a4c"
|
|
388
|
+
/>
|
|
389
|
+
</div>
|
|
390
|
+
</div>
|
|
391
|
+
</div>
|
|
392
|
+
</div>
|
|
393
|
+
|
|
394
|
+
<!-- Theme Switcher -->
|
|
395
|
+
<div class="demo-section">
|
|
396
|
+
<h2>Switch Organization Theme</h2>
|
|
397
|
+
<div class="button-group">
|
|
398
|
+
<ion-button (click)="applyDefaultTheme()">
|
|
399
|
+
Default (Purple)
|
|
400
|
+
</ion-button>
|
|
401
|
+
<ion-button (click)="applyBlueTheme()">
|
|
402
|
+
Blue Theme
|
|
403
|
+
</ion-button>
|
|
404
|
+
<ion-button (click)="applyGreenTheme()">
|
|
405
|
+
Green Theme
|
|
406
|
+
</ion-button>
|
|
407
|
+
<ion-button (click)="applyOrangeTheme()">
|
|
408
|
+
Orange Theme
|
|
409
|
+
</ion-button>
|
|
410
|
+
</div>
|
|
411
|
+
</div>
|
|
412
|
+
|
|
413
|
+
<!-- Current Config -->
|
|
414
|
+
<div class="demo-section">
|
|
415
|
+
<h2>Current Configuration</h2>
|
|
416
|
+
<div class="current-config">
|
|
417
|
+
<pre>{{ configJson() }}</pre>
|
|
418
|
+
</div>
|
|
419
|
+
</div>
|
|
420
|
+
</div>
|
|
421
|
+
</ion-content>
|
|
422
|
+
`
|
|
423
|
+
})
|
|
424
|
+
export class WhitelabelDemoPage implements OnInit {
|
|
425
|
+
whitelabelService = inject(WhitelabelService);
|
|
426
|
+
|
|
427
|
+
// Custom color inputs
|
|
428
|
+
customPrimaryColor = '#6B5FF5';
|
|
429
|
+
customSecondaryColor = '#221a4c';
|
|
430
|
+
|
|
431
|
+
// Logo upload state
|
|
432
|
+
uploadedFullLogoName = '';
|
|
433
|
+
uploadedLogomarkName = '';
|
|
434
|
+
|
|
435
|
+
ngOnInit() {
|
|
436
|
+
console.log('Whitelabel Demo Page initialized');
|
|
437
|
+
// Initialize custom colors with current values
|
|
438
|
+
this.customPrimaryColor = this.whitelabelService.primaryColor();
|
|
439
|
+
this.customSecondaryColor = this.whitelabelService.secondaryColor();
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
handleFullLogoUpload(event: Event) {
|
|
443
|
+
const input = event.target as HTMLInputElement;
|
|
444
|
+
if (input.files && input.files[0]) {
|
|
445
|
+
const file = input.files[0];
|
|
446
|
+
this.uploadedFullLogoName = file.name;
|
|
447
|
+
|
|
448
|
+
// Convert to data URL
|
|
449
|
+
const reader = new FileReader();
|
|
450
|
+
reader.onload = (e) => {
|
|
451
|
+
const dataUrl = e.target?.result as string;
|
|
452
|
+
this.whitelabelService.updateConfig({
|
|
453
|
+
logoUrl: dataUrl
|
|
454
|
+
});
|
|
455
|
+
};
|
|
456
|
+
reader.readAsDataURL(file);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
handleLogomarkUpload(event: Event) {
|
|
461
|
+
const input = event.target as HTMLInputElement;
|
|
462
|
+
if (input.files && input.files[0]) {
|
|
463
|
+
const file = input.files[0];
|
|
464
|
+
this.uploadedLogomarkName = file.name;
|
|
465
|
+
|
|
466
|
+
// Convert to data URL
|
|
467
|
+
const reader = new FileReader();
|
|
468
|
+
reader.onload = (e) => {
|
|
469
|
+
const dataUrl = e.target?.result as string;
|
|
470
|
+
this.whitelabelService.updateConfig({
|
|
471
|
+
logoMarkUrl: dataUrl
|
|
472
|
+
});
|
|
473
|
+
};
|
|
474
|
+
reader.readAsDataURL(file);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
resetFullLogo() {
|
|
479
|
+
this.uploadedFullLogoName = '';
|
|
480
|
+
this.whitelabelService.updateConfig({
|
|
481
|
+
logoUrl: '/assets/logos/propbinder-logo.svg'
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
resetLogomark() {
|
|
486
|
+
this.uploadedLogomarkName = '';
|
|
487
|
+
this.whitelabelService.updateConfig({
|
|
488
|
+
logoMarkUrl: '/assets/logos/propbinder-logomark.svg'
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
configJson() {
|
|
493
|
+
return JSON.stringify(this.whitelabelService.config(), null, 2);
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
applyDefaultTheme() {
|
|
497
|
+
this.whitelabelService.updateConfig({
|
|
498
|
+
primaryColor: '#6B5FF5',
|
|
499
|
+
secondaryColor: '#221a4c',
|
|
500
|
+
organizationName: 'Propbinder',
|
|
501
|
+
organizationId: 'default'
|
|
502
|
+
});
|
|
503
|
+
this.updateCustomColorInputs();
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
applyBlueTheme() {
|
|
507
|
+
this.whitelabelService.updateConfig({
|
|
508
|
+
primaryColor: '#2563eb',
|
|
509
|
+
secondaryColor: '#3b82f6',
|
|
510
|
+
organizationName: 'Blue Corp',
|
|
511
|
+
organizationId: 'blue-corp'
|
|
512
|
+
});
|
|
513
|
+
this.updateCustomColorInputs();
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
applyGreenTheme() {
|
|
517
|
+
this.whitelabelService.updateConfig({
|
|
518
|
+
primaryColor: '#16a34a',
|
|
519
|
+
secondaryColor: '#22c55e',
|
|
520
|
+
organizationName: 'Green Industries',
|
|
521
|
+
organizationId: 'green-industries'
|
|
522
|
+
});
|
|
523
|
+
this.updateCustomColorInputs();
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
applyOrangeTheme() {
|
|
527
|
+
this.whitelabelService.updateConfig({
|
|
528
|
+
primaryColor: '#ea580c',
|
|
529
|
+
secondaryColor: '#f97316',
|
|
530
|
+
organizationName: 'Orange Solutions',
|
|
531
|
+
organizationId: 'orange-solutions'
|
|
532
|
+
});
|
|
533
|
+
this.updateCustomColorInputs();
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
applyCustomColors() {
|
|
537
|
+
this.whitelabelService.updateColors(
|
|
538
|
+
this.customPrimaryColor,
|
|
539
|
+
this.customSecondaryColor
|
|
540
|
+
);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
private updateCustomColorInputs() {
|
|
544
|
+
this.customPrimaryColor = this.whitelabelService.primaryColor();
|
|
545
|
+
this.customSecondaryColor = this.whitelabelService.secondaryColor();
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Injectable, signal } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* User service for managing current user data globally
|
|
5
|
+
*/
|
|
6
|
+
@Injectable({
|
|
7
|
+
providedIn: 'root'
|
|
8
|
+
})
|
|
9
|
+
export class UserService {
|
|
10
|
+
// User avatar configuration
|
|
11
|
+
private _avatarInitials = signal('LM');
|
|
12
|
+
private _avatarType = signal<'initials' | 'photo' | 'icon'>('initials');
|
|
13
|
+
private _avatarSrc = signal('');
|
|
14
|
+
|
|
15
|
+
// Readonly computed values
|
|
16
|
+
readonly avatarInitials = this._avatarInitials.asReadonly();
|
|
17
|
+
readonly avatarType = this._avatarType.asReadonly();
|
|
18
|
+
readonly avatarSrc = this._avatarSrc.asReadonly();
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Update avatar configuration
|
|
22
|
+
*/
|
|
23
|
+
setAvatarInitials(initials: string) {
|
|
24
|
+
this._avatarInitials.set(initials);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
setAvatarType(type: 'initials' | 'photo' | 'icon') {
|
|
28
|
+
this._avatarType.set(type);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
setAvatarSrc(src: string) {
|
|
32
|
+
this._avatarSrc.set(src);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|