@foxy.io/elements 1.32.0-beta.1 → 1.32.0-beta.3

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 (223) hide show
  1. package/dist/cdn/foxy-access-recovery-form.js +1 -1
  2. package/dist/cdn/foxy-address-card.js +1 -1
  3. package/dist/cdn/foxy-address-form.js +1 -1
  4. package/dist/cdn/foxy-admin-subscription-card.js +1 -1
  5. package/dist/cdn/foxy-admin-subscription-form.js +1 -1
  6. package/dist/cdn/foxy-api-browser.js +1 -1
  7. package/dist/cdn/foxy-applied-coupon-code-card.js +1 -1
  8. package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
  9. package/dist/cdn/foxy-applied-tax-card.js +1 -1
  10. package/dist/cdn/foxy-attribute-card.js +1 -1
  11. package/dist/cdn/foxy-attribute-form.js +1 -1
  12. package/dist/cdn/foxy-billing-address-card.js +1 -1
  13. package/dist/cdn/foxy-cancellation-form.js +1 -1
  14. package/dist/cdn/foxy-cart-card.js +1 -1
  15. package/dist/cdn/foxy-cart-form.js +2 -2
  16. package/dist/cdn/foxy-client-card.js +1 -1
  17. package/dist/cdn/foxy-client-form.js +1 -1
  18. package/dist/cdn/foxy-collection-page.js +1 -1
  19. package/dist/cdn/foxy-collection-pages.js +1 -1
  20. package/dist/cdn/foxy-copy-to-clipboard.js +1 -1
  21. package/dist/cdn/foxy-coupon-card.js +1 -1
  22. package/dist/cdn/foxy-coupon-code-card.js +1 -1
  23. package/dist/cdn/foxy-coupon-code-form.js +1 -1
  24. package/dist/cdn/foxy-coupon-codes-form.js +1 -1
  25. package/dist/cdn/foxy-coupon-detail-card.js +1 -1
  26. package/dist/cdn/foxy-coupon-form.js +1 -1
  27. package/dist/cdn/foxy-custom-field-card.js +1 -1
  28. package/dist/cdn/foxy-custom-field-form.js +1 -1
  29. package/dist/cdn/foxy-customer-card.js +1 -1
  30. package/dist/cdn/foxy-customer-form.js +1 -1
  31. package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
  32. package/dist/cdn/foxy-customer-portal-settings.js +1 -1
  33. package/dist/cdn/foxy-customer-portal.js +1 -1
  34. package/dist/cdn/foxy-customer.js +1 -1
  35. package/dist/cdn/foxy-customers-table.js +1 -1
  36. package/dist/cdn/foxy-discount-builder.js +1 -1
  37. package/dist/cdn/foxy-discount-card.js +1 -1
  38. package/dist/cdn/foxy-discount-detail-card.js +1 -1
  39. package/dist/cdn/foxy-donation.js +1 -1
  40. package/dist/cdn/foxy-downloadable-card.js +1 -1
  41. package/dist/cdn/foxy-downloadable-form.js +1 -1
  42. package/dist/cdn/foxy-email-template-card.js +1 -1
  43. package/dist/cdn/foxy-email-template-form.js +1 -1
  44. package/dist/cdn/foxy-error-entry-card.js +1 -1
  45. package/dist/cdn/foxy-filter-attribute-card.js +1 -1
  46. package/dist/cdn/foxy-filter-attribute-form.js +1 -1
  47. package/dist/cdn/foxy-form-dialog.js +1 -1
  48. package/dist/cdn/foxy-generate-codes-form.js +1 -1
  49. package/dist/cdn/foxy-gift-card-card.js +1 -1
  50. package/dist/cdn/foxy-gift-card-code-card.js +1 -1
  51. package/dist/cdn/foxy-gift-card-code-form.js +1 -1
  52. package/dist/cdn/foxy-gift-card-code-log-card.js +1 -1
  53. package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
  54. package/dist/cdn/foxy-gift-card-form.js +1 -1
  55. package/dist/cdn/foxy-i18n-editor.js +1 -1
  56. package/dist/cdn/foxy-i18n.js +1 -1
  57. package/dist/cdn/foxy-integration-card.js +1 -1
  58. package/dist/cdn/foxy-integration-form.js +1 -1
  59. package/dist/cdn/foxy-item-card.js +1 -1
  60. package/dist/cdn/foxy-item-category-card.js +1 -1
  61. package/dist/cdn/foxy-item-category-form.js +1 -1
  62. package/dist/cdn/foxy-item-form.js +1 -1
  63. package/dist/cdn/foxy-item-option-card.js +1 -1
  64. package/dist/cdn/foxy-item-option-form.js +1 -1
  65. package/dist/cdn/foxy-items-form.js +1 -1
  66. package/dist/cdn/foxy-native-integration-card.js +1 -1
  67. package/dist/cdn/foxy-native-integration-form.js +1 -1
  68. package/dist/cdn/foxy-pagination.js +1 -1
  69. package/dist/cdn/foxy-passkey-card.js +1 -1
  70. package/dist/cdn/foxy-passkey-form.js +1 -1
  71. package/dist/cdn/foxy-payment-card-embed.js +1 -1
  72. package/dist/cdn/foxy-payment-card.js +1 -1
  73. package/dist/cdn/foxy-payment-method-card.js +1 -1
  74. package/dist/cdn/foxy-payments-api-fraud-protection-card.js +1 -1
  75. package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
  76. package/dist/cdn/foxy-payments-api-payment-method-card.js +1 -1
  77. package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
  78. package/dist/cdn/foxy-payments-api-payment-preset-card.js +1 -1
  79. package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
  80. package/dist/cdn/foxy-query-builder.js +1 -64
  81. package/dist/cdn/foxy-report-form.js +1 -1
  82. package/dist/cdn/foxy-reports-table.js +1 -1
  83. package/dist/cdn/foxy-shipment-card.js +1 -1
  84. package/dist/cdn/foxy-shipping-container-card.js +1 -1
  85. package/dist/cdn/foxy-shipping-drop-type-card.js +1 -1
  86. package/dist/cdn/foxy-shipping-method-card.js +1 -1
  87. package/dist/cdn/foxy-shipping-service-card.js +1 -1
  88. package/dist/cdn/foxy-sign-in-form.js +1 -1
  89. package/dist/cdn/foxy-spinner.js +2 -2
  90. package/dist/cdn/foxy-store-card.js +1 -1
  91. package/dist/cdn/foxy-store-form.js +1 -1
  92. package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
  93. package/dist/cdn/foxy-subscription-card.js +1 -1
  94. package/dist/cdn/foxy-subscription-form.js +1 -1
  95. package/dist/cdn/foxy-subscription-settings-form.js +1 -1
  96. package/dist/cdn/foxy-subscriptions-table.js +1 -1
  97. package/dist/cdn/foxy-table.js +1 -1
  98. package/dist/cdn/foxy-tax-card.js +1 -1
  99. package/dist/cdn/foxy-tax-form.js +1 -1
  100. package/dist/cdn/foxy-template-config-form.js +1 -1
  101. package/dist/cdn/foxy-template-form.js +1 -1
  102. package/dist/cdn/foxy-template-set-card.js +1 -1
  103. package/dist/cdn/foxy-template-set-form.js +1 -1
  104. package/dist/cdn/foxy-transaction-card.js +1 -1
  105. package/dist/cdn/foxy-transaction.js +1 -1
  106. package/dist/cdn/foxy-transactions-table.js +7 -7
  107. package/dist/cdn/foxy-update-payment-method-form.js +1 -1
  108. package/dist/cdn/foxy-user-card.js +1 -1
  109. package/dist/cdn/foxy-user-form.js +1 -1
  110. package/dist/cdn/foxy-user-invitation-card.js +1 -1
  111. package/dist/cdn/foxy-user-invitation-form.js +1 -1
  112. package/dist/cdn/foxy-users-table.js +1 -1
  113. package/dist/cdn/foxy-webhook-card.js +1 -1
  114. package/dist/cdn/foxy-webhook-form.js +1 -1
  115. package/dist/cdn/foxy-webhook-log-card.js +1 -1
  116. package/dist/cdn/foxy-webhook-status-card.js +1 -1
  117. package/dist/cdn/{shared-8fc527b7.js → shared-011d6240.js} +1 -1
  118. package/dist/cdn/{shared-c98881c7.js → shared-045bd59c.js} +1 -1
  119. package/dist/cdn/{shared-e709057b.js → shared-08c637a9.js} +1 -1
  120. package/dist/cdn/{shared-f893763a.js → shared-08e42e78.js} +1 -1
  121. package/dist/cdn/{shared-6f0504e2.js → shared-0a24f318.js} +1 -1
  122. package/dist/cdn/{shared-f67f6fc5.js → shared-0e44bfff.js} +1 -1
  123. package/dist/cdn/{shared-d3044c4c.js → shared-0f261023.js} +1 -1
  124. package/dist/cdn/{shared-9092b5db.js → shared-1c169878.js} +1 -1
  125. package/dist/cdn/{shared-9e360643.js → shared-1cd2db2d.js} +1 -1
  126. package/dist/cdn/{shared-f998f9c8.js → shared-1cfea4b6.js} +1 -1
  127. package/dist/cdn/{shared-11694c05.js → shared-24c7c37f.js} +1 -1
  128. package/dist/cdn/{shared-374e6faa.js → shared-25324930.js} +1 -1
  129. package/dist/cdn/{shared-c508d5dc.js → shared-26425c01.js} +1 -1
  130. package/dist/cdn/{shared-6b8c2a83.js → shared-30b4c05b.js} +1 -1
  131. package/dist/cdn/{shared-c5647b62.js → shared-3491d10e.js} +1 -1
  132. package/dist/cdn/{shared-40af05b3.js → shared-34c84b9f.js} +1 -1
  133. package/dist/cdn/{shared-74eedbe6.js → shared-37cf92bd.js} +1 -1
  134. package/dist/cdn/{shared-aaf72aad.js → shared-3a066450.js} +1 -1
  135. package/dist/cdn/{shared-185dffc3.js → shared-45bef1ac.js} +1 -1
  136. package/dist/cdn/{shared-8a3fd383.js → shared-45ecb912.js} +1 -1
  137. package/dist/cdn/{shared-ca0847b0.js → shared-4a86d1ca.js} +1 -1
  138. package/dist/cdn/{shared-adcfd50a.js → shared-4d543043.js} +1 -1
  139. package/dist/cdn/{shared-c4f15ea3.js → shared-4e1b5fa3.js} +1 -1
  140. package/dist/cdn/{shared-b726120d.js → shared-4efc6bb8.js} +1 -1
  141. package/dist/cdn/{shared-acd33590.js → shared-51bb937b.js} +1 -1
  142. package/dist/cdn/{shared-1a30f25e.js → shared-537d2efe.js} +1 -1
  143. package/dist/cdn/{shared-f8368b97.js → shared-55bc51c8.js} +1 -1
  144. package/dist/cdn/{shared-2bc0d0cd.js → shared-56d1eae5.js} +1 -1
  145. package/dist/cdn/{shared-c9346893.js → shared-57cc81b4.js} +1 -1
  146. package/dist/cdn/{shared-f5547471.js → shared-5ff1affd.js} +1 -1
  147. package/dist/cdn/shared-620dccaa.js +1 -0
  148. package/dist/cdn/{shared-4903b2e3.js → shared-64d9ac2a.js} +1 -1
  149. package/dist/cdn/shared-73c1d31e.js +1 -0
  150. package/dist/cdn/{shared-df51ee50.js → shared-783f6e58.js} +1 -1
  151. package/dist/cdn/{shared-193bb806.js → shared-787e52c4.js} +1 -1
  152. package/dist/cdn/{shared-5c35d93a.js → shared-838cc86b.js} +1 -1
  153. package/dist/cdn/{shared-92192fe1.js → shared-85989cf3.js} +1 -1
  154. package/dist/cdn/{shared-65479601.js → shared-8a8bfd72.js} +1 -1
  155. package/dist/cdn/{shared-7c15c149.js → shared-8b9ae780.js} +1 -1
  156. package/dist/cdn/{shared-482ba043.js → shared-8f3fdf8b.js} +5 -5
  157. package/dist/cdn/{shared-9a59aab2.js → shared-906fe068.js} +1 -1
  158. package/dist/cdn/{shared-15100be0.js → shared-91560256.js} +1 -1
  159. package/dist/cdn/{shared-2e090291.js → shared-9411a937.js} +1 -1
  160. package/dist/cdn/{shared-d4a1658e.js → shared-978aaaf2.js} +1 -1
  161. package/dist/cdn/shared-97e1f413.js +1 -0
  162. package/dist/cdn/{shared-97cfdcdb.js → shared-9de0a899.js} +1 -1
  163. package/dist/cdn/{shared-8b5e05df.js → shared-9e94c56d.js} +1 -1
  164. package/dist/cdn/{shared-19df2a73.js → shared-9ef03974.js} +1 -1
  165. package/dist/cdn/{shared-bc023a29.js → shared-a4b0ccf4.js} +1 -1
  166. package/dist/cdn/{shared-8a73d1aa.js → shared-ac6e1790.js} +1 -1
  167. package/dist/cdn/{shared-60209b2d.js → shared-b6ab5711.js} +1 -1
  168. package/dist/cdn/{shared-745f340a.js → shared-b74187e9.js} +1 -1
  169. package/dist/cdn/{shared-c538157f.js → shared-be093279.js} +1 -1
  170. package/dist/cdn/{shared-86a9b27a.js → shared-c40a4b0c.js} +1 -1
  171. package/dist/cdn/{shared-5c846a3b.js → shared-c6b69d4e.js} +1 -1
  172. package/dist/cdn/{shared-8da3186f.js → shared-c7ffb9f2.js} +2 -2
  173. package/dist/cdn/{shared-28ebee50.js → shared-c89f7ad5.js} +1 -1
  174. package/dist/cdn/{shared-239062b0.js → shared-c9f3f8d3.js} +1 -1
  175. package/dist/cdn/{shared-addddf0e.js → shared-d713c00f.js} +1 -1
  176. package/dist/cdn/{shared-562d466d.js → shared-d8cd61ed.js} +1 -1
  177. package/dist/cdn/{shared-7ceceb4c.js → shared-de45ad84.js} +1 -1
  178. package/dist/cdn/{shared-5513e830.js → shared-e1850e5f.js} +1 -1
  179. package/dist/cdn/{shared-6e1b5baf.js → shared-e3647540.js} +1 -1
  180. package/dist/cdn/{shared-9d309e97.js → shared-ed9c9bab.js} +1 -1
  181. package/dist/cdn/{shared-dfe41029.js → shared-eff5dcb0.js} +1 -1
  182. package/dist/cdn/{shared-913e1955.js → shared-f0d70be1.js} +1 -1
  183. package/dist/cdn/shared-f1b29592.js +64 -0
  184. package/dist/cdn/{shared-91d8985f.js → shared-f97ed2ff.js} +1 -1
  185. package/dist/cdn/translations/cart-form/en.json +79 -68
  186. package/dist/cdn/translations/coupon-form/en.json +8 -52
  187. package/dist/elements/internal/InternalArrayMapControl/InternalArrayMapControl.d.ts +12 -0
  188. package/dist/elements/internal/InternalArrayMapControl/InternalArrayMapControl.js +277 -0
  189. package/dist/elements/internal/InternalArrayMapControl/InternalArrayMapControl.js.map +1 -0
  190. package/dist/elements/internal/InternalArrayMapControl/index.d.ts +4 -0
  191. package/dist/elements/internal/InternalArrayMapControl/index.js +6 -0
  192. package/dist/elements/internal/InternalArrayMapControl/index.js.map +1 -0
  193. package/dist/elements/internal/InternalResourcePickerControl/InternalResourcePickerControl.d.ts +3 -0
  194. package/dist/elements/internal/InternalResourcePickerControl/InternalResourcePickerControl.js +51 -16
  195. package/dist/elements/internal/InternalResourcePickerControl/InternalResourcePickerControl.js.map +1 -1
  196. package/dist/elements/internal/InternalResourcePickerControl/index.d.ts +2 -0
  197. package/dist/elements/internal/InternalResourcePickerControl/index.js +2 -0
  198. package/dist/elements/internal/InternalResourcePickerControl/index.js.map +1 -1
  199. package/dist/elements/public/CartForm/CartForm.d.ts +2 -0
  200. package/dist/elements/public/CartForm/CartForm.js +15 -11
  201. package/dist/elements/public/CartForm/CartForm.js.map +1 -1
  202. package/dist/elements/public/CopyToClipboard/CopyToClipboard.d.ts +7 -1
  203. package/dist/elements/public/CopyToClipboard/CopyToClipboard.js +60 -30
  204. package/dist/elements/public/CopyToClipboard/CopyToClipboard.js.map +1 -1
  205. package/dist/elements/public/CouponForm/CouponForm.d.ts +2 -3
  206. package/dist/elements/public/CouponForm/CouponForm.js +51 -25
  207. package/dist/elements/public/CouponForm/CouponForm.js.map +1 -1
  208. package/dist/elements/public/CouponForm/index.d.ts +1 -0
  209. package/dist/elements/public/CouponForm/index.js +1 -0
  210. package/dist/elements/public/CouponForm/index.js.map +1 -1
  211. package/dist/elements/public/QueryBuilder/utils/parse.js +3 -1
  212. package/dist/elements/public/QueryBuilder/utils/parse.js.map +1 -1
  213. package/dist/elements/public/QueryBuilder/utils/stringify.js +10 -3
  214. package/dist/elements/public/QueryBuilder/utils/stringify.js.map +1 -1
  215. package/dist/elements/public/Transaction/index.d.ts +1 -0
  216. package/dist/elements/public/Transaction/index.js +1 -0
  217. package/dist/elements/public/Transaction/index.js.map +1 -1
  218. package/dist/mixins/themeable.js +4 -0
  219. package/dist/mixins/themeable.js.map +1 -1
  220. package/package.json +1 -1
  221. package/dist/cdn/shared-492da078.js +0 -1
  222. package/dist/cdn/shared-5e09e162.js +0 -1
  223. package/dist/cdn/shared-7275324b.js +0 -1
