@jumpgroup/jump-design-system 0.3.8 → 0.3.14

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 (129) hide show
  1. package/dist/cjs/chunk.H33C3MRM-2c09acb5.js +547 -0
  2. package/dist/cjs/chunk.H33C3MRM-2c09acb5.js.map +1 -0
  3. package/dist/cjs/jump-button_2.cjs.entry.js +3 -525
  4. package/dist/cjs/jump-button_2.cjs.entry.js.map +1 -1
  5. package/dist/cjs/jump-design-system.cjs.js +1 -1
  6. package/dist/cjs/jump-filter-checkbox.cjs.entry.js +845 -0
  7. package/dist/cjs/jump-filter-checkbox.cjs.entry.js.map +1 -0
  8. package/dist/cjs/jump-filter.cjs.entry.js +5 -4
  9. package/dist/cjs/jump-filter.cjs.entry.js.map +1 -1
  10. package/dist/cjs/jump-filtergroup.cjs.entry.js +19 -3
  11. package/dist/cjs/jump-filtergroup.cjs.entry.js.map +1 -1
  12. package/dist/cjs/jump-pagination-table.cjs.entry.js +17 -18
  13. package/dist/cjs/jump-pagination-table.cjs.entry.js.map +1 -1
  14. package/dist/cjs/jump-pagination.cjs.entry.js +3 -3
  15. package/dist/cjs/jump-quantity.cjs.entry.js +4 -4
  16. package/dist/cjs/jump-quantity.cjs.entry.js.map +1 -1
  17. package/dist/cjs/jump-tab-item.cjs.entry.js +2 -2
  18. package/dist/cjs/jump-tab-panel.cjs.entry.js +1 -1
  19. package/dist/cjs/jump-tab.cjs.entry.js +1 -1
  20. package/dist/cjs/loader.cjs.js +1 -1
  21. package/dist/collection/collection-manifest.json +1 -0
  22. package/dist/collection/components/jump-filter/jump-filter.css +8 -1
  23. package/dist/collection/components/jump-filter/jump-filter.js +5 -4
  24. package/dist/collection/components/jump-filter/jump-filter.js.map +1 -1
  25. package/dist/collection/components/jump-filter/jump-filter.stories.js +5 -4
  26. package/dist/collection/components/jump-filter/jump-filter.stories.js.map +1 -1
  27. package/dist/collection/components/jump-filter-checkbox/jump-filter-checkbox.css +31 -0
  28. package/dist/collection/components/jump-filter-checkbox/jump-filter-checkbox.js +161 -0
  29. package/dist/collection/components/jump-filter-checkbox/jump-filter-checkbox.js.map +1 -0
  30. package/dist/collection/components/jump-filter-checkbox/jump-filter-checkbox.stories.js +51 -0
  31. package/dist/collection/components/jump-filter-checkbox/jump-filter-checkbox.stories.js.map +1 -0
  32. package/dist/collection/components/jump-filtergroup/jump-filtergroup.js +21 -5
  33. package/dist/collection/components/jump-filtergroup/jump-filtergroup.js.map +1 -1
  34. package/dist/collection/components/jump-filtergroup/jump-filtergroup.stories.js +1 -1
  35. package/dist/collection/components/jump-filtergroup/jump-filtergroup.stories.js.map +1 -1
  36. package/dist/collection/components/jump-pagination/jump-pagination.js +3 -3
  37. package/dist/collection/components/jump-pagination-table/jump-pagination-table.js +31 -45
  38. package/dist/collection/components/jump-pagination-table/jump-pagination-table.js.map +1 -1
  39. package/dist/collection/components/jump-pagination-table/jump-pagination-table.stories.js +6 -14
  40. package/dist/collection/components/jump-pagination-table/jump-pagination-table.stories.js.map +1 -1
  41. package/dist/collection/components/jump-quantity/jump-quantity.css +6 -3
  42. package/dist/collection/components/jump-quantity/jump-quantity.js +3 -3
  43. package/dist/collection/components/jump-quantity/jump-quantity.js.map +1 -1
  44. package/dist/collection/components/jump-tab/jump-tab.js +1 -1
  45. package/dist/collection/components/jump-tab-item/jump-tab-item.js +2 -2
  46. package/dist/collection/components/jump-tab-panel/jump-tab-panel.js +1 -1
  47. package/dist/components/chunk.H33C3MRM.js +529 -0
  48. package/dist/components/chunk.H33C3MRM.js.map +1 -0
  49. package/dist/components/jump-filter-checkbox.d.ts +11 -0
  50. package/dist/components/jump-filter-checkbox.js +865 -0
  51. package/dist/components/jump-filter-checkbox.js.map +1 -0
  52. package/dist/components/jump-filter.js +5 -4
  53. package/dist/components/jump-filter.js.map +1 -1
  54. package/dist/components/jump-filtergroup.js +20 -4
  55. package/dist/components/jump-filtergroup.js.map +1 -1
  56. package/dist/components/jump-icon2.js +6 -528
  57. package/dist/components/jump-icon2.js.map +1 -1
  58. package/dist/components/jump-pagination-table.js +22 -21
  59. package/dist/components/jump-pagination-table.js.map +1 -1
  60. package/dist/components/jump-pagination.js +3 -3
  61. package/dist/components/jump-quantity.js +4 -4
  62. package/dist/components/jump-quantity.js.map +1 -1
  63. package/dist/components/jump-tab-item.js +2 -2
  64. package/dist/components/jump-tab-panel.js +1 -1
  65. package/dist/components/jump-tab.js +1 -1
  66. package/dist/esm/chunk.H33C3MRM-d1872e67.js +529 -0
  67. package/dist/esm/chunk.H33C3MRM-d1872e67.js.map +1 -0
  68. package/dist/esm/jump-button_2.entry.js +6 -528
  69. package/dist/esm/jump-button_2.entry.js.map +1 -1
  70. package/dist/esm/jump-design-system.js +1 -1
  71. package/dist/esm/jump-filter-checkbox.entry.js +841 -0
  72. package/dist/esm/jump-filter-checkbox.entry.js.map +1 -0
  73. package/dist/esm/jump-filter.entry.js +5 -4
  74. package/dist/esm/jump-filter.entry.js.map +1 -1
  75. package/dist/esm/jump-filtergroup.entry.js +19 -3
  76. package/dist/esm/jump-filtergroup.entry.js.map +1 -1
  77. package/dist/esm/jump-pagination-table.entry.js +17 -18
  78. package/dist/esm/jump-pagination-table.entry.js.map +1 -1
  79. package/dist/esm/jump-pagination.entry.js +3 -3
  80. package/dist/esm/jump-quantity.entry.js +4 -4
  81. package/dist/esm/jump-quantity.entry.js.map +1 -1
  82. package/dist/esm/jump-tab-item.entry.js +2 -2
  83. package/dist/esm/jump-tab-panel.entry.js +1 -1
  84. package/dist/esm/jump-tab.entry.js +1 -1
  85. package/dist/esm/loader.js +1 -1
  86. package/dist/jump-design-system/jump-design-system.esm.js +1 -1
  87. package/dist/jump-design-system/jump-design-system.esm.js.map +1 -1
  88. package/dist/jump-design-system/{p-95460fa4.entry.js → p-4302b229.entry.js} +2 -2
  89. package/dist/jump-design-system/p-60849b83.entry.js +2 -0
  90. package/dist/jump-design-system/p-60849b83.entry.js.map +1 -0
  91. package/dist/jump-design-system/p-839e054d.entry.js +2 -0
  92. package/dist/jump-design-system/p-839e054d.entry.js.map +1 -0
  93. package/dist/jump-design-system/{p-d2ee7b9b.entry.js → p-9d9b0076.entry.js} +2 -2
  94. package/dist/jump-design-system/p-a00d20d8.entry.js +264 -0
  95. package/dist/jump-design-system/p-a00d20d8.entry.js.map +1 -0
  96. package/dist/jump-design-system/p-a41ca036.entry.js +2 -0
  97. package/dist/jump-design-system/p-a41ca036.entry.js.map +1 -0
  98. package/dist/jump-design-system/p-a4b9515b.js +66 -0
  99. package/dist/jump-design-system/p-a4b9515b.js.map +1 -0
  100. package/dist/jump-design-system/p-aee5a8c3.entry.js +2 -0
  101. package/dist/jump-design-system/p-c8733544.entry.js +2 -0
  102. package/dist/jump-design-system/p-c8733544.entry.js.map +1 -0
  103. package/dist/jump-design-system/{p-8efeaa79.entry.js → p-ed897778.entry.js} +2 -2
  104. package/dist/jump-design-system/p-fde99383.entry.js +2 -0
  105. package/dist/jump-design-system/p-fde99383.entry.js.map +1 -0
  106. package/dist/jump-design-system-elements.json +31 -6
  107. package/dist/types/components/jump-filter-checkbox/jump-filter-checkbox.d.ts +15 -0
  108. package/dist/types/components/jump-filter-checkbox/jump-filter-checkbox.stories.d.ts +30 -0
  109. package/dist/types/components/jump-filtergroup/jump-filtergroup.d.ts +2 -1
  110. package/dist/types/components/jump-filtergroup/jump-filtergroup.stories.d.ts +1 -1
  111. package/dist/types/components/jump-pagination-table/jump-pagination-table.d.ts +3 -1
  112. package/dist/types/components/jump-pagination-table/jump-pagination-table.stories.d.ts +1 -6
  113. package/dist/types/components.d.ts +42 -12
  114. package/package.json +1 -1
  115. package/dist/jump-design-system/p-529a09f6.entry.js +0 -2
  116. package/dist/jump-design-system/p-529a09f6.entry.js.map +0 -1
  117. package/dist/jump-design-system/p-594b15ee.entry.js +0 -2
  118. package/dist/jump-design-system/p-594b15ee.entry.js.map +0 -1
  119. package/dist/jump-design-system/p-5da7839d.entry.js +0 -2
  120. package/dist/jump-design-system/p-8628896f.entry.js +0 -2
  121. package/dist/jump-design-system/p-8628896f.entry.js.map +0 -1
  122. package/dist/jump-design-system/p-c2bc6395.entry.js +0 -66
  123. package/dist/jump-design-system/p-c2bc6395.entry.js.map +0 -1
  124. package/dist/jump-design-system/p-d1e411fd.entry.js +0 -2
  125. package/dist/jump-design-system/p-d1e411fd.entry.js.map +0 -1
  126. /package/dist/jump-design-system/{p-95460fa4.entry.js.map → p-4302b229.entry.js.map} +0 -0
  127. /package/dist/jump-design-system/{p-d2ee7b9b.entry.js.map → p-9d9b0076.entry.js.map} +0 -0
  128. /package/dist/jump-design-system/{p-5da7839d.entry.js.map → p-aee5a8c3.entry.js.map} +0 -0
  129. /package/dist/jump-design-system/{p-8efeaa79.entry.js.map → p-ed897778.entry.js.map} +0 -0
