@solidpepper/solidpepper-soliddesigner 0.2.1 → 0.2.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.
@@ -13297,6 +13297,79 @@ class SkuService {
13297
13297
  return of(null);
13298
13298
  }));
13299
13299
  }
13300
+ getDataSources() {
13301
+ const url = `${this.appParams.apiUrl}Dam/assets`;
13302
+ const headers = new HttpHeaders({
13303
+ Authorization: `bearer ${this.appParams.token}`,
13304
+ });
13305
+ const params = new HttpParams()
13306
+ .set('folder', '44444444-4444-4444-4444-444444444444')
13307
+ .set('assetType', 'PRODUCTSHEET');
13308
+ return this.http.get(url, { headers, params }).pipe(map$1((response) => {
13309
+ const items = Array.isArray(response)
13310
+ ? response
13311
+ : response.assets || [];
13312
+ return items.map((item) => ({
13313
+ guid: item.assetGuid,
13314
+ name: item.assetName,
13315
+ }));
13316
+ }), catchError((error) => {
13317
+ console.error('Error fetching data sources', error);
13318
+ return of([]);
13319
+ }));
13320
+ }
13321
+ getSheets(dataSourceGuid) {
13322
+ if (!dataSourceGuid)
13323
+ return of([]);
13324
+ const url = `${this.appParams.apiUrl}Dam/product-sheets/asset/${dataSourceGuid}`;
13325
+ const headers = new HttpHeaders({
13326
+ Authorization: `bearer ${this.appParams.token}`,
13327
+ });
13328
+ return this.http.get(url, { headers }).pipe(map$1((response) => {
13329
+ const items = Array.isArray(response)
13330
+ ? response
13331
+ : response.productSheets || response.items || [];
13332
+ return items.map((item) => ({
13333
+ guid: item.productSheetGuid,
13334
+ name: item.productSheetName,
13335
+ }));
13336
+ }), catchError((error) => {
13337
+ console.error('Error fetching sheets', error);
13338
+ return of([]);
13339
+ }));
13340
+ }
13341
+ getDataResults(sheetGuid, search = '', limit = 100, start = 0) {
13342
+ if (!sheetGuid)
13343
+ return of([]);
13344
+ const url = `${this.appParams.apiUrl}Dam/product-sheets/${sheetGuid}/lines`;
13345
+ const headers = new HttpHeaders({
13346
+ Authorization: `bearer ${this.appParams.token}`,
13347
+ });
13348
+ const params = new HttpParams()
13349
+ .set('limit', limit.toString())
13350
+ .set('start', start.toString());
13351
+ return this.http.get(url, { headers, params }).pipe(map$1((response) => {
13352
+ const items = Array.isArray(response)
13353
+ ? response
13354
+ : response.lines || response.items || response || [];
13355
+ const results = (Array.isArray(items) ? items : []).map((item) => ({
13356
+ ...item,
13357
+ sku: item.sku || item.productCode || item.code || '',
13358
+ skuName: item.skuName || item.productName || item.name || '',
13359
+ skuImage: item.skuImage || item.image || item.assetUrlMedium || '',
13360
+ skuGuid: item.skuGuid || item.productGuid || item.guid || '',
13361
+ }));
13362
+ if (search) {
13363
+ return results.filter((d) => (d.sku && d.sku.toLowerCase().includes(search.toLowerCase())) ||
13364
+ (d.skuName &&
13365
+ d.skuName.toLowerCase().includes(search.toLowerCase())));
13366
+ }
13367
+ return results;
13368
+ }), catchError((error) => {
13369
+ console.error('Error fetching data results', error);
13370
+ return of([]);
13371
+ }));
13372
+ }
13300
13373
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: SkuService, deps: [{ token: i1$2.HttpClient }, { token: AppParamsService }], target: i0.ɵɵFactoryTarget.Injectable }); }
13301
13374
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: SkuService, providedIn: 'root' }); }
13302
13375
  }
