@vendure/admin-ui 2.0.2 → 2.0.4

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.
Files changed (139) hide show
  1. package/catalog/components/product-variant-list/product-variant-list-bulk-actions.d.ts +6 -0
  2. package/catalog/public_api.d.ts +1 -1
  3. package/core/common/base-detail.component.d.ts +1 -0
  4. package/core/common/component-registry-types.d.ts +2 -2
  5. package/core/common/generated-types.d.ts +13 -0
  6. package/core/common/version.d.ts +1 -1
  7. package/core/components/theme-switcher/theme-switcher.component.d.ts +1 -0
  8. package/core/data/definitions/product-definitions.d.ts +1 -0
  9. package/core/data/providers/product-data.service.d.ts +1 -0
  10. package/core/shared/components/data-table-filters/data-table-filters.component.d.ts +1 -0
  11. package/core/shared/components/dropdown/dropdown-menu.component.d.ts +2 -0
  12. package/core/shared/components/dropdown/dropdown.component.d.ts +1 -1
  13. package/core/shared/components/rich-text-editor/link-dialog/link-dialog.component.d.ts +1 -0
  14. package/core/shared/components/rich-text-editor/prosemirror/custom-nodes.d.ts +2 -1
  15. package/core/shared/components/rich-text-editor/prosemirror/prosemirror.service.d.ts +6 -0
  16. package/core/shared/dynamic-form-inputs/customer-group-form-input/customer-group-form-input.component.d.ts +5 -2
  17. package/core/shared/dynamic-form-inputs/product-multi-selector-form-input/product-multi-selector-form-input.component.d.ts +4 -2
  18. package/core/shared/dynamic-form-inputs/product-selector-form-input/product-selector-form-input.component.d.ts +8 -5
  19. package/core/shared/dynamic-form-inputs/relation-form-input/asset/relation-asset-input.component.d.ts +1 -4
  20. package/core/shared/dynamic-form-inputs/relation-form-input/customer/relation-customer-input.component.d.ts +0 -1
  21. package/core/shared/shared.module.d.ts +2 -1
  22. package/esm2022/catalog/catalog.module.mjs +5 -1
  23. package/esm2022/catalog/components/asset-list/asset-list.component.mjs +3 -3
  24. package/esm2022/catalog/components/assign-products-to-channel-dialog/assign-products-to-channel-dialog.component.mjs +11 -14
  25. package/esm2022/catalog/components/product-list/product-list.component.mjs +3 -3
  26. package/esm2022/catalog/components/product-options-editor/product-options-editor.component.mjs +1 -1
  27. package/esm2022/catalog/components/product-variant-detail/product-variant-detail.component.mjs +4 -5
  28. package/esm2022/catalog/components/product-variant-list/product-variant-list-bulk-actions.mjs +92 -0
  29. package/esm2022/catalog/components/product-variant-list/product-variant-list.component.mjs +5 -5
  30. package/esm2022/catalog/components/stock-location-detail/stock-location-detail.component.mjs +32 -33
  31. package/esm2022/catalog/public_api.mjs +2 -2
  32. package/esm2022/core/common/base-detail.component.mjs +3 -3
  33. package/esm2022/core/common/base-list.component.mjs +2 -2
  34. package/esm2022/core/common/component-registry-types.mjs +1 -1
  35. package/esm2022/core/common/generated-types.mjs +2 -1
  36. package/esm2022/core/common/title-setter.mjs +1 -1
  37. package/esm2022/core/common/version.mjs +2 -2
  38. package/esm2022/core/components/app-shell/app-shell.component.mjs +3 -3
  39. package/esm2022/core/components/base-nav/base-nav.component.mjs +1 -1
  40. package/esm2022/core/components/main-nav/main-nav.component.mjs +2 -2
  41. package/esm2022/core/components/theme-switcher/theme-switcher.component.mjs +15 -5
  42. package/esm2022/core/components/user-menu/user-menu.component.mjs +3 -3
  43. package/esm2022/core/data/definitions/product-definitions.mjs +9 -1
  44. package/esm2022/core/data/providers/interceptor.mjs +1 -1
  45. package/esm2022/core/data/providers/product-data.service.mjs +7 -2
  46. package/esm2022/core/data/utils/transform-relation-custom-field-inputs.mjs +2 -2
  47. package/esm2022/core/providers/bulk-action-registry/bulk-action-types.mjs +1 -1
  48. package/esm2022/core/providers/custom-field-component/custom-field-component.service.mjs +1 -1
  49. package/esm2022/core/providers/data-table/data-table-filter-collection.mjs +2 -2
  50. package/esm2022/core/providers/local-storage/local-storage.service.mjs +1 -1
  51. package/esm2022/core/providers/page/page.service.mjs +1 -1
  52. package/esm2022/core/shared/components/action-bar-items/action-bar-items.component.mjs +1 -1
  53. package/esm2022/core/shared/components/assign-to-channel-dialog/assign-to-channel-dialog.component.mjs +1 -1
  54. package/esm2022/core/shared/components/chip/chip.component.mjs +2 -2
  55. package/esm2022/core/shared/components/currency-code-selector/currency-code-selector.component.mjs +1 -1
  56. package/esm2022/core/shared/components/data-table/data-table.component.mjs +1 -1
  57. package/esm2022/core/shared/components/data-table-filters/data-table-filters.component.mjs +29 -15
  58. package/esm2022/core/shared/components/dropdown/dropdown-menu.component.mjs +65 -24
  59. package/esm2022/core/shared/components/dropdown/dropdown.component.mjs +1 -1
  60. package/esm2022/core/shared/components/facet-value-selector/facet-value-selector.component.mjs +3 -3
  61. package/esm2022/core/shared/components/language-code-selector/language-code-selector.component.mjs +1 -1
  62. package/esm2022/core/shared/components/rich-text-editor/link-dialog/link-dialog.component.mjs +7 -6
  63. package/esm2022/core/shared/components/rich-text-editor/prosemirror/custom-nodes.mjs +43 -3
  64. package/esm2022/core/shared/components/rich-text-editor/prosemirror/prosemirror.service.mjs +18 -5
  65. package/esm2022/core/shared/components/rich-text-editor/rich-text-editor.component.mjs +2 -2
  66. package/esm2022/core/shared/components/tabbed-custom-fields/tabbed-custom-fields.component.mjs +3 -1
  67. package/esm2022/core/shared/dynamic-form-inputs/customer-group-form-input/customer-group-form-input.component.mjs +7 -4
  68. package/esm2022/core/shared/dynamic-form-inputs/dynamic-form-input/dynamic-form-input.component.mjs +9 -8
  69. package/esm2022/core/shared/dynamic-form-inputs/product-multi-selector-form-input/product-multi-selector-form-input.component.mjs +3 -2
  70. package/esm2022/core/shared/dynamic-form-inputs/product-selector-form-input/product-selector-form-input.component.mjs +10 -5
  71. package/esm2022/core/shared/dynamic-form-inputs/register-dynamic-input-components.mjs +1 -1
  72. package/esm2022/core/shared/dynamic-form-inputs/relation-form-input/asset/relation-asset-input.component.mjs +14 -15
  73. package/esm2022/core/shared/dynamic-form-inputs/relation-form-input/customer/relation-customer-input.component.mjs +1 -3
  74. package/esm2022/core/shared/dynamic-form-inputs/relation-form-input/product/relation-product-input.component.mjs +3 -3
  75. package/esm2022/core/shared/dynamic-form-inputs/relation-form-input/product-variant/relation-product-variant-input.component.mjs +3 -3
  76. package/esm2022/core/shared/dynamic-form-inputs/relation-form-input/relation-card/relation-card.component.mjs +3 -3
  77. package/esm2022/core/shared/dynamic-form-inputs/relation-form-input/relation-form-input.component.mjs +2 -2
  78. package/esm2022/core/shared/pipes/state-i18n-token.pipe.mjs +1 -1
  79. package/esm2022/core/shared/shared.module.mjs +9 -4
  80. package/esm2022/customer/components/customer-detail/customer-detail.component.mjs +32 -46
  81. package/esm2022/customer/components/customer-list/customer-list.component.mjs +24 -24
  82. package/esm2022/customer/customer.module.mjs +9 -2
  83. package/esm2022/customer/customer.routes.mjs +1 -1
  84. package/esm2022/dashboard/components/dashboard/dashboard.component.mjs +1 -1
  85. package/esm2022/dashboard/default-widgets.mjs +2 -1
  86. package/esm2022/dashboard/widgets/order-chart-widget/order-chart-widget.component.mjs +12 -12
  87. package/esm2022/login/components/login/login.component.mjs +3 -3
  88. package/esm2022/marketing/marketing.module.mjs +1 -1
  89. package/esm2022/order/components/order-detail/order-detail.component.mjs +8 -8
  90. package/esm2022/order/components/order-list/order-list.component.mjs +9 -2
  91. package/esm2022/order/components/order-table/order-table.component.mjs +3 -3
  92. package/esm2022/order/components/select-customer-dialog/select-customer-dialog.component.mjs +3 -3
  93. package/esm2022/order/order.module.mjs +1 -1
  94. package/esm2022/order/order.routes.mjs +1 -1
  95. package/esm2022/settings/components/shipping-method-detail/shipping-method-detail.component.mjs +3 -3
  96. package/esm2022/settings/components/tax-rate-detail/tax-rate-detail.component.mjs +8 -8
  97. package/esm2022/settings/settings.module.mjs +1 -1
  98. package/fesm2022/vendure-admin-ui-catalog.mjs +140 -107
  99. package/fesm2022/vendure-admin-ui-catalog.mjs.map +1 -1
  100. package/fesm2022/vendure-admin-ui-core.mjs +244 -98
  101. package/fesm2022/vendure-admin-ui-core.mjs.map +1 -1
  102. package/fesm2022/vendure-admin-ui-customer.mjs +61 -68
  103. package/fesm2022/vendure-admin-ui-customer.mjs.map +1 -1
  104. package/fesm2022/vendure-admin-ui-dashboard.mjs +12 -11
  105. package/fesm2022/vendure-admin-ui-dashboard.mjs.map +1 -1
  106. package/fesm2022/vendure-admin-ui-login.mjs +2 -2
  107. package/fesm2022/vendure-admin-ui-login.mjs.map +1 -1
  108. package/fesm2022/vendure-admin-ui-marketing.mjs.map +1 -1
  109. package/fesm2022/vendure-admin-ui-order.mjs +19 -12
  110. package/fesm2022/vendure-admin-ui-order.mjs.map +1 -1
  111. package/fesm2022/vendure-admin-ui-settings.mjs +9 -9
  112. package/fesm2022/vendure-admin-ui-settings.mjs.map +1 -1
  113. package/package.json +9 -9
  114. package/static/assets/logo-login.webp +0 -0
  115. package/static/assets/logo-top.webp +0 -0
  116. package/static/i18n-messages/cs.json +773 -770
  117. package/static/i18n-messages/de.json +773 -770
  118. package/static/i18n-messages/en.json +774 -771
  119. package/static/i18n-messages/es.json +773 -770
  120. package/static/i18n-messages/fr.json +773 -770
  121. package/static/i18n-messages/it.json +773 -770
  122. package/static/i18n-messages/pl.json +773 -770
  123. package/static/i18n-messages/pt_BR.json +773 -770
  124. package/static/i18n-messages/pt_PT.json +773 -770
  125. package/static/i18n-messages/ru.json +773 -770
  126. package/static/i18n-messages/uk.json +773 -770
  127. package/static/i18n-messages/zh_Hans.json +773 -770
  128. package/static/i18n-messages/zh_Hant.json +773 -770
  129. package/static/styles/global/_buttons.scss +63 -49
  130. package/static/styles/global/_forms.scss +5 -1
  131. package/static/styles/global/_overrides.scss +0 -6
  132. package/static/styles/theme/default.scss +2 -0
  133. package/static/theme.min.css +1 -1
  134. package/catalog/components/product-variant-list/product-list-bulk-actions.d.ts +0 -3
  135. package/esm2022/catalog/components/product-variant-list/product-list-bulk-actions.mjs +0 -55
  136. package/static/assets/logo-300px.png +0 -0
  137. package/static/assets/logo-75px.png +0 -0
  138. package/static/assets/logo.svg +0 -11
  139. package/static/assets/logo.webp +0 -0