@@ -0,0 +1,277 @@
1
+ import { InternalEditableControl } from "../InternalEditableControl/InternalEditableControl.js";
2
+ import { ResponsiveMixin } from "../../../mixins/responsive.js";
3
+ import { css, html, svg } from 'lit-element';
4
+ import { classMap } from "../../../utils/class-map.js";
5
+ import { repeat } from 'lit-html/directives/repeat';
6
+ class InternalArrayMapControl extends ResponsiveMixin(InternalEditableControl) {
7
+ static get styles() {
8
+ return [
9
+ super.styles,
10
+ css `.gap-1px{
11
+ gap:1px;
12
+ }
13
+
14
+ .grid-vertical{
15
+ grid-template:auto / var(--lumo-size-m) 1fr;
16
+ }
17
+
18
+ :host([sm]) .sm-grid-horizontal{
19
+ grid-template:auto / var(--lumo-size-m) 1fr var(--lumo-size-m) 1fr;
20
+ }
21
+ `,
22
+ ];
23
+ }
24
+ renderControl() {
25
+ const divider = html `
26
+ <div class="flex items-center h-s">
27
+ <div class="w-m text-center leading-none uppercase font-medium text-xs text-contrast-20">
28
+ <foxy-i18n infer="" key="or"></foxy-i18n>
29
+ </div>
30
+
31
+ <div class="flex-1 border-t border-contrast-10"></div>
32
+ <div class="w-m ml-s flex-shrink-0"></div>
33
+ </div>
34
+ `;
35
+ return html `
36
+ <div class="mb-s" ?hidden=${!this.label && !this.helperText}>
37
+ <p class="font-medium text-body text-l" ?hidden=${!this.label}>${this.label}</p>
38
+ <p class="text-s text-secondary" ?hidden=${!this.helperText}>${this.helperText}</p>
39
+ </div>
40
+
41
+ <div
42
+ class="rounded bg-contrast-5"
43
+ style="padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)"
44
+ >
45
+ ${repeat([...Object.entries(this._value || {}), null], (rule, ruleIndex) => String(ruleIndex), (rule, ruleIndex) => {
46
+ if (rule === null) {
47
+ return [
48
+ ruleIndex > 0 ? divider : '',
49
+ this.__renderRule({
50
+ onChange: ({ key, items }) => {
51
+ var _a;
52
+ this._value = {
53
+ ...this._value,
54
+ [key]: [...((_a = this._value[key]) !== null && _a !== void 0 ? _a : []), ...items],
55
+ };
56
+ },
57
+ }),
58
+ ];
59
+ }
60
+ return [
61
+ ruleIndex > 0 ? divider : '',
62
+ this.__renderRule({
63
+ rule: { key: rule[0], items: rule[1] },
64
+ onChange: updatedRule => {
65
+ var _a, _b;
66
+ const newValue = {};
67
+ const oldKeys = Object.keys(this._value);
68
+ for (let i = 0; i < oldKeys.length; i++) {
69
+ const oldKey = oldKeys[i];
70
+ if (oldKey === rule[0]) {
71
+ if (updatedRule.key === oldKey) {
72
+ newValue[oldKey] = updatedRule.items;
73
+ }
74
+ else {
75
+ const existingItems = (_a = this._value[updatedRule.key]) !== null && _a !== void 0 ? _a : [];
76
+ if (i > oldKeys.indexOf(updatedRule.key)) {
77
+ newValue[updatedRule.key] = [...existingItems, ...updatedRule.items];
78
+ }
79
+ else {
80
+ newValue[updatedRule.key] = [...updatedRule.items, ...existingItems];
81
+ oldKeys.splice(oldKeys.indexOf(updatedRule.key), 1);
82
+ }
83
+ }
84
+ }
85
+ else {
86
+ newValue[oldKey] = (_b = this._value[oldKey]) !== null && _b !== void 0 ? _b : [];
87
+ }
88
+ }
89
+ this._value = newValue;
90
+ },
91
+ onDelete: () => {
92
+ const newValue = { ...this._value };
93
+ delete newValue[rule[0]];
94
+ this._value = newValue;
95
+ },
96
+ }),
97
+ ];
98
+ })}
99
+ </div>
100
+
101
+ <p
102
+ class="text-s text-error mt-s"
103
+ ?hidden=${!this._errorMessage || this.disabled || this.readonly}
104
+ >
105
+ ${this._errorMessage}
106
+ </p>
107
+ `;
108
+ }
109
+ get _value() {
110
+ var _a;
111
+ return (_a = super._value) !== null && _a !== void 0 ? _a : {};
112
+ }
113
+ set _value(value) {
114
+ super._value = value;
115
+ }
116
+ __renderRule({ rule, onDelete, onChange }) {
117
+ var _a, _b;
118
+ const items = (_a = rule === null || rule === void 0 ? void 0 : rule.items) !== null && _a !== void 0 ? _a : [];
119
+ return html `
120
+ <div class="flex items-center space-x-s" aria-label=${this.t('rule')}>
121
+ <div class="flex-1 bg-base rounded-s overflow-hidden border border-contrast-10">
122
+ <div class="bg-contrast-10">
123
+ <div class="grid gap-1px grid-vertical sm-grid-horizontal">
124
+ <div class="bg-base">
125
+ <div
126
+ aria-hidden="true"
127
+ class=${classMap({
128
+ 'text-tertiary': !this.readonly && !this.disabled,
129
+ 'text-disabled': this.readonly || this.disabled,
130
+ 'w-m h-m': true,
131
+ })}
132
+ >
133
+ ${svg `<svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M18 8C12.48 8 8 12.48 8 18C8 23.52 12.48 28 18 28C23.52 28 28 23.52 28 18C28 12.48 23.52 8 18 8ZM18 26C13.59 26 10 22.41 10 18C10 13.59 13.59 10 18 10C22.41 10 26 13.59 26 18C26 22.41 22.41 26 18 26Z" class="fill-current"/><path fill-rule="evenodd" clip-rule="evenodd" d="M19.49 17.38C19.92 16.16 19.66 14.74 18.68 13.76C17.57 12.65 15.89 12.46 14.58 13.17L16.93 15.52L15.52 16.93L13.17 14.58C12.46 15.9 12.65 17.57 13.76 18.68C14.74 19.66 16.16 19.92 17.38 19.49L20.79 22.9C20.99 23.1 21.3 23.1 21.5 22.9L22.9 21.5C23.1 21.3 23.1 20.99 22.9 20.79L19.49 17.38Z" class="fill-current"/></svg>`}
134
+ </div>
135
+ </div>
136
+ <div class="bg-base">
137
+ ${this.__renderInput({
138
+ value: (_b = rule === null || rule === void 0 ? void 0 : rule.key) !== null && _b !== void 0 ? _b : '',
139
+ label: this.t('option_name'),
140
+ onChange: newPath => {
141
+ if (newPath === undefined) {
142
+ onDelete === null || onDelete === void 0 ? void 0 : onDelete();
143
+ }
144
+ else {
145
+ onChange({ key: newPath, items });
146
+ }
147
+ },
148
+ })}
149
+ </div>
150
+ <div class="bg-base">
151
+ <div
152
+ class=${classMap({
153
+ 'flex items-center justify-center w-m h-m transition-colors': true,
154
+ 'focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50': true,
155
+ 'cursor-default text-tertiary': !(this.disabled || this.readonly),
156
+ 'text-disabled cursor-default': this.disabled || this.readonly,
157
+ })}
158
+ >
159
+ <div aria-hidden="true">
160
+ ${svg `<svg class="w-full h-full" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.5 9.8C11.0088 9.8 9.8 11.0088 9.8 12.5V23.5C9.8 24.9912 11.0088 26.2 12.5 26.2H14C14.6627 26.2 15.2 25.6627 15.2 25C15.2 24.3373 14.6627 23.8 14 23.8H13.5C12.782 23.8 12.2 23.218 12.2 22.5V13.5C12.2 12.782 12.782 12.2 13.5 12.2H14C14.6627 12.2 15.2 11.6627 15.2 11C15.2 10.3373 14.6627 9.8 14 9.8H12.5Z" class="fill-current"/><path d="M22 9.8C21.3373 9.8 20.8 10.3373 20.8 11C20.8 11.6627 21.3373 12.2 22 12.2H22.5C23.218 12.2 23.8 12.782 23.8 13.5V22.5C23.8 23.218 23.218 23.8 22.5 23.8H22C21.3373 23.8 20.8 24.3373 20.8 25C20.8 25.6627 21.3373 26.2 22 26.2H23.5C24.9912 26.2 26.2 24.9912 26.2 23.5V12.5C26.2 11.0088 24.9912 9.8 23.5 9.8H22Z" class="fill-current"/></svg>`}
161
+ </div>
162
+ </div>
163
+ </div>
164
+ <div class="bg-base">
165
+ <div class="bg-contrast-10 grid grid-cols-1 gap-1px">
166
+ ${repeat(this.readonly ? items : [...items, null], (value, index) => index, (value, index) => html `
167
+ <div class="bg-base">
168
+ ${this.__renderInput({
169
+ value: value !== null && value !== void 0 ? value : '',
170
+ label: value ? String(index + 1) : this.t('add_value'),
171
+ onChange: newValue => {
172
+ const newItems = [...items];
173
+ if (newValue) {
174
+ if (value === null) {
175
+ newItems.push(newValue);
176
+ }
177
+ else {
178
+ newItems[index] = newValue;
179
+ }
180
+ }
181
+ else {
182
+ newItems.splice(index, 1);
183
+ }
184
+ if (rule)
185
+ onChange({ key: rule.key, items: newItems });
186
+ },
187
+ })}
188
+ </div>
189
+ `)}
190
+ </div>
191
+ </div>
192
+ </div>
193
+ </div>
194
+ </div>
195
+
196
+ <div
197
+ class="flex -mr-s self-start flex-col sm-flex-row flex-shrink-0 items-center border-t border-b border-transparent divide-y divide-transparent"
198
+ ?hidden=${this.readonly || Object.keys(this._value).length === 0}
199
+ >
200
+ <button
201
+ aria-label=${this.t('delete')}
202
+ class=${classMap({
203
+ 'box-content flex items-center justify-center': true,
204
+ 'w-m h-m rounded-full transition-colors': true,
205
+ 'text-secondary hover-bg-contrast-5 hover-text-error': !this.disabled,
206
+ 'cursor-default text-disabled': this.disabled,
207
+ 'focus-outline-none focus-ring-2 ring-primary-50': true,
208
+ 'opacity-0 pointer-events-none': !rule,
209
+ })}
210
+ ?disabled=${this.disabled || this.readonly || !rule}
211
+ @click=${() => onDelete === null || onDelete === void 0 ? void 0 : onDelete()}
212
+ >
213
+ ${svg `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="text-l" style="width: 1.25em; height: 1.25em"><path stroke-linecap="round" stroke-linejoin="round" d="M15 12H9m12 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" /></svg>`}
214
+ </button>
215
+ </div>
216
+ </div>
217
+ `;
218
+ }
219
+ __renderInput(params) {
220
+ return html `
221
+ <label class="relative flex items-center cursor-text group text-tertiary">
222
+ <div class="relative flex-1 min-w-0 overflow-hidden">
223
+ <input
224
+ placeholder=${params.label}
225
+ class=${classMap({
226
+ 'bg-base relative flex h-m px-s font-medium w-full': true,
227
+ 'text-body': !this.disabled && !this.readonly,
228
+ 'text-disabled': this.disabled,
229
+ 'text-secondary': this.readonly,
230
+ 'flex max-w-full whitespace-nowrap': true,
231
+ 'focus-outline-none': true,
232
+ })}
233
+ .value=${params.value}
234
+ ?disabled=${this.disabled || this.readonly}
235
+ @keydown=${(evt) => {
236
+ const input = evt.currentTarget;
237
+ if (evt.key === 'Backspace' && !input.value)
238
+ params.onChange();
239
+ }}
240
+ @change=${(evt) => {
241
+ const input = evt.currentTarget;
242
+ if (!input.value)
243
+ params.onChange();
244
+ }}
245
+ @input=${(evt) => {
246
+ const input = evt.currentTarget;
247
+ params.onChange(input.value);
248
+ }}
249
+ />
250
+ </div>
251
+
252
+ <span
253
+ class=${classMap({
254
+ 'font-tnum text-xs font-medium border border-current mr-s px-xs rounded-s': true,
255
+ 'inline-block': !!params.value,
256
+ 'sr-only': !params.value,
257
+ 'text-body': !this.disabled && !this.readonly,
258
+ 'text-disabled': this.disabled,
259
+ 'text-secondary': this.readonly,
260
+ })}
261
+ >
262
+ ${this.t(params.label)}
263
+ </span>
264
+
265
+ ${this.disabled || this.readonly
266
+ ? ''
267
+ : html `
268
+ <div
269
+ class="absolute inset-0 transition-colors bg-transparent group-hover-bg-contrast-5 pointer-events-none"
270
+ ></div>
271
+ `}
272
+ </label>
273
+ `;
274
+ }
275
+ }
276
+ export { InternalArrayMapControl };
277
+ //# sourceMappingURL=InternalArrayMapControl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InternalArrayMapControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalArrayMapControl/InternalArrayMapControl.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,8DAA2D;AAC7F,OAAO,EAAE,eAAe,EAAE,sCAAmC;AAC7D,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAMpD,MAAM,uBAAwB,SAAQ,eAAe,CAAC,uBAAuB,CAAC;IAC5E,MAAM,KAAK,MAAM;QACf,OAAO;YACL,KAAK,CAAC,MAAM;YACZ,GAAG;;;;;;;;;;;OAYF;SACF,CAAC;IACJ,CAAC;IAED,aAAa;QACX,MAAM,OAAO,GAAG,IAAI,CAAA;;;;;;;;;KASnB,CAAC;QAEF,OAAO,IAAI,CAAA;kCACmB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,UAAU;0DACP,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK;mDAChC,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU;;;;;;;UAO5E,MAAM,CACN,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAC5C,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,EACtC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;YAClB,IAAI,IAAI,KAAK,IAAI,EAAE;gBACjB,OAAO;oBACL,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;oBAC5B,IAAI,CAAC,YAAY,CAAC;wBAChB,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,KA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C,QAAQ;YAC9B,gBAAgB,EAAE,IAAI,CAAC,QAAQ;SAChC,CAAC;;YAEA,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;;;UAGtB,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ;YAC9B,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,IAAI,CAAA;;;;aAIH;;KAER,CAAC;IACJ,CAAC;CACF;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC","sourcesContent":["import type { CSSResultArray, TemplateResult } from 'lit-element';\n\nimport { InternalEditableControl } from '../InternalEditableControl/InternalEditableControl';\nimport { ResponsiveMixin } from '../../../mixins/responsive';\nimport { css, html, svg } from 'lit-element';\nimport { classMap } from '../../../utils/class-map';\nimport { repeat } from 'lit-html/directives/repeat';\n\ntype InputParams = { label: string; value: string; onChange: (newValue?: string) => void };\ntype RuleParams = { rule?: Rule; onChange: (newRule: Rule) => void; onDelete?: () => void };\ntype Rule = { key: string; items: string[] };\n\nclass InternalArrayMapControl extends ResponsiveMixin(InternalEditableControl) {\n static get styles(): CSSResultArray {\n return [\n super.styles,\n css`\n .gap-1px {\n gap: 1px;\n }\n\n .grid-vertical {\n grid-template: auto / var(--lumo-size-m) 1fr;\n }\n\n :host([sm]) .sm-grid-horizontal {\n grid-template: auto / var(--lumo-size-m) 1fr var(--lumo-size-m) 1fr;\n }\n `,\n ];\n }\n\n renderControl(): TemplateResult {\n const divider = html`\n <div class=\"flex items-center h-s\">\n <div class=\"w-m text-center leading-none uppercase font-medium text-xs text-contrast-20\">\n <foxy-i18n infer=\"\" key=\"or\"></foxy-i18n>\n </div>\n\n <div class=\"flex-1 border-t border-contrast-10\"></div>\n <div class=\"w-m ml-s flex-shrink-0\"></div>\n </div>\n `;\n\n return html`\n <div class=\"mb-s\" ?hidden=${!this.label && !this.helperText}>\n <p class=\"font-medium text-body text-l\" ?hidden=${!this.label}>${this.label}</p>\n <p class=\"text-s text-secondary\" ?hidden=${!this.helperText}>${this.helperText}</p>\n </div>\n\n <div\n class=\"rounded bg-contrast-5\"\n style=\"padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)\"\n >\n ${repeat(\n [...Object.entries(this._value || {}), null],\n (rule, ruleIndex) => String(ruleIndex),\n (rule, ruleIndex) => {\n if (rule === null) {\n return [\n ruleIndex > 0 ? divider : '',\n this.__renderRule({\n onChange: ({ key, items }) => {\n this._value = {\n ...this._value,\n [key]: [...(this._value[key] ?? []), ...items],\n };\n },\n }),\n ];\n }\n\n return [\n ruleIndex > 0 ? divider : '',\n this.__renderRule({\n rule: { key: rule[0], items: rule[1] },\n onChange: updatedRule => {\n const newValue: Record<string, string[]> = {};\n const oldKeys = Object.keys(this._value);\n\n for (let i = 0; i < oldKeys.length; i++) {\n const oldKey = oldKeys[i];\n if (oldKey === rule[0]) {\n if (updatedRule.key === oldKey) {\n newValue[oldKey] = updatedRule.items;\n } else {\n const existingItems = this._value[updatedRule.key] ?? [];\n if (i > oldKeys.indexOf(updatedRule.key)) {\n newValue[updatedRule.key] = [...existingItems, ...updatedRule.items];\n } else {\n newValue[updatedRule.key] = [...updatedRule.items, ...existingItems];\n oldKeys.splice(oldKeys.indexOf(updatedRule.key), 1);\n }\n }\n } else {\n newValue[oldKey] = this._value[oldKey] ?? [];\n }\n }\n\n this._value = newValue;\n },\n onDelete: () => {\n const newValue = { ...this._value };\n delete newValue[rule[0]];\n this._value = newValue;\n },\n }),\n ];\n }\n )}\n </div>\n\n <p\n class=\"text-s text-error mt-s\"\n ?hidden=${!this._errorMessage || this.disabled || this.readonly}\n >\n ${this._errorMessage}\n </p>\n `;\n }\n\n protected get _value(): Record<string, string[]> {\n return (super._value as Record<string, string[]>) ?? {};\n }\n\n protected set _value(value: Record<string, string[]>) {\n super._value = value;\n }\n\n private __renderRule({ rule, onDelete, onChange }: RuleParams) {\n const items = rule?.items ?? [];\n\n return html`\n <div class=\"flex items-center space-x-s\" aria-label=${this.t('rule')}>\n <div class=\"flex-1 bg-base rounded-s overflow-hidden border border-contrast-10\">\n <div class=\"bg-contrast-10\">\n <div class=\"grid gap-1px grid-vertical sm-grid-horizontal\">\n <div class=\"bg-base\">\n <div\n aria-hidden=\"true\"\n class=${classMap({\n 'text-tertiary': !this.readonly && !this.disabled,\n 'text-disabled': this.readonly || this.disabled,\n 'w-m h-m': true,\n })}\n >\n ${svg`<svg class=\"w-full h-full\" viewBox=\"0 0 36 36\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M18 8C12.48 8 8 12.48 8 18C8 23.52 12.48 28 18 28C23.52 28 28 23.52 28 18C28 12.48 23.52 8 18 8ZM18 26C13.59 26 10 22.41 10 18C10 13.59 13.59 10 18 10C22.41 10 26 13.59 26 18C26 22.41 22.41 26 18 26Z\" class=\"fill-current\"/><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M19.49 17.38C19.92 16.16 19.66 14.74 18.68 13.76C17.57 12.65 15.89 12.46 14.58 13.17L16.93 15.52L15.52 16.93L13.17 14.58C12.46 15.9 12.65 17.57 13.76 18.68C14.74 19.66 16.16 19.92 17.38 19.49L20.79 22.9C20.99 23.1 21.3 23.1 21.5 22.9L22.9 21.5C23.1 21.3 23.1 20.99 22.9 20.79L19.49 17.38Z\" class=\"fill-current\"/></svg>`}\n </div>\n </div>\n <div class=\"bg-base\">\n ${this.__renderInput({\n value: rule?.key ?? '',\n label: this.t('option_name'),\n onChange: newPath => {\n if (newPath === undefined) {\n onDelete?.();\n } else {\n onChange({ key: newPath, items });\n }\n },\n })}\n </div>\n <div class=\"bg-base\">\n <div\n class=${classMap({\n 'flex items-center justify-center w-m h-m transition-colors': true,\n 'focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50': true,\n 'cursor-default text-tertiary': !(this.disabled || this.readonly),\n 'text-disabled cursor-default': this.disabled || this.readonly,\n })}\n >\n <div aria-hidden=\"true\">\n ${svg`<svg class=\"w-full h-full\" viewBox=\"0 0 36 36\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12.5 9.8C11.0088 9.8 9.8 11.0088 9.8 12.5V23.5C9.8 24.9912 11.0088 26.2 12.5 26.2H14C14.6627 26.2 15.2 25.6627 15.2 25C15.2 24.3373 14.6627 23.8 14 23.8H13.5C12.782 23.8 12.2 23.218 12.2 22.5V13.5C12.2 12.782 12.782 12.2 13.5 12.2H14C14.6627 12.2 15.2 11.6627 15.2 11C15.2 10.3373 14.6627 9.8 14 9.8H12.5Z\" class=\"fill-current\"/><path d=\"M22 9.8C21.3373 9.8 20.8 10.3373 20.8 11C20.8 11.6627 21.3373 12.2 22 12.2H22.5C23.218 12.2 23.8 12.782 23.8 13.5V22.5C23.8 23.218 23.218 23.8 22.5 23.8H22C21.3373 23.8 20.8 24.3373 20.8 25C20.8 25.6627 21.3373 26.2 22 26.2H23.5C24.9912 26.2 26.2 24.9912 26.2 23.5V12.5C26.2 11.0088 24.9912 9.8 23.5 9.8H22Z\" class=\"fill-current\"/></svg>`}\n </div>\n </div>\n </div>\n <div class=\"bg-base\">\n <div class=\"bg-contrast-10 grid grid-cols-1 gap-1px\">\n ${repeat(\n this.readonly ? items : [...items, null],\n (value, index) => index,\n (value, index) => html`\n <div class=\"bg-base\">\n ${this.__renderInput({\n value: value ?? '',\n label: value ? String(index + 1) : this.t('add_value'),\n onChange: newValue => {\n const newItems = [...items];\n\n if (newValue) {\n if (value === null) {\n newItems.push(newValue);\n } else {\n newItems[index] = newValue;\n }\n } else {\n newItems.splice(index, 1);\n }\n\n if (rule) onChange({ key: rule.key, items: newItems });\n },\n })}\n </div>\n `\n )}\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div\n class=\"flex -mr-s self-start flex-col sm-flex-row flex-shrink-0 items-center border-t border-b border-transparent divide-y divide-transparent\"\n ?hidden=${this.readonly || Object.keys(this._value).length === 0}\n >\n <button\n aria-label=${this.t('delete')}\n class=${classMap({\n 'box-content flex items-center justify-center': true,\n 'w-m h-m rounded-full transition-colors': true,\n 'text-secondary hover-bg-contrast-5 hover-text-error': !this.disabled,\n 'cursor-default text-disabled': this.disabled,\n 'focus-outline-none focus-ring-2 ring-primary-50': true,\n 'opacity-0 pointer-events-none': !rule,\n })}\n ?disabled=${this.disabled || this.readonly || !rule}\n @click=${() => onDelete?.()}\n >\n ${svg`<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" class=\"text-l\" style=\"width: 1.25em; height: 1.25em\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M15 12H9m12 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\" /></svg>`}\n </button>\n </div>\n </div>\n `;\n }\n\n private __renderInput(params: InputParams) {\n return html`\n <label class=\"relative flex items-center cursor-text group text-tertiary\">\n <div class=\"relative flex-1 min-w-0 overflow-hidden\">\n <input\n placeholder=${params.label}\n class=${classMap({\n 'bg-base relative flex h-m px-s font-medium w-full': true,\n 'text-body': !this.disabled && !this.readonly,\n 'text-disabled': this.disabled,\n 'text-secondary': this.readonly,\n 'flex max-w-full whitespace-nowrap': true, // ugh safari\n 'focus-outline-none': true,\n })}\n .value=${params.value}\n ?disabled=${this.disabled || this.readonly}\n @keydown=${(evt: KeyboardEvent) => {\n const input = evt.currentTarget as HTMLInputElement;\n if (evt.key === 'Backspace' && !input.value) params.onChange();\n }}\n @change=${(evt: Event) => {\n const input = evt.currentTarget as HTMLInputElement;\n if (!input.value) params.onChange();\n }}\n @input=${(evt: Event) => {\n const input = evt.currentTarget as HTMLInputElement;\n params.onChange(input.value);\n }}\n />\n </div>\n\n <span\n class=${classMap({\n 'font-tnum text-xs font-medium border border-current mr-s px-xs rounded-s': true,\n 'inline-block': !!params.value,\n 'sr-only': !params.value,\n 'text-body': !this.disabled && !this.readonly,\n 'text-disabled': this.disabled,\n 'text-secondary': this.readonly,\n })}\n >\n ${this.t(params.label)}\n </span>\n\n ${this.disabled || this.readonly\n ? ''\n : html`\n <div\n class=\"absolute inset-0 transition-colors bg-transparent group-hover-bg-contrast-5 pointer-events-none\"\n ></div>\n `}\n </label>\n `;\n }\n}\n\nexport { InternalArrayMapControl };\n"]}
@@ -0,0 +1,4 @@
1
+ import '../../public/I18n/index';
2
+ import '../InternalEditableControl/index';
3
+ import { InternalArrayMapControl } from './InternalArrayMapControl';
4
+ export { InternalArrayMapControl };
@@ -0,0 +1,6 @@
1
+ import "../../public/I18n/index.js";
2
+ import "../InternalEditableControl/index.js";
3
+ import { InternalArrayMapControl } from "./InternalArrayMapControl.js";
4
+ customElements.define('foxy-internal-array-map-control', InternalArrayMapControl);
5
+ export { InternalArrayMapControl };
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalArrayMapControl/index.ts"],"names":[],"mappings":"AAAA,oCAAiC;AAEjC,6CAA0C;AAE1C,OAAO,EAAE,uBAAuB,EAAE,qCAAkC;AAEpE,cAAc,CAAC,MAAM,CAAC,iCAAiC,EAAE,uBAAuB,CAAC,CAAC;AAElF,OAAO,EAAE,uBAAuB,EAAE,CAAC","sourcesContent":["import '../../public/I18n/index';\n\nimport '../InternalEditableControl/index';\n\nimport { InternalArrayMapControl } from './InternalArrayMapControl';\n\ncustomElements.define('foxy-internal-array-map-control', InternalArrayMapControl);\n\nexport { InternalArrayMapControl };\n"]}
@@ -7,7 +7,9 @@ declare type DisplayValueOptionsCb = (resource: HALJSONResource) => Record<strin
7
7
  export declare class InternalResourcePickerControl extends InternalEditableControl {
8
8
  static get properties(): PropertyDeclarations;
9
9
  getDisplayValueOptions: DisplayValueOptionsCb;
10
+ showCopyIdButton: boolean;
10
11
  virtualHost: string;
12
+ getItemUrl: ((href: string) => string) | null;
11
13
  formProps: Record<string, unknown>;
12
14
  filters: Option[];
13
15
  layout: 'summary-item' | 'standalone' | null;
@@ -17,6 +19,7 @@ export declare class InternalResourcePickerControl extends InternalEditableContr
17
19
  private readonly __getItemRenderer;
18
20
  renderControl(): TemplateResult;
19
21
  updated(changes: Map<keyof this, unknown>): void;
22
+ private __clear;
20
23
  private __renderSummaryItemLayout;
21
24
  private __renderStandaloneLayout;
22
25
  private __handleFetchEvent;
@@ -1,4 +1,5 @@
1
1
  import { InternalEditableControl } from "../InternalEditableControl/InternalEditableControl.js";
2
+ import { getResourceId } from '@foxy.io/sdk/core';
2
3
  import { FetchEvent } from "../../public/NucleonElement/FetchEvent.js";
3
4
  import { ifDefined } from 'lit-html/directives/if-defined';
4
5
  import { html, svg } from 'lit-html';
@@ -10,7 +11,9 @@ export class InternalResourcePickerControl extends InternalEditableControl {
10
11
  constructor() {
11
12
  super(...arguments);
12
13
  this.getDisplayValueOptions = resource => ({ resource });
14
+ this.showCopyIdButton = false;
13
15
  this.virtualHost = uniqueId('internal-resource-picker-control-');
16
+ this.getItemUrl = null;
14
17
  this.formProps = {};
15
18
  this.filters = [];
16
19
  this.layout = null;
@@ -33,7 +36,9 @@ export class InternalResourcePickerControl extends InternalEditableControl {
33
36
  return {
34
37
  ...super.properties,
35
38
  getDisplayValueOptions: { attribute: false },
39
+ showCopyIdButton: { type: Boolean, attribute: 'show-copy-id-button' },
36
40
  virtualHost: {},
41
+ getItemUrl: { attribute: false },
37
42
  formProps: { type: Object },
38
43
  filters: { type: Array },
39
44
  layout: {},
@@ -71,6 +76,10 @@ export class InternalResourcePickerControl extends InternalEditableControl {
71
76
  if (changes.has('item'))
72
77
  (_b = (_a = this.__getItemRenderer.cache).clear) === null || _b === void 0 ? void 0 : _b.call(_a);
73
78
  }
79
+ __clear() {
80
+ this._value = '';
81
+ this.dispatchEvent(new CustomEvent('clear'));
82
+ }
74
83
  __renderSummaryItemLayout() {
75
84
  const resource = this.renderRoot.querySelector('#value');
76
85
  const onClick = (evt) => {
@@ -131,10 +140,7 @@ export class InternalResourcePickerControl extends InternalEditableControl {
131
140
  style="width: 1em; height: 1em;"
132
141
  ?disabled=${this.disabled}
133
142
  ?hidden=${this.readonly || !this._value}
134
- @click=${() => {
135
- this._value = '';
136
- this.dispatchEvent(new CustomEvent('clear'));
137
- }}
143
+ @click=${this.__clear}
138
144
  >
139
145
  ${svg `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1em; height: 1em; transform: scale(1.25); margin-right: -0.16em"><path d="M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" /></svg>`}
140
146
  </button>
@@ -151,29 +157,58 @@ export class InternalResourcePickerControl extends InternalEditableControl {
151
157
  `;
152
158
  }
153
159
  __renderStandaloneLayout() {
154
- var _a, _b;
160
+ var _a, _b, _c;
161
+ const selectionUrl = typeof this._value === 'string' ? (_a = this.getItemUrl) === null || _a === void 0 ? void 0 : _a.call(this, this._value) : void 0;
162
+ const selectionId = typeof this._value === 'string' ? getResourceId(this._value) : void 0;
155
163
  return html `
156
164
  <div class="block group">
157
165
  <div
158
166
  class=${classMap({
159
- 'transition-colors mb-xs font-medium text-s': true,
160
- 'text-secondary group-hover-text-body': !this.disabled && !this.readonly,
161
- 'text-secondary': this.readonly,
167
+ 'flex items-center gap-m transition-colors mb-s font-medium text-l': true,
162
168
  'text-disabled': this.disabled,
163
169
  })}
164
170
  >
165
- ${this.label}
171
+ <span class="mr-auto">${this.label}</span>
172
+ ${selectionUrl
173
+ ? html `
174
+ <a
175
+ class="text-body rounded transition-opacity hover-opacity-90 focus-outline-none focus-ring-2 focus-ring-primary-50"
176
+ href=${selectionUrl}
177
+ >
178
+ <foxy-i18n infer="" key="view"></foxy-i18n>
179
+ </a>
180
+ `
181
+ : ''}
182
+ ${this.showCopyIdButton && selectionId !== null
183
+ ? html `
184
+ <foxy-copy-to-clipboard
185
+ layout="text"
186
+ theme="contrast tertiary-inline"
187
+ infer="copy-id"
188
+ text=${selectionId}
189
+ >
190
+ </foxy-copy-to-clipboard>
191
+ `
192
+ : ''}
193
+ ${this.readonly || !this._value
194
+ ? ''
195
+ : html `
196
+ <vaadin-button
197
+ theme="error tertiary-inline"
198
+ ?disabled=${this.disabled}
199
+ @click=${this.__clear}
200
+ >
201
+ <foxy-i18n infer="" key="clear"></foxy-i18n>
202
+ </vaadin-button>
203
+ `}
166
204
  </div>
167
205
 
168
206
  <button
169
207
  class=${classMap({
170
- 'block w-full rounded text-left transition-colors': true,
171
- 'border border-dashed': true,
172
- 'border-transparent': !this.readonly,
173
- 'cursor-pointer bg-contrast-5 hover-bg-contrast-10': !this.disabled && !this.readonly,
174
- 'cursor-default bg-contrast-5': this.disabled,
175
- 'cursor-default border-contrast-30': this.readonly,
208
+ 'block w-full bg-contrast-5 rounded text-left transition-colors': true,
176
209
  'focus-outline-none focus-ring-2 focus-ring-primary-50': true,
210
+ 'cursor-pointer hover-bg-contrast-10': !this.disabled && !this.readonly,
211
+ 'cursor-default': this.disabled || this.readonly,
177
212
  })}
178
213
  style="padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)"
179
214
  ?disabled=${this.disabled || this.readonly}
@@ -203,7 +238,7 @@ export class InternalResourcePickerControl extends InternalEditableControl {
203
238
  templates: this.templates,
204
239
  previous: null,
205
240
  next: null,
206
- group: (_b = (_a = this.nucleon) === null || _a === void 0 ? void 0 : _a.group) !== null && _b !== void 0 ? _b : '',
241
+ group: (_c = (_b = this.nucleon) === null || _b === void 0 ? void 0 : _b.group) !== null && _c !== void 0 ? _c : '',
207
242
  lang: this.lang,
208
243
  ns: this.ns,
209
244
  })}
@@ -1 +1 @@
1
- {"version":3,"file":"InternalResourcePickerControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalResourcePickerControl/InternalResourcePickerControl.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,uBAAuB,EAAE,8DAA2D;AAC7F,OAAO,EA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AC9D,OAAO,EAAE,oBAAoB;SAC9B,CAAC,CACH,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations, TemplateResult } from 'lit-element';\nimport type { HALJSONResource } from '../../public/NucleonElement/types';\nimport type { NucleonElement } from '../../public/NucleonElement/NucleonElement';\nimport type { FormRenderer } from '../../public/FormDialog/types';\nimport type { ItemRenderer } from '../../public/CollectionPage/types';\nimport type { FormDialog } from '../../public/FormDialog/FormDialog';\nimport type { Option } from '../../public/QueryBuilder/types';\n\nimport { InternalEditableControl } from '../InternalEditableControl/InternalEditableControl';\nimport { FetchEvent } from '../../public/NucleonElement/FetchEvent';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html, svg } from 'lit-html';\nimport { classMap } from '../../../utils/class-map';\nimport { uniqueId } from 'lodash-es';\nimport { spread } from '@open-wc/lit-helpers';\n\nimport memoize from 'lodash-es/memoize';\n\ntype DisplayValueOptionsCb = (resource: HALJSONResource) => Record<string, unknown>;\n\nexport class InternalResourcePickerControl extends InternalEditableControl {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n getDisplayValueOptions: { attribute: false },\n virtualHost: {},\n formProps: { type: Object },\n filters: { type: Array },\n layout: {},\n first: {},\n item: {},\n form: {},\n };\n }\n\n getDisplayValueOptions: DisplayValueOptionsCb = resource => ({ resource });\n\n virtualHost = uniqueId('internal-resource-picker-control-');\n\n formProps: Record<string, unknown> = {};\n\n filters: Option[] = [];\n\n layout: 'summary-item' | 'standalone' | null = null;\n\n first: string | null = null;\n\n item: string | null = null;\n\n form: string | null | FormRenderer = null;\n\n private readonly __getItemRenderer = memoize((item: string | null) => {\n return new Function(\n 'ctx',\n `return ctx.html\\`\n <${item ?? 'foxy-null'}\n related=\\${JSON.stringify(ctx.related)}\n parent=\\${ctx.parent}\n infer=\"card\"\n href=$\\{ctx.href}\n ...=\\${ctx.spread(ctx.props)}\n >\n </${item ?? 'foxy-null'}>\\``\n ) as ItemRenderer;\n });\n\n renderControl(): TemplateResult {\n const dialogProps = {\n ...this.formProps,\n '.selectionProps': { '.filters': this.filters, '.first': this.first, '.item': this.item },\n };\n\n return html`\n <foxy-form-dialog\n parent=\"foxy://${this.virtualHost}/select\"\n header=\"header\"\n infer=\"dialog\"\n alert\n .props=${dialogProps}\n .form=${this.form ?? 'foxy-internal-resource-picker-control-form'}\n @fetch=${this.__handleFetchEvent}\n >\n </foxy-form-dialog>\n\n ${this.layout === 'summary-item'\n ? this.__renderSummaryItemLayout()\n : this.__renderStandaloneLayout()}\n `;\n }\n\n updated(changes: Map<keyof this, unknown>): void {\n super.updated(changes);\n if (changes.has('item')) this.__getItemRenderer.cache.clear?.();\n }\n\n private __renderSummaryItemLayout() {\n const resource = this.renderRoot.querySelector<NucleonElement<any>>('#value');\n const onClick = (evt: Event) => {\n if (this.disabled || this.readonly) return;\n const button = evt.currentTarget as HTMLButtonElement;\n const dialog = this.renderRoot.querySelector('foxy-form-dialog') as FormDialog;\n\n dialog.href = '';\n dialog.show(button);\n };\n\n return html`\n <div class=\"flex items-start leading-xs gap-m\">\n <div class=\"flex-1\">\n <div class=\"text-m text-body whitespace-nowrap\">${this.label}</div>\n <div class=\"text-s text-secondary\">${this.helperText}</div>\n <div class=\"text-s text-error\" ?hidden=${this.disabled || this.readonly}>\n ${this._errorMessage}\n </div>\n </div>\n\n <div class=\"flex items-center gap-xs\">\n <button\n aria-label=${this.t('select')}\n class=${classMap({\n 'text-right min-w-0 transition-colors transition-opacity': true,\n 'rounded-s focus-outline-none focus-ring-2 focus-ring-primary-50': true,\n 'text-secondary': this.readonly,\n 'text-disabled': this.disabled,\n 'cursor-pointer text-body hover-opacity-80': !this.disabled && !this.readonly,\n 'font-medium': !this.readonly,\n })}\n ?disabled=${this.disabled || this.readonly}\n @click=${onClick}\n >\n <div class=\"truncate min-w-0\">\n ${this._value\n ? html`\n <foxy-i18n\n infer=\"\"\n key=\"value\"\n .options=${resource?.data\n ? this.getDisplayValueOptions(resource.data)\n : { context: resource?.in('fail') ? 'fail' : 'busy' }}\n >\n </foxy-i18n>\n `\n : this.placeholder}\n </div>\n </button>\n\n <button\n aria-label=${this.t('clear')}\n class=${classMap({\n 'rounded-full transition-colors': true,\n 'focus-outline-none focus-ring-2 focus-ring-primary-50': true,\n 'cursor-pointer text-tertiary hover-text-body': !this.disabled,\n 'cursor-default text-disabled': this.disabled,\n })}\n style=\"width: 1em; height: 1em;\"\n ?disabled=${this.disabled}\n ?hidden=${this.readonly || !this._value}\n @click=${() => {\n this._value = '';\n this.dispatchEvent(new CustomEvent('clear'));\n }}\n >\n ${svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" style=\"width: 1em; height: 1em; transform: scale(1.25); margin-right: -0.16em\"><path d=\"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z\" /></svg>`}\n </button>\n </div>\n </div>\n\n <foxy-nucleon\n infer=\"\"\n href=${ifDefined(this._value || void 0)}\n id=\"value\"\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n `;\n }\n\n private __renderStandaloneLayout() {\n return html`\n <div class=\"block group\">\n <div\n class=${classMap({\n 'transition-colors mb-xs font-medium text-s': true,\n 'text-secondary group-hover-text-body': !this.disabled && !this.readonly,\n 'text-secondary': this.readonly,\n 'text-disabled': this.disabled,\n })}\n >\n ${this.label}\n </div>\n\n <button\n class=${classMap({\n 'block w-full rounded text-left transition-colors': true,\n 'border border-dashed': true,\n 'border-transparent': !this.readonly,\n 'cursor-pointer bg-contrast-5 hover-bg-contrast-10': !this.disabled && !this.readonly,\n 'cursor-default bg-contrast-5': this.disabled,\n 'cursor-default border-contrast-30': this.readonly,\n 'focus-outline-none focus-ring-2 focus-ring-primary-50': true,\n })}\n style=\"padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)\"\n ?disabled=${this.disabled || this.readonly}\n @click=${(evt: MouseEvent) => {\n const button = evt.currentTarget as HTMLButtonElement;\n const dialog = this.renderRoot.querySelector('foxy-form-dialog') as FormDialog;\n\n dialog.href = '';\n dialog.show(button);\n }}\n >\n <div class=${classMap({ 'transition-opacity': true, 'opacity-50': this.disabled })}>\n ${this.__getItemRenderer(this.item)({\n html,\n data: null,\n href: (this._value as string | undefined) || '',\n related: [],\n parent: '',\n props: {},\n spread: spread,\n simplifyNsLoading: this.simplifyNsLoading,\n disabled: this.disabled,\n disabledControls: this.disabledControls,\n readonly: this.readonly,\n readonlyControls: this.readonlyControls,\n hidden: this.hidden,\n hiddenControls: this.hiddenControls,\n templates: this.templates,\n previous: null,\n next: null,\n group: this.nucleon?.group ?? '',\n lang: this.lang,\n ns: this.ns,\n })}\n </div>\n </button>\n\n <div\n class=${classMap({\n 'transition-colors mt-xs text-xs': true,\n 'text-secondary group-hover-text-body': !this.disabled && !this.readonly,\n 'text-secondary': this.readonly,\n 'text-disabled': this.disabled,\n })}\n ?hidden=${!this.helperText}\n >\n ${this.helperText}\n </div>\n\n <div\n class=\"mt-xs text-xs leading-xs text-error\"\n ?hidden=${!this._errorMessage || this.disabled || this.readonly}\n >\n ${this._errorMessage}\n </div>\n </div>\n `;\n }\n\n private __handleFetchEvent(event: Event) {\n if (!(event instanceof FetchEvent)) return;\n if (event.defaultPrevented) return;\n\n const { url, method } = event.request;\n\n if (url === `foxy://${this.virtualHost}/select` && method === 'POST') {\n return event.respondWith(this.__handleSelect(event.request));\n }\n\n if (url === `foxy://${this.virtualHost}/empty` && method === 'GET') {\n return event.respondWith(this.__handleEmpty());\n }\n }\n\n private async __handleSelect(request: Request): Promise<Response> {\n const body = (await request.clone().json()) as { selection: string };\n this._value = body.selection;\n return new Response(\n JSON.stringify({\n _links: { self: { href: `foxy://${this.virtualHost}/empty` } },\n message: 'Resource selected.',\n })\n );\n }\n\n private async __handleEmpty(): Promise<Response> {\n return new Response(\n JSON.stringify({\n _links: { self: { href: `foxy://${this.virtualHost}/empty` } },\n message: 'Resource selected.',\n })\n );\n }\n}\n"]}
1
+ {"version":3,"file":"InternalResourcePickerControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalResourcePickerControl/InternalResourcePickerControl.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,uBAAuB,EAAE,8DAA2D;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,kDAA+C;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,OAAO,MAAM,mBAAmB,CAAC;AAIxC,MAAM,OAAO,6BAA8B,SAAQ,uBAAuB;IAA1E;;QAiBE,2BAAsB,GAA0B,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;QAE3E,qBAAgB,GAAG,KAAK,CAAC;QAEzB,gBAAW,GAAG,QAAQ,CAAC,mCAAmC,CAAC,CAAC;QAE5D,eAAU,GAAsC,IAAI,CAAC;QAErD,cAAS,GAA4B,EAAE,CAAC;QAExC,YAAO,GAAa,EAAE,CAAC;QAEvB,WAAM,GAAyC,IAAI,CAAC;QAEpD,UAAK,GAAkB,IAAI,CAAC;QAE5B,SAAI,GAAkB,IAAI,CAAC;QAE3B,SAAI,GAAiC,IAAI,CAAC;QAEzB,sBAAiB,GAAG,OAAO,CAAC,CAAC,IAAmB,EAAE,EAAE;YACnE,OAAO,IAAI,QAAQ,CACjB,KAAK,EACL;WACK,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,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AAI,KAAK,CAAC,gBAAgB;YAAE,OAAO;QAEnC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC;QAEtC,IAAI,GAAG,KAAK,UAAU,IAAI,CAAC,WAAW,SAAS,IAAI,MAAM,KAAK,MAAM,EAAE;YACpE,OAAO,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;SAC9D;QAED,IAAI,GAAG,KAAK,UAAU,IAAI,CAAC,WAAW,QAAQ,IAAI,MAAM,KAAK,KAAK,EAAE;YAClE,OAAO,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;SAChD;IACH,CAAC;IAEO,KAAK,CAAC,cAAc,CAAC,OAAgB;QAC3C,MAAM,IAAI,GAAG,CAAC,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAA0B,CAAC;QACrE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC;QAC7B,OAAO,IAAI,QAAQ,CACjB,IAAI,CAAC,SAAS,CAAC;YACb,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,UAAU,IAAI,CAAC,WAAW,QAAQ,EAAE,EAAE;YAC9D,OAAO,EAAE,oBAAoB;SAC9B,CAAC,CACH,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,aAAa;QACzB,OAAO,IAAI,QAAQ,CACjB,IAAI,CAAC,SAAS,CAAC;YACb,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,UAAU,IAAI,CAAC,WAAW,QAAQ,EAAE,EAAE;YAC9D,OAAO,EAAE,oBAAoB;SAC9B,CAAC,CACH,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations, TemplateResult } from 'lit-element';\nimport type { HALJSONResource } from '../../public/NucleonElement/types';\nimport type { NucleonElement } from '../../public/NucleonElement/NucleonElement';\nimport type { FormRenderer } from '../../public/FormDialog/types';\nimport type { ItemRenderer } from '../../public/CollectionPage/types';\nimport type { FormDialog } from '../../public/FormDialog/FormDialog';\nimport type { Option } from '../../public/QueryBuilder/types';\n\nimport { InternalEditableControl } from '../InternalEditableControl/InternalEditableControl';\nimport { getResourceId } from '@foxy.io/sdk/core';\nimport { FetchEvent } from '../../public/NucleonElement/FetchEvent';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html, svg } from 'lit-html';\nimport { classMap } from '../../../utils/class-map';\nimport { uniqueId } from 'lodash-es';\nimport { spread } from '@open-wc/lit-helpers';\n\nimport memoize from 'lodash-es/memoize';\n\ntype DisplayValueOptionsCb = (resource: HALJSONResource) => Record<string, unknown>;\n\nexport class InternalResourcePickerControl extends InternalEditableControl {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n getDisplayValueOptions: { attribute: false },\n showCopyIdButton: { type: Boolean, attribute: 'show-copy-id-button' },\n virtualHost: {},\n getItemUrl: { attribute: false },\n formProps: { type: Object },\n filters: { type: Array },\n layout: {},\n first: {},\n item: {},\n form: {},\n };\n }\n\n getDisplayValueOptions: DisplayValueOptionsCb = resource => ({ resource });\n\n showCopyIdButton = false;\n\n virtualHost = uniqueId('internal-resource-picker-control-');\n\n getItemUrl: ((href: string) => string) | null = null;\n\n formProps: Record<string, unknown> = {};\n\n filters: Option[] = [];\n\n layout: 'summary-item' | 'standalone' | null = null;\n\n first: string | null = null;\n\n item: string | null = null;\n\n form: string | null | FormRenderer = null;\n\n private readonly __getItemRenderer = memoize((item: string | null) => {\n return new Function(\n 'ctx',\n `return ctx.html\\`\n <${item ?? 'foxy-null'}\n related=\\${JSON.stringify(ctx.related)}\n parent=\\${ctx.parent}\n infer=\"card\"\n href=$\\{ctx.href}\n ...=\\${ctx.spread(ctx.props)}\n >\n </${item ?? 'foxy-null'}>\\``\n ) as ItemRenderer;\n });\n\n renderControl(): TemplateResult {\n const dialogProps = {\n ...this.formProps,\n '.selectionProps': { '.filters': this.filters, '.first': this.first, '.item': this.item },\n };\n\n return html`\n <foxy-form-dialog\n parent=\"foxy://${this.virtualHost}/select\"\n header=\"header\"\n infer=\"dialog\"\n alert\n .props=${dialogProps}\n .form=${this.form ?? 'foxy-internal-resource-picker-control-form'}\n @fetch=${this.__handleFetchEvent}\n >\n </foxy-form-dialog>\n\n ${this.layout === 'summary-item'\n ? this.__renderSummaryItemLayout()\n : this.__renderStandaloneLayout()}\n `;\n }\n\n updated(changes: Map<keyof this, unknown>): void {\n super.updated(changes);\n if (changes.has('item')) this.__getItemRenderer.cache.clear?.();\n }\n\n private __clear(): void {\n this._value = '';\n this.dispatchEvent(new CustomEvent('clear'));\n }\n\n private __renderSummaryItemLayout() {\n const resource = this.renderRoot.querySelector<NucleonElement<any>>('#value');\n const onClick = (evt: Event) => {\n if (this.disabled || this.readonly) return;\n const button = evt.currentTarget as HTMLButtonElement;\n const dialog = this.renderRoot.querySelector('foxy-form-dialog') as FormDialog;\n\n dialog.href = '';\n dialog.show(button);\n };\n\n return html`\n <div class=\"flex items-start leading-xs gap-m\">\n <div class=\"flex-1\">\n <div class=\"text-m text-body whitespace-nowrap\">${this.label}</div>\n <div class=\"text-s text-secondary\">${this.helperText}</div>\n <div class=\"text-s text-error\" ?hidden=${this.disabled || this.readonly}>\n ${this._errorMessage}\n </div>\n </div>\n\n <div class=\"flex items-center gap-xs\">\n <button\n aria-label=${this.t('select')}\n class=${classMap({\n 'text-right min-w-0 transition-colors transition-opacity': true,\n 'rounded-s focus-outline-none focus-ring-2 focus-ring-primary-50': true,\n 'text-secondary': this.readonly,\n 'text-disabled': this.disabled,\n 'cursor-pointer text-body hover-opacity-80': !this.disabled && !this.readonly,\n 'font-medium': !this.readonly,\n })}\n ?disabled=${this.disabled || this.readonly}\n @click=${onClick}\n >\n <div class=\"truncate min-w-0\">\n ${this._value\n ? html`\n <foxy-i18n\n infer=\"\"\n key=\"value\"\n .options=${resource?.data\n ? this.getDisplayValueOptions(resource.data)\n : { context: resource?.in('fail') ? 'fail' : 'busy' }}\n >\n </foxy-i18n>\n `\n : this.placeholder}\n </div>\n </button>\n\n <button\n aria-label=${this.t('clear')}\n class=${classMap({\n 'rounded-full transition-colors': true,\n 'focus-outline-none focus-ring-2 focus-ring-primary-50': true,\n 'cursor-pointer text-tertiary hover-text-body': !this.disabled,\n 'cursor-default text-disabled': this.disabled,\n })}\n style=\"width: 1em; height: 1em;\"\n ?disabled=${this.disabled}\n ?hidden=${this.readonly || !this._value}\n @click=${this.__clear}\n >\n ${svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" style=\"width: 1em; height: 1em; transform: scale(1.25); margin-right: -0.16em\"><path d=\"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z\" /></svg>`}\n </button>\n </div>\n </div>\n\n <foxy-nucleon\n infer=\"\"\n href=${ifDefined(this._value || void 0)}\n id=\"value\"\n @update=${() => this.requestUpdate()}\n >\n </foxy-nucleon>\n `;\n }\n\n private __renderStandaloneLayout() {\n const selectionUrl = typeof this._value === 'string' ? this.getItemUrl?.(this._value) : void 0;\n const selectionId = typeof this._value === 'string' ? getResourceId(this._value) : void 0;\n\n return html`\n <div class=\"block group\">\n <div\n class=${classMap({\n 'flex items-center gap-m transition-colors mb-s font-medium text-l': true,\n 'text-disabled': this.disabled,\n })}\n >\n <span class=\"mr-auto\">${this.label}</span>\n ${selectionUrl\n ? html`\n <a\n class=\"text-body rounded transition-opacity hover-opacity-90 focus-outline-none focus-ring-2 focus-ring-primary-50\"\n href=${selectionUrl}\n >\n <foxy-i18n infer=\"\" key=\"view\"></foxy-i18n>\n </a>\n `\n : ''}\n ${this.showCopyIdButton && selectionId !== null\n ? html`\n <foxy-copy-to-clipboard\n layout=\"text\"\n theme=\"contrast tertiary-inline\"\n infer=\"copy-id\"\n text=${selectionId}\n >\n </foxy-copy-to-clipboard>\n `\n : ''}\n ${this.readonly || !this._value\n ? ''\n : html`\n <vaadin-button\n theme=\"error tertiary-inline\"\n ?disabled=${this.disabled}\n @click=${this.__clear}\n >\n <foxy-i18n infer=\"\" key=\"clear\"></foxy-i18n>\n </vaadin-button>\n `}\n </div>\n\n <button\n class=${classMap({\n 'block w-full bg-contrast-5 rounded text-left transition-colors': true,\n 'focus-outline-none focus-ring-2 focus-ring-primary-50': true,\n 'cursor-pointer hover-bg-contrast-10': !this.disabled && !this.readonly,\n 'cursor-default': this.disabled || this.readonly,\n })}\n style=\"padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)\"\n ?disabled=${this.disabled || this.readonly}\n @click=${(evt: MouseEvent) => {\n const button = evt.currentTarget as HTMLButtonElement;\n const dialog = this.renderRoot.querySelector('foxy-form-dialog') as FormDialog;\n\n dialog.href = '';\n dialog.show(button);\n }}\n >\n <div class=${classMap({ 'transition-opacity': true, 'opacity-50': this.disabled })}>\n ${this.__getItemRenderer(this.item)({\n html,\n data: null,\n href: (this._value as string | undefined) || '',\n related: [],\n parent: '',\n props: {},\n spread: spread,\n simplifyNsLoading: this.simplifyNsLoading,\n disabled: this.disabled,\n disabledControls: this.disabledControls,\n readonly: this.readonly,\n readonlyControls: this.readonlyControls,\n hidden: this.hidden,\n hiddenControls: this.hiddenControls,\n templates: this.templates,\n previous: null,\n next: null,\n group: this.nucleon?.group ?? '',\n lang: this.lang,\n ns: this.ns,\n })}\n </div>\n </button>\n\n <div\n class=${classMap({\n 'transition-colors mt-xs text-xs': true,\n 'text-secondary group-hover-text-body': !this.disabled && !this.readonly,\n 'text-secondary': this.readonly,\n 'text-disabled': this.disabled,\n })}\n ?hidden=${!this.helperText}\n >\n ${this.helperText}\n </div>\n\n <div\n class=\"mt-xs text-xs leading-xs text-error\"\n ?hidden=${!this._errorMessage || this.disabled || this.readonly}\n >\n ${this._errorMessage}\n </div>\n </div>\n `;\n }\n\n private __handleFetchEvent(event: Event) {\n if (!(event instanceof FetchEvent)) return;\n if (event.defaultPrevented) return;\n\n const { url, method } = event.request;\n\n if (url === `foxy://${this.virtualHost}/select` && method === 'POST') {\n return event.respondWith(this.__handleSelect(event.request));\n }\n\n if (url === `foxy://${this.virtualHost}/empty` && method === 'GET') {\n return event.respondWith(this.__handleEmpty());\n }\n }\n\n private async __handleSelect(request: Request): Promise<Response> {\n const body = (await request.clone().json()) as { selection: string };\n this._value = body.selection;\n return new Response(\n JSON.stringify({\n _links: { self: { href: `foxy://${this.virtualHost}/empty` } },\n message: 'Resource selected.',\n })\n );\n }\n\n private async __handleEmpty(): Promise<Response> {\n return new Response(\n JSON.stringify({\n _links: { self: { href: `foxy://${this.virtualHost}/empty` } },\n message: 'Resource selected.',\n })\n );\n }\n}\n"]}
@@ -1,6 +1,8 @@
1
+ import '@vaadin/vaadin-button';
1
2
  import '../InternalAsyncListControl/index';
2
3
  import '../InternalEditableControl/index';
3
4
  import '../InternalForm/index';
5
+ import '../../public/CopyToClipboard/index';
4
6
  import '../../public/NucleonElement/index';
5
7
  import '../../public/FormDialog/index';
6
8
  import '../../public/I18n/index';
@@ -1,6 +1,8 @@
1
+ import '@vaadin/vaadin-button';
1
2
  import "../InternalAsyncListControl/index.js";
2
3
  import "../InternalEditableControl/index.js";
3
4
  import "../InternalForm/index.js";
5
+ import "../../public/CopyToClipboard/index.js";
4
6
  import "../../public/NucleonElement/index.js";
5
7
  import "../../public/FormDialog/index.js";
6
8
  import "../../public/I18n/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalResourcePickerControl/index.ts"],"names":[],"mappings":"AAAA,8CAA2C;AAC3C,6CAA0C;AAC1C,kCAA+B;AAE/B,8CAA2C;AAC3C,0CAAuC;AACvC,oCAAiC;AAEjC,OAAO,EAAE,iCAAiC,EAAE,+CAA4C;AACxF,OAAO,EAAE,6BAA6B,EAAE,2CAAwC;AAEhF,cAAc,CAAC,MAAM,CACnB,4CAA4C,EAC5C,iCAAiC,CAClC,CAAC;AAEF,cAAc,CAAC,MAAM,CAAC,uCAAuC,EAAE,6BAA6B,CAAC,CAAC;AAE9F,OAAO,EAAE,6BAA6B,EAAE,CAAC","sourcesContent":["import '../InternalAsyncListControl/index';\nimport '../InternalEditableControl/index';\nimport '../InternalForm/index';\n\nimport '../../public/NucleonElement/index';\nimport '../../public/FormDialog/index';\nimport '../../public/I18n/index';\n\nimport { InternalResourcePickerControlForm } from './InternalResourcePickerControlForm';\nimport { InternalResourcePickerControl } from './InternalResourcePickerControl';\n\ncustomElements.define(\n 'foxy-internal-resource-picker-control-form',\n InternalResourcePickerControlForm\n);\n\ncustomElements.define('foxy-internal-resource-picker-control', InternalResourcePickerControl);\n\nexport { InternalResourcePickerControl };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalResourcePickerControl/index.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAC;AAE/B,8CAA2C;AAC3C,6CAA0C;AAC1C,kCAA+B;AAE/B,+CAA4C;AAC5C,8CAA2C;AAC3C,0CAAuC;AACvC,oCAAiC;AAEjC,OAAO,EAAE,iCAAiC,EAAE,+CAA4C;AACxF,OAAO,EAAE,6BAA6B,EAAE,2CAAwC;AAEhF,cAAc,CAAC,MAAM,CACnB,4CAA4C,EAC5C,iCAAiC,CAClC,CAAC;AAEF,cAAc,CAAC,MAAM,CAAC,uCAAuC,EAAE,6BAA6B,CAAC,CAAC;AAE9F,OAAO,EAAE,6BAA6B,EAAE,CAAC","sourcesContent":["import '@vaadin/vaadin-button';\n\nimport '../InternalAsyncListControl/index';\nimport '../InternalEditableControl/index';\nimport '../InternalForm/index';\n\nimport '../../public/CopyToClipboard/index';\nimport '../../public/NucleonElement/index';\nimport '../../public/FormDialog/index';\nimport '../../public/I18n/index';\n\nimport { InternalResourcePickerControlForm } from './InternalResourcePickerControlForm';\nimport { InternalResourcePickerControl } from './InternalResourcePickerControl';\n\ncustomElements.define(\n 'foxy-internal-resource-picker-control-form',\n InternalResourcePickerControlForm\n);\n\ncustomElements.define('foxy-internal-resource-picker-control', InternalResourcePickerControl);\n\nexport { InternalResourcePickerControl };\n"]}
@@ -18,6 +18,8 @@ export declare class CartForm extends Base<Data> {
18
18
  static get v8n(): NucleonV8N<Data>;
19
19
  /** Payment Card Embed configuration URL. The form will append template set parameter on its own. */
20
20
  paymentCardEmbedUrl: string | null;
21
+ /** When configured, Customer section will include a link generated by this function. */
22
+ getCustomerPageUrl: ((id: string) => string) | null;
21
23
  /** URL of the `fx:item_categories` collection for the store. */
22
24
  itemCategories: string | null;
23
25
  /** URL of the `fx:template_sets` collection for the store. */