@@ -18123,7 +18196,7 @@ class ClipboardService {
18123
18196
  // TODO: Internal clipboard for fallback?
18124
18197
  async pasteImageFromBlob(blob, forceCompress = false) {
18125
18198
  try {
18126
- const { ImageUtils } = await import('./solidpepper-solidpepper-soliddesigner-image-utils-BOcydhPW.mjs');
18199
+ const { ImageUtils } = await import('./solidpepper-solidpepper-soliddesigner-image-utils-Bz7RX9oS.mjs');
18127
18200
  let compressedDataUrl;
18128
18201
  if (forceCompress || blob.size > MAX_IMAGE_SIZE_EXTERNAL) {
18129
18202
  compressedDataUrl = await ImageUtils.compressUntilSize(blob, MAX_IMAGE_SIZE_EXTERNAL / 1024);
@@ -20286,7 +20359,7 @@ class SvgCanvasComponent {
20286
20359
  }
20287
20360
  async processDropFile(file, event, forceCompress = false) {
20288
20361
  try {
20289
- const { ImageUtils } = await import('./solidpepper-solidpepper-soliddesigner-image-utils-BOcydhPW.mjs');
20362
+ const { ImageUtils } = await import('./solidpepper-solidpepper-soliddesigner-image-utils-Bz7RX9oS.mjs');
20290
20363
  let compressedDataUrl;
20291
20364
  if (forceCompress || file.size > SETTINGS.MAX_IMAGE_SIZE_EXTERNAL) {
20292
20365
  compressedDataUrl = await ImageUtils.compressUntilSize(file, SETTINGS.MAX_IMAGE_SIZE_EXTERNAL / 1024);
@@ -26724,7 +26797,7 @@ class ImagePropertiesPanelComponent {
26724
26797
  const img = elem.querySelector('img');
26725
26798
  if (img) {
26726
26799
  try {
26727
- const { ImageUtils } = await import('./solidpepper-solidpepper-soliddesigner-image-utils-BOcydhPW.mjs');
26800
+ const { ImageUtils } = await import('./solidpepper-solidpepper-soliddesigner-image-utils-Bz7RX9oS.mjs');
26728
26801
  const compressedBase64 = await ImageUtils.toBase64(bigUrl);
26729
26802
  // Reconstruct via setupImage
26730
26803
  this.imageService.setupImage(elem, false, undefined, compressedBase64);
@@ -26776,7 +26849,7 @@ class ImagePropertiesPanelComponent {
26776
26849
  const urlObj = new URL(bigUrl, window.location.origin);
26777
26850
  urlObj.searchParams.set('t', Date.now().toString());
26778
26851
  const refreshedSdUrl = urlObj.toString();
26779
- const { ImageUtils } = await import('./solidpepper-solidpepper-soliddesigner-image-utils-BOcydhPW.mjs');
26852
+ const { ImageUtils } = await import('./solidpepper-solidpepper-soliddesigner-image-utils-Bz7RX9oS.mjs');
26780
26853
  const dataUrl = await ImageUtils.toBase64(refreshedSdUrl);
26781
26854
  // Reconstruct the image inside the SVG
26782
26855
  this.imageService.setupImage(elem, false, undefined, dataUrl);
@@ -27561,7 +27634,7 @@ class DynamicImagePropertiesPanelComponent {
27561
27634
  this.modalService.open(AssetSelectorModalComponent, {
27562
27635
  onSelect: async (data) => {
27563
27636
  try {
27564
- const { ImageUtils } = await import('./solidpepper-solidpepper-soliddesigner-image-utils-BOcydhPW.mjs');
27637
+ const { ImageUtils } = await import('./solidpepper-solidpepper-soliddesigner-image-utils-Bz7RX9oS.mjs');
27565
27638
  const dataUrl = await ImageUtils.toBase64(data.bigUrl);
27566
27639
  this.transformToStaticImage(dataUrl);
27567
27640
  // Apply attributes to the newly created img
@@ -27629,7 +27702,7 @@ class DynamicImagePropertiesPanelComponent {
27629
27702
  }
27630
27703
  async processFile(file, forceCompress = false) {
27631
27704
  try {
27632
- const { ImageUtils } = await import('./solidpepper-solidpepper-soliddesigner-image-utils-BOcydhPW.mjs');
27705
+ const { ImageUtils } = await import('./solidpepper-solidpepper-soliddesigner-image-utils-Bz7RX9oS.mjs');
27633
27706
  let compressedDataUrl;
27634
27707
  if (forceCompress || file.size > SETTINGS.MAX_IMAGE_SIZE_EXTERNAL) {
27635
27708
  compressedDataUrl = await ImageUtils.compressUntilSize(file, SETTINGS.MAX_IMAGE_SIZE_EXTERNAL / 1024);
@@ -28716,7 +28789,7 @@ class SharePanelComponent {
28716
28789
  }
28717
28790
  // Polling removed in favor of WebSocket/SignalR
28718
28791
  previewPdf() {
28719
- import('./solidpepper-solidpepper-soliddesigner-page-grid-modal.component-BS0ULjJ5.mjs').then((m) => {
28792
+ import('./solidpepper-solidpepper-soliddesigner-page-grid-modal.component-C8Y12cqJ.mjs').then((m) => {
28720
28793
  this.modalService.open(m.PageGridModalComponent, {
28721
28794
  onPageSelect: (index) => this.goToPage(index),
28722
28795
  });
@@ -30205,27 +30278,88 @@ class SkuPanelComponent {
30205
30278
  constructor(skuService, translate) {
30206
30279
  this.skuService = skuService;
30207
30280
  this.translate = translate;
30281
+ this.viewMode = signal('products', ...(ngDevMode ? [{ debugName: "viewMode" }] : []));
30282
+ // Products Mode
30208
30283
  this.searchTerm = '';
30209
30284
  this.products = signal([], ...(ngDevMode ? [{ debugName: "products" }] : []));
30285
+ // Data Mode
30286
+ this.dataSearchTerm = '';
30287
+ this.dataResults = signal([], ...(ngDevMode ? [{ debugName: "dataResults" }] : []));
30288
+ this.dataSources = signal([], ...(ngDevMode ? [{ debugName: "dataSources" }] : []));
30289
+ this.sheets = signal([], ...(ngDevMode ? [{ debugName: "sheets" }] : []));
30290
+ this.selectedDataSource = signal(null, ...(ngDevMode ? [{ debugName: "selectedDataSource" }] : []));
30291
+ this.selectedProductSheet = signal(null, ...(ngDevMode ? [{ debugName: "selectedProductSheet" }] : []));
30210
30292
  this.isLoading = signal(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
30211
30293
  this.currentPage = signal(1, ...(ngDevMode ? [{ debugName: "currentPage" }] : []));
30212
30294
  this.totalItems = signal(0, ...(ngDevMode ? [{ debugName: "totalItems" }] : []));
30213
30295
  this.totalPages = signal(1, ...(ngDevMode ? [{ debugName: "totalPages" }] : []));
30214
30296
  this.pageSize = 15;
30215
30297
  this.searchSubject = new Subject();
30298
+ this.dataSearchSubject = new Subject();
30216
30299
  this.destroy$ = new Subject();
30217
30300
  this.currentLang = 'en';
30218
30301
  this.currentLang = this.translate.currentLang || 'en';
30219
30302
  }
30220
30303
  ngOnInit() {
30304
+ this.loadDataSources();
30221
30305
  this.searchSubject
30222
30306
  .pipe(debounceTime(300), distinctUntilChanged(), takeUntil(this.destroy$))
30223
30307
  .subscribe(() => {
30224
30308
  this.currentPage.set(1);
30225
30309
  this.loadProducts();
30226
30310
  });
30311
+ this.dataSearchSubject
30312
+ .pipe(debounceTime(300), distinctUntilChanged(), takeUntil(this.destroy$))
30313
+ .subscribe(() => {
30314
+ this.loadDataResults();
30315
+ });
30227
30316
  this.loadProducts();
30228
30317
  }
30318
+ setMode(mode) {
30319
+ this.viewMode.set(mode);
30320
+ if (mode === 'products') {
30321
+ this.loadProducts();
30322
+ }
30323
+ else if (this.selectedProductSheet()) {
30324
+ this.loadDataResults();
30325
+ }
30326
+ }
30327
+ onDataSourceChange(guid) {
30328
+ this.selectedDataSource.set(guid);
30329
+ this.selectedProductSheet.set(null);
30330
+ this.sheets.set([]);
30331
+ this.dataResults.set([]);
30332
+ if (guid) {
30333
+ this.skuService.getSheets(guid).subscribe((sheets) => {
30334
+ this.sheets.set(sheets);
30335
+ });
30336
+ }
30337
+ }
30338
+ onProductSheetChange(guid) {
30339
+ this.selectedProductSheet.set(guid);
30340
+ if (guid) {
30341
+ this.loadDataResults();
30342
+ }
30343
+ else {
30344
+ this.dataResults.set([]);
30345
+ }
30346
+ }
30347
+ loadDataResults() {
30348
+ if (!this.selectedProductSheet())
30349
+ return;
30350
+ this.isLoading.set(true);
30351
+ this.skuService
30352
+ .getDataResults(this.selectedProductSheet(), this.dataSearchTerm)
30353
+ .subscribe((results) => {
30354
+ this.dataResults.set(results);
30355
+ this.isLoading.set(false);
30356
+ });
30357
+ }
30358
+ loadDataSources() {
30359
+ this.skuService.getDataSources().subscribe((ds) => {
30360
+ this.dataSources.set(ds);
30361
+ });
30362
+ }
30229
30363
  ngOnDestroy() {
30230
30364
  this.destroy$.next();
30231
30365
  this.destroy$.complete();
@@ -30233,6 +30367,9 @@ class SkuPanelComponent {
30233
30367
  onSearchChange(value) {
30234
30368
  this.searchSubject.next(value);
30235
30369
  }
30370
+ onDataSearchChange(value) {
30371
+ this.dataSearchSubject.next(value);
30372
+ }
30236
30373
  goToPage(page) {
30237
30374
  if (page < 1 || page > this.totalPages())
30238
30375
  return;
@@ -30308,185 +30445,540 @@ class SkuPanelComponent {
30308
30445
  [isOpen]="true"
30309
30446
  >
30310
30447
  <div class="sku-panel">
30311
- <!-- Search -->
30312
- <div class="sku-search">
30313
- <svg class="search-icon" width="14" height="14" viewBox="0 0 24 24" fill="none"
30314
- stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
30315
- <circle cx="11" cy="11" r="8"/>
30316
- <line x1="21" y1="21" x2="16.65" y2="16.65"/>
30317
- </svg>
30318
- <input
30319
- type="text"
30320
- class="search-input"
30321
- [placeholder]="'TEMPLATE.SEARCH_PLACEHOLDER' | translate"
30322
- [(ngModel)]="searchTerm"
30323
- (ngModelChange)="onSearchChange($event)"
30324
- />
30448
+ <!-- Mode Selection -->
30449
+ <div class="sku-mode-toggle">
30450
+ <button
30451
+ class="mode-btn"
30452
+ [class.active]="viewMode() === 'products'"
30453
+ (click)="setMode('products')"
30454
+ >
30455
+ {{ 'TEMPLATE.PRODUCTS' | translate }}
30456
+ </button>
30457
+ <button
30458
+ class="mode-btn"
30459
+ [class.active]="viewMode() === 'data'"
30460
+ (click)="setMode('data')"
30461
+ >
30462
+ {{ 'TEMPLATE.DATA' | translate }}
30463
+ </button>
30325
30464
  </div>
30326
30465
 
30327
- <!-- Product List -->
30328
- <div class="sku-list" *ngIf="!isLoading()">
30466
+ <!-- ========================================== -->
30467
+ <!-- PRODUCTS MODE -->
30468
+ <!-- ========================================== -->
30469
+ <ng-container *ngIf="viewMode() === 'products'">
30470
+ <!-- Search -->
30471
+ <div class="sku-search">
30472
+ <svg
30473
+ class="search-icon"
30474
+ width="14"
30475
+ height="14"
30476
+ viewBox="0 0 24 24"
30477
+ fill="none"
30478
+ stroke="currentColor"
30479
+ stroke-width="2"
30480
+ stroke-linecap="round"
30481
+ stroke-linejoin="round"
30482
+ >
30483
+ <circle cx="11" cy="11" r="8" />
30484
+ <line x1="21" y1="21" x2="16.65" y2="16.65" />
30485
+ </svg>
30486
+ <input
30487
+ type="text"
30488
+ class="search-input"
30489
+ [placeholder]="'TEMPLATE.SEARCH_PLACEHOLDER' | translate"
30490
+ [(ngModel)]="searchTerm"
30491
+ (ngModelChange)="onSearchChange($event)"
30492
+ />
30493
+ </div>
30494
+
30495
+ <!-- Product List -->
30496
+ <div class="sku-list" *ngIf="!isLoading()">
30497
+ <div
30498
+ class="sku-card"
30499
+ *ngFor="let product of products()"
30500
+ draggable="true"
30501
+ (dragstart)="onDragStart($event, product)"
30502
+ >
30503
+ <div class="sku-card-image">
30504
+ <img
30505
+ *ngIf="getProductImage(product)"
30506
+ [src]="getProductImage(product)"
30507
+ [alt]="getProductName(product)"
30508
+ (error)="onImageError($event)"
30509
+ />
30510
+ <div class="no-image" *ngIf="!getProductImage(product)">
30511
+ <svg
30512
+ width="20"
30513
+ height="20"
30514
+ viewBox="0 0 24 24"
30515
+ fill="none"
30516
+ stroke="currentColor"
30517
+ stroke-width="1.5"
30518
+ >
30519
+ <rect x="3" y="3" width="18" height="18" rx="2" />
30520
+ <circle cx="8.5" cy="8.5" r="1.5" />
30521
+ <path d="M21 15l-5-5L5 21" />
30522
+ </svg>
30523
+ </div>
30524
+ </div>
30525
+ <div class="sku-card-info">
30526
+ <span class="sku-card-name">{{ getProductName(product) }}</span>
30527
+ <span class="sku-card-code">{{ product.sku }}</span>
30528
+ </div>
30529
+ </div>
30530
+ </div>
30531
+
30532
+ <!-- Empty State -->
30329
30533
  <div
30330
- class="sku-card"
30331
- *ngFor="let product of products()"
30332
- draggable="true"
30333
- (dragstart)="onDragStart($event, product)"
30534
+ class="sku-empty"
30535
+ *ngIf="!isLoading() && products().length === 0"
30334
30536
  >
30335
- <div class="sku-card-image">
30336
- <img
30337
- *ngIf="getProductImage(product)"
30338
- [src]="getProductImage(product)"
30339
- [alt]="getProductName(product)"
30340
- (error)="onImageError($event)"
30537
+ {{ 'TEMPLATE.NO_PRODUCTS' | translate }}
30538
+ </div>
30539
+
30540
+ <!-- Pagination -->
30541
+ <div class="sku-pagination" *ngIf="totalPages() > 1">
30542
+ <button
30543
+ class="page-btn"
30544
+ [disabled]="currentPage() <= 1"
30545
+ (click)="goToPage(currentPage() - 1)"
30546
+ >
30547
+ ‹
30548
+ </button>
30549
+ <div class="page-info">
30550
+ <input
30551
+ type="number"
30552
+ class="page-input"
30553
+ [value]="currentPage()"
30554
+ (change)="onPageInputChange($event)"
30555
+ (keydown.enter)="onPageInputChange($event)"
30556
+ min="1"
30557
+ [max]="totalPages()"
30341
30558
  />
30342
- <div class="no-image" *ngIf="!getProductImage(product)">
30343
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none"
30344
- stroke="currentColor" stroke-width="1.5">
30345
- <rect x="3" y="3" width="18" height="18" rx="2"/>
30346
- <circle cx="8.5" cy="8.5" r="1.5"/>
30347
- <path d="M21 15l-5-5L5 21"/>
30348
- </svg>
30349
- </div>
30350
- </div>
30351
- <div class="sku-card-info">
30352
- <span class="sku-card-name">{{ getProductName(product) }}</span>
30353
- <span class="sku-card-code">{{ product.sku }}</span>
30559
+ <span class="page-total">/ {{ totalPages() }}</span>
30354
30560
  </div>
30561
+ <button
30562
+ class="page-btn"
30563
+ [disabled]="currentPage() >= totalPages()"
30564
+ (click)="goToPage(currentPage() + 1)"
30565
+ >
30566
+ ›
30567
+ </button>
30355
30568
  </div>
30356
- </div>
30569
+ </ng-container>
30357
30570
 
30358
- <!-- Loading -->
30359
- <div class="sku-loading" *ngIf="isLoading()">
30360
- <div class="spinner"></div>
30361
- </div>
30571
+ <!-- ========================================== -->
30572
+ <!-- DATA MODE -->
30573
+ <!-- ========================================== -->
30574
+ <ng-container *ngIf="viewMode() === 'data'">
30575
+ <div class="sku-data-selection">
30576
+ <div class="select-wrapper">
30577
+ <select
30578
+ class="sku-select"
30579
+ [ngModel]="selectedDataSource()"
30580
+ (ngModelChange)="onDataSourceChange($event)"
30581
+ >
30582
+ <option [value]="null" disabled selected>
30583
+ {{ 'TEMPLATE.SELECT_DATA' | translate }}
30584
+ </option>
30585
+ <option *ngFor="let ds of dataSources()" [value]="ds.guid">
30586
+ {{ ds.name }}
30587
+ </option>
30588
+ </select>
30589
+ <svg
30590
+ class="select-icon"
30591
+ width="10"
30592
+ height="10"
30593
+ viewBox="0 0 24 24"
30594
+ fill="none"
30595
+ stroke="currentColor"
30596
+ stroke-width="2"
30597
+ >
30598
+ <path d="M6 9l6 6 6-6" />
30599
+ </svg>
30600
+ </div>
30362
30601
 
30363
- <!-- Empty State -->
30364
- <div class="sku-empty" *ngIf="!isLoading() && products().length === 0">
30365
- {{ 'TEMPLATE.NO_PRODUCTS' | translate }}
30366
- </div>
30602
+ <div class="select-wrapper" *ngIf="selectedDataSource()">
30603
+ <select
30604
+ class="sku-select"
30605
+ [ngModel]="selectedProductSheet()"
30606
+ (ngModelChange)="onProductSheetChange($event)"
30607
+ >
30608
+ <option [value]="null" disabled selected>
30609
+ {{ 'TEMPLATE.SELECT_SHEET' | translate }}
30610
+ </option>
30611
+ <option *ngFor="let sheet of sheets()" [value]="sheet.guid">
30612
+ {{ sheet.name }}
30613
+ </option>
30614
+ </select>
30615
+ <svg
30616
+ class="select-icon"
30617
+ width="10"
30618
+ height="10"
30619
+ viewBox="0 0 24 24"
30620
+ fill="none"
30621
+ stroke="currentColor"
30622
+ stroke-width="2"
30623
+ >
30624
+ <path d="M6 9l6 6 6-6" />
30625
+ </svg>
30626
+ </div>
30627
+ </div>
30367
30628
 
30368
- <!-- Pagination -->
30369
- <div class="sku-pagination" *ngIf="totalPages() > 1">
30370
- <button
30371
- class="page-btn"
30372
- [disabled]="currentPage() <= 1"
30373
- (click)="goToPage(currentPage() - 1)"
30374
- >‹</button>
30375
- <div class="page-info">
30629
+ <!-- Data Search (Only if sheet selected) -->
30630
+ <div class="sku-search" *ngIf="selectedProductSheet()">
30631
+ <svg
30632
+ class="search-icon"
30633
+ width="14"
30634
+ height="14"
30635
+ viewBox="0 0 24 24"
30636
+ fill="none"
30637
+ stroke="currentColor"
30638
+ stroke-width="2"
30639
+ stroke-linecap="round"
30640
+ stroke-linejoin="round"
30641
+ >
30642
+ <circle cx="11" cy="11" r="8" />
30643
+ <line x1="21" y1="21" x2="16.65" y2="16.65" />
30644
+ </svg>
30376
30645
  <input
30377
- type="number"
30378
- class="page-input"
30379
- [value]="currentPage()"
30380
- (change)="onPageInputChange($event)"
30381
- (keydown.enter)="onPageInputChange($event)"
30382
- min="1"
30383
- [max]="totalPages()"
30646
+ type="text"
30647
+ class="search-input"
30648
+ [placeholder]="'TEMPLATE.SEARCH_PLACEHOLDER' | translate"
30649
+ [(ngModel)]="dataSearchTerm"
30650
+ (ngModelChange)="onDataSearchChange($event)"
30384
30651
  />
30385
- <span class="page-total">/ {{ totalPages() }}</span>
30386
30652
  </div>
30387
- <button
30388
- class="page-btn"
30389
- [disabled]="currentPage() >= totalPages()"
30390
- (click)="goToPage(currentPage() + 1)"
30391
- >›</button>
30653
+
30654
+ <!-- Data List -->
30655
+ <div
30656
+ class="productsheet-list"
30657
+ *ngIf="!isLoading() && selectedProductSheet()"
30658
+ >
30659
+ <div
30660
+ class="sku-card"
30661
+ *ngFor="let item of dataResults()"
30662
+ draggable="true"
30663
+ (dragstart)="onDragStart($event, item)"
30664
+ >
30665
+ <div class="sku-card-image">
30666
+ <div class="no-image">
30667
+ <svg
30668
+ width="20"
30669
+ height="20"
30670
+ viewBox="0 0 24 24"
30671
+ fill="none"
30672
+ stroke="currentColor"
30673
+ stroke-width="1.5"
30674
+ >
30675
+ <rect x="3" y="3" width="18" height="18" rx="2" />
30676
+ <circle cx="8.5" cy="8.5" r="1.5" />
30677
+ <path d="M21 15l-5-5L5 21" />
30678
+ </svg>
30679
+ </div>
30680
+ </div>
30681
+ <div class="sku-card-info">
30682
+ <span class="sku-card-name">{{ item.skuName }}</span>
30683
+ <span class="sku-card-code">{{ item.sku }}</span>
30684
+ </div>
30685
+ </div>
30686
+ </div>
30687
+
30688
+ <!-- Empty State -->
30689
+ <div
30690
+ class="sku-empty"
30691
+ *ngIf="
30692
+ !isLoading() &&
30693
+ selectedProductSheet() &&
30694
+ dataResults().length === 0
30695
+ "
30696
+ >
30697
+ {{ 'TEMPLATE.NO_PRODUCTS' | translate }}
30698
+ </div>
30699
+ </ng-container>
30700
+
30701
+ <!-- Loading -->
30702
+ <div class="sku-loading" *ngIf="isLoading()">
30703
+ <div class="spinner"></div>
30392
30704
  </div>
30393
30705
  </div>
30394
30706
  </app-collapsible-panel>
30395
- `, isInline: true, styles: [".sub-panel{display:flex;flex-direction:column;gap:10px;padding-bottom:10px}.label-text{font-size:var(--font-size-small, 12px);margin-bottom:4px;color:var(--gray-1, #80808e)}.buttons-six-columns{display:grid;grid-template-columns:repeat(2,1fr);column-gap:var(--spacing-xs)}.buttons-six-columns>*{display:grid;grid-template-columns:repeat(3,1fr)!important;column-gap:2px!important}.inputs-two-columns{display:grid;grid-template-columns:repeat(2,1fr);gap:var(--spacing-xs)}.inputs-three-columns{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--spacing-xs)}.panel-row{display:flex;flex-direction:column;gap:5px}app-drag-input,app-select-input,app-check-input,app-color-input,app-button-input{flex:1;min-width:0}\n", ".sku-panel{display:flex;flex-direction:column;gap:8px}.sku-search{position:relative;display:flex;align-items:center}.search-icon{position:absolute;left:8px;color:var(--gray-2);pointer-events:none}.search-input{width:100%;background:var(--gray-4);border:1px solid transparent;color:var(--white);padding:6px 8px 6px 28px;border-radius:var(--radius-s);font-size:12px;outline:none;box-sizing:border-box}.search-input:focus{border-color:var(--active)}.search-input::placeholder{color:var(--gray-2)}.sku-list{display:flex;flex-direction:column;gap:4px;max-height:340px;overflow-y:auto}.sku-list::-webkit-scrollbar{width:4px}.sku-list::-webkit-scrollbar-track{background:transparent}.sku-list::-webkit-scrollbar-thumb{background-color:var(--gray-2);border-radius:2px}.sku-card{display:flex;align-items:center;gap:8px;padding:4px 6px;background:var(--gray-4);border-radius:var(--radius-s);cursor:grab;border:1px solid transparent;transition:background .15s,border-color .15s}.sku-card:hover{background:var(--gray-3);border-color:var(--active)}.sku-card:active{cursor:grabbing}.sku-card-image{width:40px;height:40px;min-width:40px;border-radius:4px;overflow:hidden;background:var(--gray-5);display:flex;align-items:center;justify-content:center}.sku-card-image img{width:100%;height:100%;object-fit:contain}.no-image{color:var(--gray-2)}.sku-card-info{display:flex;flex-direction:column;min-width:0;gap:1px}.sku-card-name{font-size:12px;color:var(--white);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sku-card-code{font-size:10px;color:var(--gray-1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sku-loading{display:flex;justify-content:center;padding:20px 0}.spinner{width:20px;height:20px;border:2px solid var(--gray-3);border-top-color:var(--active);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.sku-empty{text-align:center;color:var(--gray-1);padding:16px 0;font-size:12px}.sku-pagination{display:flex;align-items:center;justify-content:center;gap:6px;padding-top:4px}.page-btn{background:var(--gray-4);color:var(--white);border:none;width:24px;height:24px;border-radius:var(--radius-s);cursor:pointer;font-size:14px;display:flex;align-items:center;justify-content:center;transition:background .2s}.page-btn:hover:not(:disabled){background:var(--gray-3)}.page-btn:disabled{opacity:.4;cursor:not-allowed}.page-info{display:flex;align-items:center;gap:3px}.page-input{width:32px;background:var(--gray-4);border:1px solid var(--gray-3);color:var(--white);text-align:center;padding:2px;border-radius:var(--radius-s);font-size:11px;outline:none;-moz-appearance:textfield}.page-input::-webkit-inner-spin-button,.page-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.page-input:focus{border-color:var(--active)}.page-total{font-size:11px;color:var(--gray-1)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: CollapsiblePanelComponent, selector: "app-collapsible-panel", inputs: ["title", "isOpen", "showSwitch", "switchChecked", "showToggle", "boldTitle", "horizontalPadding"], outputs: ["toggle", "checkedChange"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
30707
+ `, isInline: true, styles: [".sub-panel{display:flex;flex-direction:column;gap:10px;padding-bottom:10px}.label-text{font-size:var(--font-size-small, 12px);margin-bottom:4px;color:var(--gray-1, #80808e)}.buttons-six-columns{display:grid;grid-template-columns:repeat(2,1fr);column-gap:var(--spacing-xs)}.buttons-six-columns>*{display:grid;grid-template-columns:repeat(3,1fr)!important;column-gap:2px!important}.inputs-two-columns{display:grid;grid-template-columns:repeat(2,1fr);gap:var(--spacing-xs)}.inputs-three-columns{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--spacing-xs)}.panel-row{display:flex;flex-direction:column;gap:5px}app-drag-input,app-select-input,app-check-input,app-color-input,app-button-input{flex:1;min-width:0}\n", ".sku-panel{display:flex;flex-direction:column;gap:8px}.sku-mode-toggle{display:flex;background:var(--gray-5);border-radius:var(--radius-m);padding:2px;gap:2px}.mode-btn{flex:1;background:transparent;border:none;color:var(--gray-2);font-size:11px;padding:6px;border-radius:var(--radius-s);cursor:pointer;transition:background .2s,color .2s}.mode-btn:hover{color:var(--white)}.mode-btn.active{background:var(--gray-3);color:var(--white);box-shadow:0 1px 3px #0003}.sku-data-selection{display:flex;flex-direction:column;gap:6px}.select-wrapper{position:relative;display:flex;align-items:center}.sku-select{width:100%;background:var(--gray-4);border:1px solid var(--gray-3);color:var(--white);padding:6px 24px 6px 8px;border-radius:var(--radius-s);font-size:11px;outline:none;cursor:pointer;appearance:none;transition:border-color .2s}.sku-select:focus{border-color:var(--active)}.select-icon{position:absolute;right:8px;color:var(--gray-2);pointer-events:none}.sku-search{position:relative;display:flex;align-items:center}.search-icon{position:absolute;left:8px;color:var(--gray-2);pointer-events:none}.search-input{width:100%;background:var(--gray-4);border:1px solid transparent;color:var(--white);padding:6px 8px 6px 28px;border-radius:var(--radius-s);font-size:12px;outline:none;box-sizing:border-box}.search-input:focus{border-color:var(--active)}.search-input::placeholder{color:var(--gray-2)}.sku-list{display:flex;flex-direction:column;gap:4px;max-height:310px;overflow-y:auto}.productsheet-list{display:flex;flex-direction:column;gap:4px;max-height:270px;overflow-y:auto}.sku-list::-webkit-scrollbar{width:4px}.sku-list::-webkit-scrollbar-track{background:transparent}.sku-list::-webkit-scrollbar-thumb{background-color:var(--gray-2);border-radius:2px}.productsheet-list::-webkit-scrollbar{width:4px}.productsheet-list::-webkit-scrollbar-track{background:transparent}.productsheet-list::-webkit-scrollbar-thumb{background-color:var(--gray-2);border-radius:2px}.sku-card{display:flex;align-items:center;gap:8px;padding:4px 6px;background:var(--gray-4);border-radius:var(--radius-s);cursor:grab;border:1px solid transparent;transition:background .15s,border-color .15s}.sku-card:hover{background:var(--gray-3);border-color:var(--active)}.sku-card:active{cursor:grabbing}.sku-card-image{width:40px;height:40px;min-width:40px;border-radius:4px;overflow:hidden;background:var(--gray-5);display:flex;align-items:center;justify-content:center}.sku-card-image img{width:100%;height:100%;object-fit:contain}.no-image{color:var(--gray-2)}.sku-card-info{display:flex;flex-direction:column;min-width:0;gap:1px}.sku-card-name{font-size:12px;color:var(--white);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sku-card-code{font-size:10px;color:var(--gray-1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sku-loading{display:flex;justify-content:center;padding:20px 0}.spinner{width:20px;height:20px;border:2px solid var(--gray-3);border-top-color:var(--active);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.sku-empty{text-align:center;color:var(--gray-1);padding:16px 0;font-size:12px}.sku-pagination{display:flex;align-items:center;justify-content:center;gap:6px;padding-top:4px}.page-btn{background:var(--gray-4);color:var(--white);border:none;width:24px;height:24px;border-radius:var(--radius-s);cursor:pointer;font-size:14px;display:flex;align-items:center;justify-content:center;transition:background .2s}.page-btn:hover:not(:disabled){background:var(--gray-3)}.page-btn:disabled{opacity:.4;cursor:not-allowed}.page-info{display:flex;align-items:center;gap:3px}.page-input{width:32px;background:var(--gray-4);border:1px solid var(--gray-3);color:var(--white);text-align:center;padding:2px;border-radius:var(--radius-s);font-size:11px;outline:none;-moz-appearance:textfield}.page-input::-webkit-inner-spin-button,.page-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.page-input:focus{border-color:var(--active)}.page-total{font-size:11px;color:var(--gray-1)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "component", type: CollapsiblePanelComponent, selector: "app-collapsible-panel", inputs: ["title", "isOpen", "showSwitch", "switchChecked", "showToggle", "boldTitle", "horizontalPadding"], outputs: ["toggle", "checkedChange"] }, { kind: "pipe", type: i2$1.TranslatePipe, name: "translate" }] }); }
30396
30708
  }
30397
30709
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: SkuPanelComponent, decorators: [{
30398
30710
  type: Component,
30399
- args: [{ selector: 'app-sku-panel', standalone: true, imports: [CommonModule, FormsModule, TranslateModule, CollapsiblePanelComponent], template: `
30711
+ args: [{ selector: 'app-sku-panel', standalone: true, imports: [
30712
+ CommonModule,
30713
+ FormsModule,
30714
+ TranslateModule,
30715
+ CollapsiblePanelComponent,
30716
+ ], template: `
30400
30717
  <app-collapsible-panel
30401
30718
  [title]="'TEMPLATE.PRODUCTS' | translate"
30402
30719
  [isOpen]="true"
30403
30720
  >
30404
30721
  <div class="sku-panel">
30405
- <!-- Search -->
30406
- <div class="sku-search">
30407
- <svg class="search-icon" width="14" height="14" viewBox="0 0 24 24" fill="none"
30408
- stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
30409
- <circle cx="11" cy="11" r="8"/>
30410
- <line x1="21" y1="21" x2="16.65" y2="16.65"/>
30411
- </svg>
30412
- <input
30413
- type="text"
30414
- class="search-input"
30415
- [placeholder]="'TEMPLATE.SEARCH_PLACEHOLDER' | translate"
30416
- [(ngModel)]="searchTerm"
30417
- (ngModelChange)="onSearchChange($event)"
30418
- />
30722
+ <!-- Mode Selection -->
30723
+ <div class="sku-mode-toggle">
30724
+ <button
30725
+ class="mode-btn"
30726
+ [class.active]="viewMode() === 'products'"
30727
+ (click)="setMode('products')"
30728
+ >
30729
+ {{ 'TEMPLATE.PRODUCTS' | translate }}
30730
+ </button>
30731
+ <button
30732
+ class="mode-btn"
30733
+ [class.active]="viewMode() === 'data'"
30734
+ (click)="setMode('data')"
30735
+ >
30736
+ {{ 'TEMPLATE.DATA' | translate }}
30737
+ </button>
30419
30738
  </div>
30420
30739
 
30421
- <!-- Product List -->
30422
- <div class="sku-list" *ngIf="!isLoading()">
30740
+ <!-- ========================================== -->
30741
+ <!-- PRODUCTS MODE -->
30742
+ <!-- ========================================== -->
30743
+ <ng-container *ngIf="viewMode() === 'products'">
30744
+ <!-- Search -->
30745
+ <div class="sku-search">
30746
+ <svg
30747
+ class="search-icon"
30748
+ width="14"
30749
+ height="14"
30750
+ viewBox="0 0 24 24"
30751
+ fill="none"
30752
+ stroke="currentColor"
30753
+ stroke-width="2"
30754
+ stroke-linecap="round"
30755
+ stroke-linejoin="round"
30756
+ >
30757
+ <circle cx="11" cy="11" r="8" />
30758
+ <line x1="21" y1="21" x2="16.65" y2="16.65" />
30759
+ </svg>
30760
+ <input
30761
+ type="text"
30762
+ class="search-input"
30763
+ [placeholder]="'TEMPLATE.SEARCH_PLACEHOLDER' | translate"
30764
+ [(ngModel)]="searchTerm"
30765
+ (ngModelChange)="onSearchChange($event)"
30766
+ />
30767
+ </div>
30768
+
30769
+ <!-- Product List -->
30770
+ <div class="sku-list" *ngIf="!isLoading()">
30771
+ <div
30772
+ class="sku-card"
30773
+ *ngFor="let product of products()"
30774
+ draggable="true"
30775
+ (dragstart)="onDragStart($event, product)"
30776
+ >
30777
+ <div class="sku-card-image">
30778
+ <img
30779
+ *ngIf="getProductImage(product)"
30780
+ [src]="getProductImage(product)"
30781
+ [alt]="getProductName(product)"
30782
+ (error)="onImageError($event)"
30783
+ />
30784
+ <div class="no-image" *ngIf="!getProductImage(product)">
30785
+ <svg
30786
+ width="20"
30787
+ height="20"
30788
+ viewBox="0 0 24 24"
30789
+ fill="none"
30790
+ stroke="currentColor"
30791
+ stroke-width="1.5"
30792
+ >
30793
+ <rect x="3" y="3" width="18" height="18" rx="2" />
30794
+ <circle cx="8.5" cy="8.5" r="1.5" />
30795
+ <path d="M21 15l-5-5L5 21" />
30796
+ </svg>
30797
+ </div>
30798
+ </div>
30799
+ <div class="sku-card-info">
30800
+ <span class="sku-card-name">{{ getProductName(product) }}</span>
30801
+ <span class="sku-card-code">{{ product.sku }}</span>
30802
+ </div>
30803
+ </div>
30804
+ </div>
30805
+
30806
+ <!-- Empty State -->
30423
30807
  <div
30424
- class="sku-card"
30425
- *ngFor="let product of products()"
30426
- draggable="true"
30427
- (dragstart)="onDragStart($event, product)"
30808
+ class="sku-empty"
30809
+ *ngIf="!isLoading() && products().length === 0"
30428
30810
  >
30429
- <div class="sku-card-image">
30430
- <img
30431
- *ngIf="getProductImage(product)"
30432
- [src]="getProductImage(product)"
30433
- [alt]="getProductName(product)"
30434
- (error)="onImageError($event)"
30811
+ {{ 'TEMPLATE.NO_PRODUCTS' | translate }}
30812
+ </div>
30813
+
30814
+ <!-- Pagination -->
30815
+ <div class="sku-pagination" *ngIf="totalPages() > 1">
30816
+ <button
30817
+ class="page-btn"
30818
+ [disabled]="currentPage() <= 1"
30819
+ (click)="goToPage(currentPage() - 1)"
30820
+ >
30821
+ ‹
30822
+ </button>
30823
+ <div class="page-info">
30824
+ <input
30825
+ type="number"
30826
+ class="page-input"
30827
+ [value]="currentPage()"
30828
+ (change)="onPageInputChange($event)"
30829
+ (keydown.enter)="onPageInputChange($event)"
30830
+ min="1"
30831
+ [max]="totalPages()"
30435
30832
  />
30436
- <div class="no-image" *ngIf="!getProductImage(product)">
30437
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none"
30438
- stroke="currentColor" stroke-width="1.5">
30439
- <rect x="3" y="3" width="18" height="18" rx="2"/>
30440
- <circle cx="8.5" cy="8.5" r="1.5"/>
30441
- <path d="M21 15l-5-5L5 21"/>
30442
- </svg>
30443
- </div>
30444
- </div>
30445
- <div class="sku-card-info">
30446
- <span class="sku-card-name">{{ getProductName(product) }}</span>
30447
- <span class="sku-card-code">{{ product.sku }}</span>
30833
+ <span class="page-total">/ {{ totalPages() }}</span>
30448
30834
  </div>
30835
+ <button
30836
+ class="page-btn"
30837
+ [disabled]="currentPage() >= totalPages()"
30838
+ (click)="goToPage(currentPage() + 1)"
30839
+ >
30840
+ ›
30841
+ </button>
30449
30842
  </div>
30450
- </div>
30843
+ </ng-container>
30451
30844
 
30452
- <!-- Loading -->
30453
- <div class="sku-loading" *ngIf="isLoading()">
30454
- <div class="spinner"></div>
30455
- </div>
30845
+ <!-- ========================================== -->
30846
+ <!-- DATA MODE -->
30847
+ <!-- ========================================== -->
30848
+ <ng-container *ngIf="viewMode() === 'data'">
30849
+ <div class="sku-data-selection">
30850
+ <div class="select-wrapper">
30851
+ <select
30852
+ class="sku-select"
30853
+ [ngModel]="selectedDataSource()"
30854
+ (ngModelChange)="onDataSourceChange($event)"
30855
+ >
30856
+ <option [value]="null" disabled selected>
30857
+ {{ 'TEMPLATE.SELECT_DATA' | translate }}
30858
+ </option>
30859
+ <option *ngFor="let ds of dataSources()" [value]="ds.guid">
30860
+ {{ ds.name }}
30861
+ </option>
30862
+ </select>
30863
+ <svg
30864
+ class="select-icon"
30865
+ width="10"
30866
+ height="10"
30867
+ viewBox="0 0 24 24"
30868
+ fill="none"
30869
+ stroke="currentColor"
30870
+ stroke-width="2"
30871
+ >
30872
+ <path d="M6 9l6 6 6-6" />
30873
+ </svg>
30874
+ </div>
30456
30875
 
30457
- <!-- Empty State -->
30458
- <div class="sku-empty" *ngIf="!isLoading() && products().length === 0">
30459
- {{ 'TEMPLATE.NO_PRODUCTS' | translate }}
30460
- </div>
30876
+ <div class="select-wrapper" *ngIf="selectedDataSource()">
30877
+ <select
30878
+ class="sku-select"
30879
+ [ngModel]="selectedProductSheet()"
30880
+ (ngModelChange)="onProductSheetChange($event)"
30881
+ >
30882
+ <option [value]="null" disabled selected>
30883
+ {{ 'TEMPLATE.SELECT_SHEET' | translate }}
30884
+ </option>
30885
+ <option *ngFor="let sheet of sheets()" [value]="sheet.guid">
30886
+ {{ sheet.name }}
30887
+ </option>
30888
+ </select>
30889
+ <svg
30890
+ class="select-icon"
30891
+ width="10"
30892
+ height="10"
30893
+ viewBox="0 0 24 24"
30894
+ fill="none"
30895
+ stroke="currentColor"
30896
+ stroke-width="2"
30897
+ >
30898
+ <path d="M6 9l6 6 6-6" />
30899
+ </svg>
30900
+ </div>
30901
+ </div>
30461
30902
 
30462
- <!-- Pagination -->
30463
- <div class="sku-pagination" *ngIf="totalPages() > 1">
30464
- <button
30465
- class="page-btn"
30466
- [disabled]="currentPage() <= 1"
30467
- (click)="goToPage(currentPage() - 1)"
30468
- >‹</button>
30469
- <div class="page-info">
30903
+ <!-- Data Search (Only if sheet selected) -->
30904
+ <div class="sku-search" *ngIf="selectedProductSheet()">
30905
+ <svg
30906
+ class="search-icon"
30907
+ width="14"
30908
+ height="14"
30909
+ viewBox="0 0 24 24"
30910
+ fill="none"
30911
+ stroke="currentColor"
30912
+ stroke-width="2"
30913
+ stroke-linecap="round"
30914
+ stroke-linejoin="round"
30915
+ >
30916
+ <circle cx="11" cy="11" r="8" />
30917
+ <line x1="21" y1="21" x2="16.65" y2="16.65" />
30918
+ </svg>
30470
30919
  <input
30471
- type="number"
30472
- class="page-input"
30473
- [value]="currentPage()"
30474
- (change)="onPageInputChange($event)"
30475
- (keydown.enter)="onPageInputChange($event)"
30476
- min="1"
30477
- [max]="totalPages()"
30920
+ type="text"
30921
+ class="search-input"
30922
+ [placeholder]="'TEMPLATE.SEARCH_PLACEHOLDER' | translate"
30923
+ [(ngModel)]="dataSearchTerm"
30924
+ (ngModelChange)="onDataSearchChange($event)"
30478
30925
  />
30479
- <span class="page-total">/ {{ totalPages() }}</span>
30480
30926
  </div>
30481
- <button
30482
- class="page-btn"
30483
- [disabled]="currentPage() >= totalPages()"
30484
- (click)="goToPage(currentPage() + 1)"
30485
- >›</button>
30927
+
30928
+ <!-- Data List -->
30929
+ <div
30930
+ class="productsheet-list"
30931
+ *ngIf="!isLoading() && selectedProductSheet()"
30932
+ >
30933
+ <div
30934
+ class="sku-card"
30935
+ *ngFor="let item of dataResults()"
30936
+ draggable="true"
30937
+ (dragstart)="onDragStart($event, item)"
30938
+ >
30939
+ <div class="sku-card-image">
30940
+ <div class="no-image">
30941
+ <svg
30942
+ width="20"
30943
+ height="20"
30944
+ viewBox="0 0 24 24"
30945
+ fill="none"
30946
+ stroke="currentColor"
30947
+ stroke-width="1.5"
30948
+ >
30949
+ <rect x="3" y="3" width="18" height="18" rx="2" />
30950
+ <circle cx="8.5" cy="8.5" r="1.5" />
30951
+ <path d="M21 15l-5-5L5 21" />
30952
+ </svg>
30953
+ </div>
30954
+ </div>
30955
+ <div class="sku-card-info">
30956
+ <span class="sku-card-name">{{ item.skuName }}</span>
30957
+ <span class="sku-card-code">{{ item.sku }}</span>
30958
+ </div>
30959
+ </div>
30960
+ </div>
30961
+
30962
+ <!-- Empty State -->
30963
+ <div
30964
+ class="sku-empty"
30965
+ *ngIf="
30966
+ !isLoading() &&
30967
+ selectedProductSheet() &&
30968
+ dataResults().length === 0
30969
+ "
30970
+ >
30971
+ {{ 'TEMPLATE.NO_PRODUCTS' | translate }}
30972
+ </div>
30973
+ </ng-container>
30974
+
30975
+ <!-- Loading -->
30976
+ <div class="sku-loading" *ngIf="isLoading()">
30977
+ <div class="spinner"></div>
30486
30978
  </div>
30487
30979
  </div>
30488
30980
  </app-collapsible-panel>
30489
- `, styles: [".sub-panel{display:flex;flex-direction:column;gap:10px;padding-bottom:10px}.label-text{font-size:var(--font-size-small, 12px);margin-bottom:4px;color:var(--gray-1, #80808e)}.buttons-six-columns{display:grid;grid-template-columns:repeat(2,1fr);column-gap:var(--spacing-xs)}.buttons-six-columns>*{display:grid;grid-template-columns:repeat(3,1fr)!important;column-gap:2px!important}.inputs-two-columns{display:grid;grid-template-columns:repeat(2,1fr);gap:var(--spacing-xs)}.inputs-three-columns{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--spacing-xs)}.panel-row{display:flex;flex-direction:column;gap:5px}app-drag-input,app-select-input,app-check-input,app-color-input,app-button-input{flex:1;min-width:0}\n", ".sku-panel{display:flex;flex-direction:column;gap:8px}.sku-search{position:relative;display:flex;align-items:center}.search-icon{position:absolute;left:8px;color:var(--gray-2);pointer-events:none}.search-input{width:100%;background:var(--gray-4);border:1px solid transparent;color:var(--white);padding:6px 8px 6px 28px;border-radius:var(--radius-s);font-size:12px;outline:none;box-sizing:border-box}.search-input:focus{border-color:var(--active)}.search-input::placeholder{color:var(--gray-2)}.sku-list{display:flex;flex-direction:column;gap:4px;max-height:340px;overflow-y:auto}.sku-list::-webkit-scrollbar{width:4px}.sku-list::-webkit-scrollbar-track{background:transparent}.sku-list::-webkit-scrollbar-thumb{background-color:var(--gray-2);border-radius:2px}.sku-card{display:flex;align-items:center;gap:8px;padding:4px 6px;background:var(--gray-4);border-radius:var(--radius-s);cursor:grab;border:1px solid transparent;transition:background .15s,border-color .15s}.sku-card:hover{background:var(--gray-3);border-color:var(--active)}.sku-card:active{cursor:grabbing}.sku-card-image{width:40px;height:40px;min-width:40px;border-radius:4px;overflow:hidden;background:var(--gray-5);display:flex;align-items:center;justify-content:center}.sku-card-image img{width:100%;height:100%;object-fit:contain}.no-image{color:var(--gray-2)}.sku-card-info{display:flex;flex-direction:column;min-width:0;gap:1px}.sku-card-name{font-size:12px;color:var(--white);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sku-card-code{font-size:10px;color:var(--gray-1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sku-loading{display:flex;justify-content:center;padding:20px 0}.spinner{width:20px;height:20px;border:2px solid var(--gray-3);border-top-color:var(--active);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.sku-empty{text-align:center;color:var(--gray-1);padding:16px 0;font-size:12px}.sku-pagination{display:flex;align-items:center;justify-content:center;gap:6px;padding-top:4px}.page-btn{background:var(--gray-4);color:var(--white);border:none;width:24px;height:24px;border-radius:var(--radius-s);cursor:pointer;font-size:14px;display:flex;align-items:center;justify-content:center;transition:background .2s}.page-btn:hover:not(:disabled){background:var(--gray-3)}.page-btn:disabled{opacity:.4;cursor:not-allowed}.page-info{display:flex;align-items:center;gap:3px}.page-input{width:32px;background:var(--gray-4);border:1px solid var(--gray-3);color:var(--white);text-align:center;padding:2px;border-radius:var(--radius-s);font-size:11px;outline:none;-moz-appearance:textfield}.page-input::-webkit-inner-spin-button,.page-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.page-input:focus{border-color:var(--active)}.page-total{font-size:11px;color:var(--gray-1)}\n"] }]
30981
+ `, styles: [".sub-panel{display:flex;flex-direction:column;gap:10px;padding-bottom:10px}.label-text{font-size:var(--font-size-small, 12px);margin-bottom:4px;color:var(--gray-1, #80808e)}.buttons-six-columns{display:grid;grid-template-columns:repeat(2,1fr);column-gap:var(--spacing-xs)}.buttons-six-columns>*{display:grid;grid-template-columns:repeat(3,1fr)!important;column-gap:2px!important}.inputs-two-columns{display:grid;grid-template-columns:repeat(2,1fr);gap:var(--spacing-xs)}.inputs-three-columns{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--spacing-xs)}.panel-row{display:flex;flex-direction:column;gap:5px}app-drag-input,app-select-input,app-check-input,app-color-input,app-button-input{flex:1;min-width:0}\n", ".sku-panel{display:flex;flex-direction:column;gap:8px}.sku-mode-toggle{display:flex;background:var(--gray-5);border-radius:var(--radius-m);padding:2px;gap:2px}.mode-btn{flex:1;background:transparent;border:none;color:var(--gray-2);font-size:11px;padding:6px;border-radius:var(--radius-s);cursor:pointer;transition:background .2s,color .2s}.mode-btn:hover{color:var(--white)}.mode-btn.active{background:var(--gray-3);color:var(--white);box-shadow:0 1px 3px #0003}.sku-data-selection{display:flex;flex-direction:column;gap:6px}.select-wrapper{position:relative;display:flex;align-items:center}.sku-select{width:100%;background:var(--gray-4);border:1px solid var(--gray-3);color:var(--white);padding:6px 24px 6px 8px;border-radius:var(--radius-s);font-size:11px;outline:none;cursor:pointer;appearance:none;transition:border-color .2s}.sku-select:focus{border-color:var(--active)}.select-icon{position:absolute;right:8px;color:var(--gray-2);pointer-events:none}.sku-search{position:relative;display:flex;align-items:center}.search-icon{position:absolute;left:8px;color:var(--gray-2);pointer-events:none}.search-input{width:100%;background:var(--gray-4);border:1px solid transparent;color:var(--white);padding:6px 8px 6px 28px;border-radius:var(--radius-s);font-size:12px;outline:none;box-sizing:border-box}.search-input:focus{border-color:var(--active)}.search-input::placeholder{color:var(--gray-2)}.sku-list{display:flex;flex-direction:column;gap:4px;max-height:310px;overflow-y:auto}.productsheet-list{display:flex;flex-direction:column;gap:4px;max-height:270px;overflow-y:auto}.sku-list::-webkit-scrollbar{width:4px}.sku-list::-webkit-scrollbar-track{background:transparent}.sku-list::-webkit-scrollbar-thumb{background-color:var(--gray-2);border-radius:2px}.productsheet-list::-webkit-scrollbar{width:4px}.productsheet-list::-webkit-scrollbar-track{background:transparent}.productsheet-list::-webkit-scrollbar-thumb{background-color:var(--gray-2);border-radius:2px}.sku-card{display:flex;align-items:center;gap:8px;padding:4px 6px;background:var(--gray-4);border-radius:var(--radius-s);cursor:grab;border:1px solid transparent;transition:background .15s,border-color .15s}.sku-card:hover{background:var(--gray-3);border-color:var(--active)}.sku-card:active{cursor:grabbing}.sku-card-image{width:40px;height:40px;min-width:40px;border-radius:4px;overflow:hidden;background:var(--gray-5);display:flex;align-items:center;justify-content:center}.sku-card-image img{width:100%;height:100%;object-fit:contain}.no-image{color:var(--gray-2)}.sku-card-info{display:flex;flex-direction:column;min-width:0;gap:1px}.sku-card-name{font-size:12px;color:var(--white);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sku-card-code{font-size:10px;color:var(--gray-1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sku-loading{display:flex;justify-content:center;padding:20px 0}.spinner{width:20px;height:20px;border:2px solid var(--gray-3);border-top-color:var(--active);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.sku-empty{text-align:center;color:var(--gray-1);padding:16px 0;font-size:12px}.sku-pagination{display:flex;align-items:center;justify-content:center;gap:6px;padding-top:4px}.page-btn{background:var(--gray-4);color:var(--white);border:none;width:24px;height:24px;border-radius:var(--radius-s);cursor:pointer;font-size:14px;display:flex;align-items:center;justify-content:center;transition:background .2s}.page-btn:hover:not(:disabled){background:var(--gray-3)}.page-btn:disabled{opacity:.4;cursor:not-allowed}.page-info{display:flex;align-items:center;gap:3px}.page-input{width:32px;background:var(--gray-4);border:1px solid var(--gray-3);color:var(--white);text-align:center;padding:2px;border-radius:var(--radius-s);font-size:11px;outline:none;-moz-appearance:textfield}.page-input::-webkit-inner-spin-button,.page-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.page-input:focus{border-color:var(--active)}.page-total{font-size:11px;color:var(--gray-1)}\n"] }]
30490
30982
  }], ctorParameters: () => [{ type: SkuService }, { type: i2$1.TranslateService }] });
30491
30983
 
30492
30984
  class PropertiesPanelComponent {
@@ -31398,37 +31890,40 @@ var en = {
31398
31890
  MESSAGE: 'SolidDesigner is not yet available on Safari.',
31399
31891
  SUGGESTION: 'Please use Chrome or Firefox for the best experience.',
31400
31892
  },
31401
- "TEMPLATE": {
31402
- "TITLE": 'Template',
31403
- "REFRESH": 'Refresh',
31404
- "TEMPLATE_ID": 'Template ID',
31405
- "TEMPLATE_ID_PLACEHOLDER": 'Template ID',
31406
- "GABARIT": 'Layout',
31407
- "SELECT_PRODUCT": 'Select a product',
31408
- "ASSOCIATED_PRODUCT": 'PRODUCT ASSOCIATED TO TEMPLATE',
31409
- "CHANGE_PRODUCT": 'Change product',
31410
- "SELECTED_PRODUCT": 'Selected product',
31411
- "PRODUCTS": 'Products',
31412
- "SEARCH_PLACEHOLDER": 'Search products...',
31413
- "NO_PRODUCTS": 'No products found',
31893
+ TEMPLATE: {
31894
+ TITLE: 'Template',
31895
+ REFRESH: 'Refresh',
31896
+ TEMPLATE_ID: 'Template ID',
31897
+ TEMPLATE_ID_PLACEHOLDER: 'Template ID',
31898
+ GABARIT: 'Layout',
31899
+ SELECT_PRODUCT: 'Select a product',
31900
+ ASSOCIATED_PRODUCT: 'PRODUCT ASSOCIATED TO TEMPLATE',
31901
+ CHANGE_PRODUCT: 'Change product',
31902
+ SELECTED_PRODUCT: 'Selected product',
31903
+ PRODUCTS: 'Products',
31904
+ DATA: 'Data',
31905
+ SELECT_DATA: 'Select data',
31906
+ SELECT_SHEET: 'Select sheet',
31907
+ SEARCH_PLACEHOLDER: 'Search products...',
31908
+ NO_PRODUCTS: 'No products found',
31909
+ },
31910
+ TOOLBAR: {
31911
+ PAN: 'Pan',
31912
+ SELECT: 'Select',
31913
+ IMAGE: 'Image',
31914
+ BARCODE: 'Barcode',
31915
+ QRCODE: 'QR Code',
31916
+ TEXT: 'Text',
31917
+ RECT: 'Rectangle',
31918
+ ELLIPSE: 'Ellipse',
31919
+ LINE: 'Line',
31920
+ SHAPES: 'Shapes',
31921
+ PRODUCT_TABLE: 'Product Table',
31922
+ VARIANTS_TABLE: 'Variants Table',
31923
+ PENCIL: 'Pencil',
31924
+ PEN: 'Pen',
31925
+ TEMPLATE: 'Template',
31414
31926
  },
31415
- "TOOLBAR": {
31416
- "PAN": "Pan",
31417
- "SELECT": "Select",
31418
- "IMAGE": "Image",
31419
- "BARCODE": "Barcode",
31420
- "QRCODE": "QR Code",
31421
- "TEXT": "Text",
31422
- "RECT": "Rectangle",
31423
- "ELLIPSE": "Ellipse",
31424
- "LINE": "Line",
31425
- "SHAPES": "Shapes",
31426
- "PRODUCT_TABLE": "Product Table",
31427
- "VARIANTS_TABLE": "Variants Table",
31428
- "PENCIL": "Pencil",
31429
- "PEN": "Pen",
31430
- "TEMPLATE": "Template"
31431
- }
31432
31927
  };
31433
31928
 
31434
31929
  var es = {
@@ -32734,6 +33229,9 @@ var fr = {
32734
33229
  "CHANGE_PRODUCT": "Changer produit",
32735
33230
  "SELECTED_PRODUCT": "Produit sélectionné",
32736
33231
  "PRODUCTS": "Produits",
33232
+ "DATA": "Données",
33233
+ "SELECT_DATA": "Choisir une donnée",
33234
+ "SELECT_SHEET": "Choisir une feuille",
32737
33235
  "SEARCH_PLACEHOLDER": "Rechercher des produits...",
32738
33236
  "NO_PRODUCTS": "Aucun produit trouvé"
32739
33237
  },
@@ -33917,7 +34415,7 @@ class PagesGlobalPanelComponent {
33917
34415
  // Data is now loaded reactively via effect() in constructor
33918
34416
  }
33919
34417
  openPageGridModal() {
33920
- import('./solidpepper-solidpepper-soliddesigner-page-grid-modal.component-BS0ULjJ5.mjs').then((m) => {
34418
+ import('./solidpepper-solidpepper-soliddesigner-page-grid-modal.component-C8Y12cqJ.mjs').then((m) => {
33921
34419
  this.modalService.open(m.PageGridModalComponent, {
33922
34420
  onPageSelect: (index) => this.goToPage(index),
33923
34421
  });
@@ -36998,7 +37496,7 @@ class ContextBarComponent {
36998
37496
  }
36999
37497
  async processAndSetImage(file, forceCompress = false) {
37000
37498
  try {
37001
- const { ImageUtils } = await import('./solidpepper-solidpepper-soliddesigner-image-utils-BOcydhPW.mjs');
37499
+ const { ImageUtils } = await import('./solidpepper-solidpepper-soliddesigner-image-utils-Bz7RX9oS.mjs');
37002
37500
  let compressedDataUrl;
37003
37501
  if (forceCompress || file.size > SETTINGS.MAX_IMAGE_SIZE_EXTERNAL) {
37004
37502
  compressedDataUrl = await ImageUtils.compressUntilSize(file, SETTINGS.MAX_IMAGE_SIZE_EXTERNAL / 1024);
@@ -38794,4 +39292,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
38794
39292
  */
38795
39293
 
38796
39294
  export { AppParamsService as A, ConfirmDeleteModalComponent as C, ModalService as M, PageContextMenuComponent as P, SolidLog as S, SaveService as a, AssetsService as b, AppComponent as c };
38797
- //# sourceMappingURL=solidpepper-solidpepper-soliddesigner-solidpepper-solidpepper-soliddesigner-BZqhlBcb.mjs.map
39295
+ //# sourceMappingURL=solidpepper-solidpepper-soliddesigner-solidpepper-solidpepper-soliddesigner-D6z75lLr.mjs.map