@@ -5,7 +5,7 @@ import { map, startWith, distinctUntilChanged, debounceTime, tap, takeUntil, swi
5
5
  import * as i1 from '@vendure/admin-ui/core';
6
6
  import { SelectionManager, HistoryEntryType, CUSTOMER_FRAGMENT, TypedBaseDetailComponent, SortOrder, EditNoteDialogComponent, CustomerDetailQueryDocument, createBulkDeleteAction, Permission, CUSTOMER_GROUP_FRAGMENT, TypedBaseListComponent, GetCustomerGroupListDocument, ModalService, DataService, NotificationService, CustomerListQueryDocument, LogicalOperator, PageComponent, detailBreadcrumb, detailComponentWithResolver, GetCustomerGroupDetailDocument, SharedModule, PageService } from '@vendure/admin-ui/core';
7
7
  import * as i1$1 from '@angular/forms';
8
- import { FormControl, Validators, UntypedFormArray, UntypedFormControl } from '@angular/forms';
8
+ import { FormControl, Validators, UntypedFormArray } from '@angular/forms';
9
9
  import * as i2 from '@angular/router';
10
10
  import { ROUTES, RouterModule } from '@angular/router';
11
11
  import * as i3 from '@clr/angular';
@@ -412,32 +412,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.3", ngImpor
412
412
  type: Output
413
413
  }] } });