@@ -0,0 +1,865 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { i as i$1, u, _ as __spreadProps, a as __spreadValues, w, T, f, m, c as component_styles_default, S as SlIcon, b as __decorateClass, d as watch, e as ShoelaceElement, x, g as r, n } from './chunk.H33C3MRM.js';
3
+
4
+ /**
5
+ * @license
6
+ * Copyright 2017 Google LLC
7
+ * SPDX-License-Identifier: BSD-3-Clause
8
+ */
9
+ const e$3=(e,t,c)=>(c.configurable=!0,c.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,c),c);
10
+
11
+ /**
12
+ * @license
13
+ * Copyright 2017 Google LLC
14
+ * SPDX-License-Identifier: BSD-3-Clause
15
+ */function e$2(e,r){return (n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;if(r){const{get:e,set:r}="object"==typeof s?n:i??(()=>{const t=Symbol();return {get(){return this[t]},set(e){this[t]=e;}}})();return e$3(n,s,{get(){let t=e.call(this);return void 0===t&&(t=o(this),(null!==t||this.hasUpdated)&&r.call(this,t)),t}})}return e$3(n,s,{get(){return o(this)}})}}
16
+
17
+ // src/components/checkbox/checkbox.styles.ts
18
+ var checkbox_styles_default = i$1`
19
+ :host {
20
+ display: inline-block;
21
+ }
22
+
23
+ .checkbox {
24
+ position: relative;
25
+ display: inline-flex;
26
+ align-items: flex-start;
27
+ font-family: var(--sl-input-font-family);
28
+ font-weight: var(--sl-input-font-weight);
29
+ color: var(--sl-input-label-color);
30
+ vertical-align: middle;
31
+ cursor: pointer;
32
+ }
33
+
34
+ .checkbox--small {
35
+ --toggle-size: var(--sl-toggle-size-small);
36
+ font-size: var(--sl-input-font-size-small);
37
+ }
38
+
39
+ .checkbox--medium {
40
+ --toggle-size: var(--sl-toggle-size-medium);
41
+ font-size: var(--sl-input-font-size-medium);
42
+ }
43
+
44
+ .checkbox--large {
45
+ --toggle-size: var(--sl-toggle-size-large);
46
+ font-size: var(--sl-input-font-size-large);
47
+ }
48
+
49
+ .checkbox__control {
50
+ flex: 0 0 auto;
51
+ position: relative;
52
+ display: inline-flex;
53
+ align-items: center;
54
+ justify-content: center;
55
+ width: var(--toggle-size);
56
+ height: var(--toggle-size);
57
+ border: solid var(--sl-input-border-width) var(--sl-input-border-color);
58
+ border-radius: 2px;
59
+ background-color: var(--sl-input-background-color);
60
+ color: var(--sl-color-neutral-0);
61
+ transition:
62
+ var(--sl-transition-fast) border-color,
63
+ var(--sl-transition-fast) background-color,
64
+ var(--sl-transition-fast) color,
65
+ var(--sl-transition-fast) box-shadow;
66
+ }
67
+
68
+ .checkbox__input {
69
+ position: absolute;
70
+ opacity: 0;
71
+ padding: 0;
72
+ margin: 0;
73
+ pointer-events: none;
74
+ }
75
+
76
+ .checkbox__checked-icon,
77
+ .checkbox__indeterminate-icon {
78
+ display: inline-flex;
79
+ width: var(--toggle-size);
80
+ height: var(--toggle-size);
81
+ }
82
+
83
+ /* Hover */
84
+ .checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__control:hover {
85
+ border-color: var(--sl-input-border-color-hover);
86
+ background-color: var(--sl-input-background-color-hover);
87
+ }
88
+
89
+ /* Focus */
90
+ .checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control {
91
+ outline: var(--sl-focus-ring);
92
+ outline-offset: var(--sl-focus-ring-offset);
93
+ }
94
+
95
+ /* Checked/indeterminate */
96
+ .checkbox--checked .checkbox__control,
97
+ .checkbox--indeterminate .checkbox__control {
98
+ border-color: var(--sl-color-primary-600);
99
+ background-color: var(--sl-color-primary-600);
100
+ }
101
+
102
+ /* Checked/indeterminate + hover */
103
+ .checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__control:hover,
104
+ .checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__control:hover {
105
+ border-color: var(--sl-color-primary-500);
106
+ background-color: var(--sl-color-primary-500);
107
+ }
108
+
109
+ /* Checked/indeterminate + focus */
110
+ .checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control,
111
+ .checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control {
112
+ outline: var(--sl-focus-ring);
113
+ outline-offset: var(--sl-focus-ring-offset);
114
+ }
115
+
116
+ /* Disabled */
117
+ .checkbox--disabled {
118
+ opacity: 0.5;
119
+ cursor: not-allowed;
120
+ }
121
+
122
+ .checkbox__label {
123
+ display: inline-block;
124
+ color: var(--sl-input-label-color);
125
+ line-height: var(--toggle-size);
126
+ margin-inline-start: 0.5em;
127
+ user-select: none;
128
+ -webkit-user-select: none;
129
+ }
130
+
131
+ :host([required]) .checkbox__label::after {
132
+ content: var(--sl-input-required-content);
133
+ color: var(--sl-input-required-content-color);
134
+ margin-inline-start: var(--sl-input-required-content-offset);
135
+ }
136
+ `;
137
+
138
+ // src/internal/default-value.ts
139
+ var defaultValue = (propertyName = "value") => (proto, key) => {
140
+ const ctor = proto.constructor;
141
+ const attributeChangedCallback = ctor.prototype.attributeChangedCallback;
142
+ ctor.prototype.attributeChangedCallback = function(name, old, value) {
143
+ var _a;
144
+ const options = ctor.getPropertyOptions(propertyName);
145
+ const attributeName = typeof options.attribute === "string" ? options.attribute : propertyName;
146
+ if (name === attributeName) {
147
+ const converter = options.converter || u;
148
+ const fromAttribute = typeof converter === "function" ? converter : (_a = converter == null ? void 0 : converter.fromAttribute) != null ? _a : u.fromAttribute;
149
+ const newValue = fromAttribute(value, options.type);
150
+ if (this[propertyName] !== newValue) {
151
+ this[key] = newValue;
152
+ }
153
+ }
154
+ attributeChangedCallback.call(this, name, old, value);
155
+ };
156
+ };
157
+
158
+ // src/styles/form-control.styles.ts
159
+ var form_control_styles_default = i$1`
160
+ .form-control .form-control__label {
161
+ display: none;
162
+ }
163
+
164
+ .form-control .form-control__help-text {
165
+ display: none;
166
+ }
167
+
168
+ /* Label */
169
+ .form-control--has-label .form-control__label {
170
+ display: inline-block;
171
+ color: var(--sl-input-label-color);
172
+ margin-bottom: var(--sl-spacing-3x-small);
173
+ }
174
+
175
+ .form-control--has-label.form-control--small .form-control__label {
176
+ font-size: var(--sl-input-label-font-size-small);
177
+ }
178
+
179
+ .form-control--has-label.form-control--medium .form-control__label {
180
+ font-size: var(--sl-input-label-font-size-medium);
181
+ }
182
+
183
+ .form-control--has-label.form-control--large .form-control__label {
184
+ font-size: var(--sl-input-label-font-size-large);
185
+ }
186
+
187
+ :host([required]) .form-control--has-label .form-control__label::after {
188
+ content: var(--sl-input-required-content);
189
+ margin-inline-start: var(--sl-input-required-content-offset);
190
+ color: var(--sl-input-required-content-color);
191
+ }
192
+
193
+ /* Help text */
194
+ .form-control--has-help-text .form-control__help-text {
195
+ display: block;
196
+ color: var(--sl-input-help-text-color);
197
+ margin-top: var(--sl-spacing-3x-small);
198
+ }
199
+
200
+ .form-control--has-help-text.form-control--small .form-control__help-text {
201
+ font-size: var(--sl-input-help-text-font-size-small);
202
+ }
203
+
204
+ .form-control--has-help-text.form-control--medium .form-control__help-text {
205
+ font-size: var(--sl-input-help-text-font-size-medium);
206
+ }
207
+
208
+ .form-control--has-help-text.form-control--large .form-control__help-text {
209
+ font-size: var(--sl-input-help-text-font-size-large);
210
+ }
211
+
212
+ .form-control--has-help-text.form-control--radio-group .form-control__help-text {
213
+ margin-top: var(--sl-spacing-2x-small);
214
+ }
215
+ `;
216
+
217
+ // src/internal/form.ts
218
+ var formCollections = /* @__PURE__ */ new WeakMap();
219
+ var reportValidityOverloads = /* @__PURE__ */ new WeakMap();
220
+ var checkValidityOverloads = /* @__PURE__ */ new WeakMap();
221
+ var userInteractedControls = /* @__PURE__ */ new WeakSet();
222
+ var interactions = /* @__PURE__ */ new WeakMap();
223
+ var FormControlController = class {
224
+ constructor(host, options) {
225
+ this.handleFormData = (event) => {
226
+ const disabled = this.options.disabled(this.host);
227
+ const name = this.options.name(this.host);
228
+ const value = this.options.value(this.host);
229
+ const isButton = this.host.tagName.toLowerCase() === "sl-button";
230
+ if (this.host.isConnected && !disabled && !isButton && typeof name === "string" && name.length > 0 && typeof value !== "undefined") {
231
+ if (Array.isArray(value)) {
232
+ value.forEach((val) => {
233
+ event.formData.append(name, val.toString());
234
+ });
235
+ } else {
236
+ event.formData.append(name, value.toString());
237
+ }
238
+ }
239
+ };
240
+ this.handleFormSubmit = (event) => {
241
+ var _a;
242
+ const disabled = this.options.disabled(this.host);
243
+ const reportValidity = this.options.reportValidity;
244
+ if (this.form && !this.form.noValidate) {
245
+ (_a = formCollections.get(this.form)) == null ? void 0 : _a.forEach((control) => {
246
+ this.setUserInteracted(control, true);
247
+ });
248
+ }
249
+ if (this.form && !this.form.noValidate && !disabled && !reportValidity(this.host)) {
250
+ event.preventDefault();
251
+ event.stopImmediatePropagation();
252
+ }
253
+ };
254
+ this.handleFormReset = () => {
255
+ this.options.setValue(this.host, this.options.defaultValue(this.host));
256
+ this.setUserInteracted(this.host, false);
257
+ interactions.set(this.host, []);
258
+ };
259
+ this.handleInteraction = (event) => {
260
+ const emittedEvents = interactions.get(this.host);
261
+ if (!emittedEvents.includes(event.type)) {
262
+ emittedEvents.push(event.type);
263
+ }
264
+ if (emittedEvents.length === this.options.assumeInteractionOn.length) {
265
+ this.setUserInteracted(this.host, true);
266
+ }
267
+ };
268
+ this.checkFormValidity = () => {
269
+ if (this.form && !this.form.noValidate) {
270
+ const elements = this.form.querySelectorAll("*");
271
+ for (const element of elements) {
272
+ if (typeof element.checkValidity === "function") {
273
+ if (!element.checkValidity()) {
274
+ return false;
275
+ }
276
+ }
277
+ }
278
+ }
279
+ return true;
280
+ };
281
+ this.reportFormValidity = () => {
282
+ if (this.form && !this.form.noValidate) {
283
+ const elements = this.form.querySelectorAll("*");
284
+ for (const element of elements) {
285
+ if (typeof element.reportValidity === "function") {
286
+ if (!element.reportValidity()) {
287
+ return false;
288
+ }
289
+ }
290
+ }
291
+ }
292
+ return true;
293
+ };
294
+ (this.host = host).addController(this);
295
+ this.options = __spreadValues({
296
+ form: (input) => {
297
+ const formId = input.form;
298
+ if (formId) {
299
+ const root = input.getRootNode();
300
+ const form = root.querySelector(`#${formId}`);
301
+ if (form) {
302
+ return form;
303
+ }
304
+ }
305
+ return input.closest("form");
306
+ },
307
+ name: (input) => input.name,
308
+ value: (input) => input.value,
309
+ defaultValue: (input) => input.defaultValue,
310
+ disabled: (input) => {
311
+ var _a;
312
+ return (_a = input.disabled) != null ? _a : false;
313
+ },
314
+ reportValidity: (input) => typeof input.reportValidity === "function" ? input.reportValidity() : true,
315
+ checkValidity: (input) => typeof input.checkValidity === "function" ? input.checkValidity() : true,
316
+ setValue: (input, value) => input.value = value,
317
+ assumeInteractionOn: ["sl-input"]
318
+ }, options);
319
+ }
320
+ hostConnected() {
321
+ const form = this.options.form(this.host);
322
+ if (form) {
323
+ this.attachForm(form);
324
+ }
325
+ interactions.set(this.host, []);
326
+ this.options.assumeInteractionOn.forEach((event) => {
327
+ this.host.addEventListener(event, this.handleInteraction);
328
+ });
329
+ }
330
+ hostDisconnected() {
331
+ this.detachForm();
332
+ interactions.delete(this.host);
333
+ this.options.assumeInteractionOn.forEach((event) => {
334
+ this.host.removeEventListener(event, this.handleInteraction);
335
+ });
336
+ }
337
+ hostUpdated() {
338
+ const form = this.options.form(this.host);
339
+ if (!form) {
340
+ this.detachForm();
341
+ }
342
+ if (form && this.form !== form) {
343
+ this.detachForm();
344
+ this.attachForm(form);
345
+ }
346
+ if (this.host.hasUpdated) {
347
+ this.setValidity(this.host.validity.valid);
348
+ }
349
+ }
350
+ attachForm(form) {
351
+ if (form) {
352
+ this.form = form;
353
+ if (formCollections.has(this.form)) {
354
+ formCollections.get(this.form).add(this.host);
355
+ } else {
356
+ formCollections.set(this.form, /* @__PURE__ */ new Set([this.host]));
357
+ }
358
+ this.form.addEventListener("formdata", this.handleFormData);
359
+ this.form.addEventListener("submit", this.handleFormSubmit);
360
+ this.form.addEventListener("reset", this.handleFormReset);
361
+ if (!reportValidityOverloads.has(this.form)) {
362
+ reportValidityOverloads.set(this.form, this.form.reportValidity);
363
+ this.form.reportValidity = () => this.reportFormValidity();
364
+ }
365
+ if (!checkValidityOverloads.has(this.form)) {
366
+ checkValidityOverloads.set(this.form, this.form.checkValidity);
367
+ this.form.checkValidity = () => this.checkFormValidity();
368
+ }
369
+ } else {
370
+ this.form = void 0;
371
+ }
372
+ }
373
+ detachForm() {
374
+ if (!this.form)
375
+ return;
376
+ const formCollection = formCollections.get(this.form);
377
+ if (!formCollection) {
378
+ return;
379
+ }
380
+ formCollection.delete(this.host);
381
+ if (formCollection.size <= 0) {
382
+ this.form.removeEventListener("formdata", this.handleFormData);
383
+ this.form.removeEventListener("submit", this.handleFormSubmit);
384
+ this.form.removeEventListener("reset", this.handleFormReset);
385
+ if (reportValidityOverloads.has(this.form)) {
386
+ this.form.reportValidity = reportValidityOverloads.get(this.form);
387
+ reportValidityOverloads.delete(this.form);
388
+ }
389
+ if (checkValidityOverloads.has(this.form)) {
390
+ this.form.checkValidity = checkValidityOverloads.get(this.form);
391
+ checkValidityOverloads.delete(this.form);
392
+ }
393
+ this.form = void 0;
394
+ }
395
+ }
396
+ setUserInteracted(el, hasInteracted) {
397
+ if (hasInteracted) {
398
+ userInteractedControls.add(el);
399
+ } else {
400
+ userInteractedControls.delete(el);
401
+ }
402
+ el.requestUpdate();
403
+ }
404
+ doAction(type, submitter) {
405
+ if (this.form) {
406
+ const button = document.createElement("button");
407
+ button.type = type;
408
+ button.style.position = "absolute";
409
+ button.style.width = "0";
410
+ button.style.height = "0";
411
+ button.style.clipPath = "inset(50%)";
412
+ button.style.overflow = "hidden";
413
+ button.style.whiteSpace = "nowrap";
414
+ if (submitter) {
415
+ button.name = submitter.name;
416
+ button.value = submitter.value;
417
+ ["formaction", "formenctype", "formmethod", "formnovalidate", "formtarget"].forEach((attr) => {
418
+ if (submitter.hasAttribute(attr)) {
419
+ button.setAttribute(attr, submitter.getAttribute(attr));
420
+ }
421
+ });
422
+ }
423
+ this.form.append(button);
424
+ button.click();
425
+ button.remove();
426
+ }
427
+ }
428
+ /** Returns the associated `<form>` element, if one exists. */
429
+ getForm() {
430
+ var _a;
431
+ return (_a = this.form) != null ? _a : null;
432
+ }
433
+ /** Resets the form, restoring all the control to their default value */
434
+ reset(submitter) {
435
+ this.doAction("reset", submitter);
436
+ }
437
+ /** Submits the form, triggering validation and form data injection. */
438
+ submit(submitter) {
439
+ this.doAction("submit", submitter);
440
+ }
441
+ /**
442
+ * Synchronously sets the form control's validity. Call this when you know the future validity but need to update
443
+ * the host element immediately, i.e. before Lit updates the component in the next update.
444
+ */
445
+ setValidity(isValid) {
446
+ const host = this.host;
447
+ const hasInteracted = Boolean(userInteractedControls.has(host));
448
+ const required = Boolean(host.required);
449
+ host.toggleAttribute("data-required", required);
450
+ host.toggleAttribute("data-optional", !required);
451
+ host.toggleAttribute("data-invalid", !isValid);
452
+ host.toggleAttribute("data-valid", isValid);
453
+ host.toggleAttribute("data-user-invalid", !isValid && hasInteracted);
454
+ host.toggleAttribute("data-user-valid", isValid && hasInteracted);
455
+ }
456
+ /**
457
+ * Updates the form control's validity based on the current value of `host.validity.valid`. Call this when anything
458
+ * that affects constraint validation changes so the component receives the correct validity states.
459
+ */
460
+ updateValidity() {
461
+ const host = this.host;
462
+ this.setValidity(host.validity.valid);
463
+ }
464
+ /**
465
+ * Dispatches a non-bubbling, cancelable custom event of type `sl-invalid`.
466
+ * If the `sl-invalid` event will be cancelled then the original `invalid`
467
+ * event (which may have been passed as argument) will also be cancelled.
468
+ * If no original `invalid` event has been passed then the `sl-invalid`
469
+ * event will be cancelled before being dispatched.
470
+ */
471
+ emitInvalidEvent(originalInvalidEvent) {
472
+ const slInvalidEvent = new CustomEvent("sl-invalid", {
473
+ bubbles: false,
474
+ composed: false,
475
+ cancelable: true,
476
+ detail: {}
477
+ });
478
+ if (!originalInvalidEvent) {
479
+ slInvalidEvent.preventDefault();
480
+ }
481
+ if (!this.host.dispatchEvent(slInvalidEvent)) {
482
+ originalInvalidEvent == null ? void 0 : originalInvalidEvent.preventDefault();
483
+ }
484
+ }
485
+ };
486
+ var validValidityState = Object.freeze({
487
+ badInput: false,
488
+ customError: false,
489
+ patternMismatch: false,
490
+ rangeOverflow: false,
491
+ rangeUnderflow: false,
492
+ stepMismatch: false,
493
+ tooLong: false,
494
+ tooShort: false,
495
+ typeMismatch: false,
496
+ valid: true,
497
+ valueMissing: false
498
+ });
499
+ Object.freeze(__spreadProps(__spreadValues({}, validValidityState), {
500
+ valid: false,
501
+ valueMissing: true
502
+ }));
503
+ Object.freeze(__spreadProps(__spreadValues({}, validValidityState), {
504
+ valid: false,
505
+ customError: true
506
+ }));
507
+
508
+ // src/internal/slot.ts
509
+ var HasSlotController = class {
510
+ constructor(host, ...slotNames) {
511
+ this.slotNames = [];
512
+ this.handleSlotChange = (event) => {
513
+ const slot = event.target;
514
+ if (this.slotNames.includes("[default]") && !slot.name || slot.name && this.slotNames.includes(slot.name)) {
515
+ this.host.requestUpdate();
516
+ }
517
+ };
518
+ (this.host = host).addController(this);
519
+ this.slotNames = slotNames;
520
+ }
521
+ hasDefaultSlot() {
522
+ return [...this.host.childNodes].some((node) => {
523
+ if (node.nodeType === node.TEXT_NODE && node.textContent.trim() !== "") {
524
+ return true;
525
+ }
526
+ if (node.nodeType === node.ELEMENT_NODE) {
527
+ const el = node;
528
+ const tagName = el.tagName.toLowerCase();
529
+ if (tagName === "sl-visually-hidden") {
530
+ return false;
531
+ }
532
+ if (!el.hasAttribute("slot")) {
533
+ return true;
534
+ }
535
+ }
536
+ return false;
537
+ });
538
+ }
539
+ hasNamedSlot(name) {
540
+ return this.host.querySelector(`:scope > [slot="${name}"]`) !== null;
541
+ }
542
+ test(slotName) {
543
+ return slotName === "[default]" ? this.hasDefaultSlot() : this.hasNamedSlot(slotName);
544
+ }
545
+ hostConnected() {
546
+ this.host.shadowRoot.addEventListener("slotchange", this.handleSlotChange);
547
+ }
548
+ hostDisconnected() {
549
+ this.host.shadowRoot.removeEventListener("slotchange", this.handleSlotChange);
550
+ }
551
+ };
552
+
553
+ /**
554
+ * @license
555
+ * Copyright 2017 Google LLC
556
+ * SPDX-License-Identifier: BSD-3-Clause
557
+ */
558
+ const t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e$1=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
559
+
560
+ /**
561
+ * @license
562
+ * Copyright 2018 Google LLC
563
+ * SPDX-License-Identifier: BSD-3-Clause
564
+ */const e=e$1(class extends i{constructor(t$1){if(super(t$1),t$1.type!==t.ATTRIBUTE||"class"!==t$1.name||t$1.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return " "+Object.keys(t).filter((s=>t[s])).join(" ")+" "}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)));}return w}});
565
+
566
+ /**
567
+ * @license
568
+ * Copyright 2018 Google LLC
569
+ * SPDX-License-Identifier: BSD-3-Clause
570
+ */const o=o=>o??T;
571
+
572
+ /**
573
+ * @license
574
+ * Copyright 2020 Google LLC
575
+ * SPDX-License-Identifier: BSD-3-Clause
576
+ */const l=e$1(class extends i{constructor(r){if(super(r),r.type!==t.PROPERTY&&r.type!==t.ATTRIBUTE&&r.type!==t.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!f(r))throw Error("`live` bindings can only contain a single expression")}render(r){return r}update(i,[t$1]){if(t$1===w||t$1===T)return t$1;const o=i.element,l=i.name;if(i.type===t.PROPERTY){if(t$1===o[l])return w}else if(i.type===t.BOOLEAN_ATTRIBUTE){if(!!t$1===o.hasAttribute(l))return w}else if(i.type===t.ATTRIBUTE&&o.getAttribute(l)===t$1+"")return w;return m(i),t$1}});
577
+
578
+ var SlCheckbox = class extends ShoelaceElement {
579
+ constructor() {
580
+ super(...arguments);
581
+ this.formControlController = new FormControlController(this, {
582
+ value: (control) => control.checked ? control.value || "on" : void 0,
583
+ defaultValue: (control) => control.defaultChecked,
584
+ setValue: (control, checked) => control.checked = checked
585
+ });
586
+ this.hasSlotController = new HasSlotController(this, "help-text");
587
+ this.hasFocus = false;
588
+ this.title = "";
589
+ this.name = "";
590
+ this.size = "medium";
591
+ this.disabled = false;
592
+ this.checked = false;
593
+ this.indeterminate = false;
594
+ this.defaultChecked = false;
595
+ this.form = "";
596
+ this.required = false;
597
+ this.helpText = "";
598
+ }
599
+ /** Gets the validity state object */
600
+ get validity() {
601
+ return this.input.validity;
602
+ }
603
+ /** Gets the validation message */
604
+ get validationMessage() {
605
+ return this.input.validationMessage;
606
+ }
607
+ firstUpdated() {
608
+ this.formControlController.updateValidity();
609
+ }
610
+ handleClick() {
611
+ this.checked = !this.checked;
612
+ this.indeterminate = false;
613
+ this.emit("sl-change");
614
+ }
615
+ handleBlur() {
616
+ this.hasFocus = false;
617
+ this.emit("sl-blur");
618
+ }
619
+ handleInput() {
620
+ this.emit("sl-input");
621
+ }
622
+ handleInvalid(event) {
623
+ this.formControlController.setValidity(false);
624
+ this.formControlController.emitInvalidEvent(event);
625
+ }
626
+ handleFocus() {
627
+ this.hasFocus = true;
628
+ this.emit("sl-focus");
629
+ }
630
+ handleDisabledChange() {
631
+ this.formControlController.setValidity(this.disabled);
632
+ }
633
+ handleStateChange() {
634
+ this.input.checked = this.checked;
635
+ this.input.indeterminate = this.indeterminate;
636
+ this.formControlController.updateValidity();
637
+ }
638
+ /** Simulates a click on the checkbox. */
639
+ click() {
640
+ this.input.click();
641
+ }
642
+ /** Sets focus on the checkbox. */
643
+ focus(options) {
644
+ this.input.focus(options);
645
+ }
646
+ /** Removes focus from the checkbox. */
647
+ blur() {
648
+ this.input.blur();
649
+ }
650
+ /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */
651
+ checkValidity() {
652
+ return this.input.checkValidity();
653
+ }
654
+ /** Gets the associated form, if one exists. */
655
+ getForm() {
656
+ return this.formControlController.getForm();
657
+ }
658
+ /** Checks for validity and shows the browser's validation message if the control is invalid. */
659
+ reportValidity() {
660
+ return this.input.reportValidity();
661
+ }
662
+ /**
663
+ * Sets a custom validation message. The value provided will be shown to the user when the form is submitted. To clear
664
+ * the custom validation message, call this method with an empty string.
665
+ */
666
+ setCustomValidity(message) {
667
+ this.input.setCustomValidity(message);
668
+ this.formControlController.updateValidity();
669
+ }
670
+ render() {
671
+ const hasHelpTextSlot = this.hasSlotController.test("help-text");
672
+ const hasHelpText = this.helpText ? true : !!hasHelpTextSlot;
673
+ return x`
674
+ <div
675
+ class=${e({
676
+ "form-control": true,
677
+ "form-control--small": this.size === "small",
678
+ "form-control--medium": this.size === "medium",
679
+ "form-control--large": this.size === "large",
680
+ "form-control--has-help-text": hasHelpText
681
+ })}
682
+ >
683
+ <label
684
+ part="base"
685
+ class=${e({
686
+ checkbox: true,
687
+ "checkbox--checked": this.checked,
688
+ "checkbox--disabled": this.disabled,
689
+ "checkbox--focused": this.hasFocus,
690
+ "checkbox--indeterminate": this.indeterminate,
691
+ "checkbox--small": this.size === "small",
692
+ "checkbox--medium": this.size === "medium",
693
+ "checkbox--large": this.size === "large"
694
+ })}
695
+ >
696
+ <input
697
+ class="checkbox__input"
698
+ type="checkbox"
699
+ title=${this.title}
700
+ name=${this.name}
701
+ value=${o(this.value)}
702
+ .indeterminate=${l(this.indeterminate)}
703
+ .checked=${l(this.checked)}
704
+ .disabled=${this.disabled}
705
+ .required=${this.required}
706
+ aria-checked=${this.checked ? "true" : "false"}
707
+ aria-describedby="help-text"
708
+ @click=${this.handleClick}
709
+ @input=${this.handleInput}
710
+ @invalid=${this.handleInvalid}
711
+ @blur=${this.handleBlur}
712
+ @focus=${this.handleFocus}
713
+ />
714
+
715
+ <span
716
+ part="control${this.checked ? " control--checked" : ""}${this.indeterminate ? " control--indeterminate" : ""}"
717
+ class="checkbox__control"
718
+ >
719
+ ${this.checked ? x`
720
+ <sl-icon part="checked-icon" class="checkbox__checked-icon" library="system" name="check"></sl-icon>
721
+ ` : ""}
722
+ ${!this.checked && this.indeterminate ? x`
723
+ <sl-icon
724
+ part="indeterminate-icon"
725
+ class="checkbox__indeterminate-icon"
726
+ library="system"
727
+ name="indeterminate"
728
+ ></sl-icon>
729
+ ` : ""}
730
+ </span>
731
+
732
+ <div part="label" class="checkbox__label">
733
+ <slot></slot>
734
+ </div>
735
+ </label>
736
+
737
+ <div
738
+ aria-hidden=${hasHelpText ? "false" : "true"}
739
+ class="form-control__help-text"
740
+ id="help-text"
741
+ part="form-control-help-text"
742
+ >
743
+ <slot name="help-text">${this.helpText}</slot>
744
+ </div>
745
+ </div>
746
+ `;
747
+ }
748
+ };
749
+ SlCheckbox.styles = [component_styles_default, form_control_styles_default, checkbox_styles_default];
750
+ SlCheckbox.dependencies = { "sl-icon": SlIcon };
751
+ __decorateClass([
752
+ e$2('input[type="checkbox"]')
753
+ ], SlCheckbox.prototype, "input", 2);
754
+ __decorateClass([
755
+ r()
756
+ ], SlCheckbox.prototype, "hasFocus", 2);
757
+ __decorateClass([
758
+ n()
759
+ ], SlCheckbox.prototype, "title", 2);
760
+ __decorateClass([
761
+ n()
762
+ ], SlCheckbox.prototype, "name", 2);
763
+ __decorateClass([
764
+ n()
765
+ ], SlCheckbox.prototype, "value", 2);
766
+ __decorateClass([
767
+ n({ reflect: true })
768
+ ], SlCheckbox.prototype, "size", 2);
769
+ __decorateClass([
770
+ n({ type: Boolean, reflect: true })
771
+ ], SlCheckbox.prototype, "disabled", 2);
772
+ __decorateClass([
773
+ n({ type: Boolean, reflect: true })
774
+ ], SlCheckbox.prototype, "checked", 2);
775
+ __decorateClass([
776
+ n({ type: Boolean, reflect: true })
777
+ ], SlCheckbox.prototype, "indeterminate", 2);
778
+ __decorateClass([
779
+ defaultValue("checked")
780
+ ], SlCheckbox.prototype, "defaultChecked", 2);
781
+ __decorateClass([
782
+ n({ reflect: true })
783
+ ], SlCheckbox.prototype, "form", 2);
784
+ __decorateClass([
785
+ n({ type: Boolean, reflect: true })
786
+ ], SlCheckbox.prototype, "required", 2);
787
+ __decorateClass([
788
+ n({ attribute: "help-text" })
789
+ ], SlCheckbox.prototype, "helpText", 2);
790
+ __decorateClass([
791
+ watch("disabled", { waitUntilFirstUpdate: true })
792
+ ], SlCheckbox.prototype, "handleDisabledChange", 1);
793
+ __decorateClass([
794
+ watch(["checked", "indeterminate"], { waitUntilFirstUpdate: true })
795
+ ], SlCheckbox.prototype, "handleStateChange", 1);
796
+
797
+ SlCheckbox.define("sl-checkbox");
798
+
799
+ const jumpFilterCheckboxCss = ":host{display:flex;width:100%}:host .count{color:var(--neutral-grey-secondary, #707070)}:host sl-checkbox{display:flex;width:100%}:host sl-checkbox::part(control){height:1rem;width:1rem;border:1px solid var(--neutral-grey-secondary, #707070);border-radius:3px}:host sl-checkbox::part(control--checked){background-color:var(--status-interaction-standard, #2C6ECB);border-color:var(--status-interaction-standard, #2C6ECB);color:var(--neutral-ultralight, #fff)}:host sl-checkbox::part(label){display:flex;flex-direction:row;justify-content:space-between;align-items:flex-start;flex-grow:1;color:var(--neutral-grey-primary, #1d1d1d);font-family:var(--ff-primary), serif}";
800
+ const JumpFilterCheckboxStyle0 = jumpFilterCheckboxCss;
801
+
802
+ const JumpFilterCheckbox$1 = /*@__PURE__*/ proxyCustomElement(class JumpFilterCheckbox extends HTMLElement {
803
+ constructor() {
804
+ super();
805
+ this.__registerHost();
806
+ this.__attachShadow();
807
+ this.toggleCheckbox = createEvent(this, "jump-checkbox-change", 7);
808
+ this.value = undefined;
809
+ this.label = undefined;
810
+ this.checked = false;
811
+ this.count = null;
812
+ }
813
+ componentDidLoad() {
814
+ this.listenSLChange();
815
+ }
816
+ listenSLChange() {
817
+ if (this.host) {
818
+ this.host.addEventListener('sl-change', () => {
819
+ //invert the checked value
820
+ this.checked = !this.checked;
821
+ this.toggleCheckbox.emit({
822
+ //@ts-ignore
823
+ value: this.el.value,
824
+ //@ts-ignore
825
+ checked: this.checked,
826
+ });
827
+ });
828
+ }
829
+ }
830
+ async isChecked() {
831
+ // @ts-ignore
832
+ return this.el.checked;
833
+ }
834
+ render() {
835
+ return (h(Host, { key: '8c7ea463a6e26c6f77962cd0295dcb41411fa074', ref: (host) => this.host = host }, this.value && this.label &&
836
+ h("sl-checkbox", { key: '7467e1c364d868c7d58a58937411daf4f8c4e397', value: this.value, ref: (el) => this.el = el, checked: this.checked }, this.label), this.count && h("span", { key: 'e3add7e4ad2024096d8484b93cb276ac714d57d8', class: "count" }, "(", this.count, ")")));
837
+ }
838
+ static get style() { return JumpFilterCheckboxStyle0; }
839
+ }, [1, "jump-filter-checkbox", {
840
+ "value": [1],
841
+ "label": [1],
842
+ "checked": [516],
843
+ "count": [8],
844
+ "isChecked": [64]
845
+ }]);
846
+ function defineCustomElement$1() {
847
+ if (typeof customElements === "undefined") {
848
+ return;
849
+ }
850
+ const components = ["jump-filter-checkbox"];
851
+ components.forEach(tagName => { switch (tagName) {
852
+ case "jump-filter-checkbox":
853
+ if (!customElements.get(tagName)) {
854
+ customElements.define(tagName, JumpFilterCheckbox$1);
855
+ }
856
+ break;
857
+ } });
858
+ }
859
+
860
+ const JumpFilterCheckbox = JumpFilterCheckbox$1;
861
+ const defineCustomElement = defineCustomElement$1;
862
+
863
+ export { JumpFilterCheckbox, defineCustomElement };
864
+
865
+ //# sourceMappingURL=jump-filter-checkbox.js.map