414
414
 
415
- const CUSTOMER_DETAIL_QUERY = gql `
416
- query CustomerDetailQuery($id: ID!, $orderListOptions: OrderListOptions) {
417
- customer(id: $id) {
418
- ...Customer
419
- groups {
420
- id
421
- name
422
- }
423
- orders(options: $orderListOptions) {
424
- items {
425
- id
426
- code
427
- type
428
- state
429
- total
430
- totalWithTax
431
- currencyCode
432
- createdAt
433
- updatedAt
434
- orderPlacedAt
435
- }
436
- totalItems
437
- }
438
- }
439
- }
440
- ${CUSTOMER_FRAGMENT}
415
+ const CUSTOMER_DETAIL_QUERY = gql `
416
+ query CustomerDetailQuery($id: ID!, $orderListOptions: OrderListOptions) {
417
+ customer(id: $id) {
418
+ ...Customer
419
+ groups {
420
+ id
421
+ name
422
+ }
423
+ orders(options: $orderListOptions) {
424
+ items {
425
+ id
426
+ code
427
+ type
428
+ state
429
+ total
430
+ totalWithTax
431
+ currencyCode
432
+ createdAt
433
+ updatedAt
434
+ orderPlacedAt
435
+ }
436
+ totalItems
437
+ }
438
+ }
439
+ }
440
+ ${CUSTOMER_FRAGMENT}
441
441
  `;
442
442
  class CustomerDetailComponent extends TypedBaseDetailComponent {
443
443
  constructor(changeDetector, formBuilder, dataService, modalService, notificationService) {
@@ -525,13 +525,6 @@ class CustomerDetailComponent extends TypedBaseDetailComponent {
525
525
  defaultBillingAddress: false,
526
526
  customFields: this.formBuilder.group(this.addressCustomFields.reduce((hash, field) => ({ ...hash, [field.name]: '' }), {})),
527
527
  });
528
- // if (this.addressCustomFields.length) {
529
- // const customFieldsGroup = this.formBuilder.group({});
530
- // for (const fieldDef of this.addressCustomFields) {
531
- // customFieldsGroup.addControl(fieldDef.name, new UntypedFormControl(''));
532
- // }
533
- // newAddress.addControl('customFields', customFieldsGroup);
534
- // }
535
528
  addressFormArray.push(newAddress);
536
529
  }
537
530
  setOrderItemsPerPage(itemsPerPage) {
@@ -791,7 +784,10 @@ class CustomerDetailComponent extends TypedBaseDetailComponent {
791
784
  const addressGroup = this.formBuilder.group({
792
785
  ...rest,
793
786
  countryCode: address.country.code,
794
- customFields: this.formBuilder.group(this.addressCustomFields.reduce((hash, field) => ({ ...hash, [field.name]: '' }), {})),
787
+ customFields: this.formBuilder.group(this.addressCustomFields.reduce((hash, field) => ({
788
+ ...hash,
789
+ [field.name]: address['customFields'][field.name],
790
+ }), {})),
795
791
  });
796
792
  addressesArray.push(addressGroup);
797
793
  if (address.defaultShippingAddress) {
@@ -800,16 +796,6 @@ class CustomerDetailComponent extends TypedBaseDetailComponent {
800
796
  if (address.defaultBillingAddress) {
801
797
  this.defaultBillingAddressId = address.id;
802
798
  }
803
- if (this.addressCustomFields.length) {
804
- const customFieldsGroup = this.formBuilder.group({});
805
- for (const fieldDef of this.addressCustomFields) {
806
- const key = fieldDef.name;
807
- const value = address.customFields?.[key];
808
- const control = new UntypedFormControl(value);
809
- customFieldsGroup.addControl(key, control);
810
- }
811
- addressGroup.addControl('customFields', customFieldsGroup);
812
- }
813
799
  }
814
800
  this.detailForm.setControl('addresses', addressesArray);
815
801
  }
@@ -1138,29 +1124,29 @@ const deleteCustomersBulkAction = createBulkDeleteAction({
1138
1124
  bulkDelete: (dataService, ids) => dataService.customer.deleteCustomers(ids).pipe(map(res => res.deleteCustomers)),
1139
1125
  });
1140
1126
 
1141
- const CUSTOMER_LIST_QUERY = gql `
1142
- query CustomerListQuery($options: CustomerListOptions) {
1143
- customers(options: $options) {
1144
- items {
1145
- ...CustomerListItem
1146
- }
1147
- totalItems
1148
- }
1149
- }
1150
-
1151
- fragment CustomerListItem on Customer {
1152
- id
1153
- createdAt
1154
- updatedAt
1155
- title
1156
- firstName
1157
- lastName
1158
- emailAddress
1159
- user {
1160
- id
1161
- verified
1162
- }
1163
- }
1127
+ const CUSTOMER_LIST_QUERY = gql `
1128
+ query CustomerListQuery($options: CustomerListOptions) {
1129
+ customers(options: $options) {
1130
+ items {
1131
+ ...CustomerListItem
1132
+ }
1133
+ totalItems
1134
+ }
1135
+ }
1136
+
1137
+ fragment CustomerListItem on Customer {
1138
+ id
1139
+ createdAt
1140
+ updatedAt
1141
+ title
1142
+ firstName
1143
+ lastName
1144
+ emailAddress
1145
+ user {
1146
+ id
1147
+ verified
1148
+ }
1149
+ }
1164
1150
  `;
1165
1151
  class CustomerListComponent extends TypedBaseListComponent {
1166
1152
  constructor() {
@@ -1301,6 +1287,13 @@ class CustomerModule {
1301
1287
  component: CustomerDetailComponent,
1302
1288
  query: CustomerDetailQueryDocument,
1303
1289
  entityKey: 'customer',
1290
+ variables: {
1291
+ orderListOptions: {
1292
+ sort: {
1293
+ orderPlacedAt: SortOrder.DESC,
1294
+ },
1295
+ },
1296
+ },
1304
1297
  getBreadcrumbs: entity => [
1305
1298
  {
1306
1299
  label: entity