@jumpgroup/jump-design-system 0.3.9 → 0.3.15

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 (120) 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 +32 -9
  11. package/dist/cjs/jump-filtergroup.cjs.entry.js.map +1 -1
  12. package/dist/cjs/jump-pagination-table.cjs.entry.js +3 -3
  13. package/dist/cjs/jump-pagination.cjs.entry.js +3 -3
  14. package/dist/cjs/jump-quantity.cjs.entry.js +4 -4
  15. package/dist/cjs/jump-quantity.cjs.entry.js.map +1 -1
  16. package/dist/cjs/jump-tab-item.cjs.entry.js +2 -2
  17. package/dist/cjs/jump-tab-panel.cjs.entry.js +1 -1
  18. package/dist/cjs/jump-tab.cjs.entry.js +1 -1
  19. package/dist/cjs/loader.cjs.js +1 -1
  20. package/dist/collection/collection-manifest.json +1 -0
  21. package/dist/collection/components/jump-filter/jump-filter.css +8 -1
  22. package/dist/collection/components/jump-filter/jump-filter.js +5 -4
  23. package/dist/collection/components/jump-filter/jump-filter.js.map +1 -1
  24. package/dist/collection/components/jump-filter/jump-filter.stories.js +5 -4
  25. package/dist/collection/components/jump-filter/jump-filter.stories.js.map +1 -1
  26. package/dist/collection/components/jump-filter-checkbox/jump-filter-checkbox.css +31 -0
  27. package/dist/collection/components/jump-filter-checkbox/jump-filter-checkbox.js +161 -0
  28. package/dist/collection/components/jump-filter-checkbox/jump-filter-checkbox.js.map +1 -0
  29. package/dist/collection/components/jump-filter-checkbox/jump-filter-checkbox.stories.js +51 -0
  30. package/dist/collection/components/jump-filter-checkbox/jump-filter-checkbox.stories.js.map +1 -0
  31. package/dist/collection/components/jump-filtergroup/jump-filtergroup.css +5 -4
  32. package/dist/collection/components/jump-filtergroup/jump-filtergroup.js +33 -10
  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 +3 -3
  38. package/dist/collection/components/jump-quantity/jump-quantity.css +6 -3
  39. package/dist/collection/components/jump-quantity/jump-quantity.js +3 -3
  40. package/dist/collection/components/jump-quantity/jump-quantity.js.map +1 -1
  41. package/dist/collection/components/jump-tab/jump-tab.js +1 -1
  42. package/dist/collection/components/jump-tab-item/jump-tab-item.js +2 -2
  43. package/dist/collection/components/jump-tab-panel/jump-tab-panel.js +1 -1
  44. package/dist/components/chunk.H33C3MRM.js +529 -0
  45. package/dist/components/chunk.H33C3MRM.js.map +1 -0
  46. package/dist/components/jump-filter-checkbox.d.ts +11 -0
  47. package/dist/components/jump-filter-checkbox.js +865 -0
  48. package/dist/components/jump-filter-checkbox.js.map +1 -0
  49. package/dist/components/jump-filter.js +5 -4
  50. package/dist/components/jump-filter.js.map +1 -1
  51. package/dist/components/jump-filtergroup.js +33 -10
  52. package/dist/components/jump-filtergroup.js.map +1 -1
  53. package/dist/components/jump-icon2.js +6 -528
  54. package/dist/components/jump-icon2.js.map +1 -1
  55. package/dist/components/jump-pagination-table.js +3 -3
  56. package/dist/components/jump-pagination.js +3 -3
  57. package/dist/components/jump-quantity.js +4 -4
  58. package/dist/components/jump-quantity.js.map +1 -1
  59. package/dist/components/jump-tab-item.js +2 -2
  60. package/dist/components/jump-tab-panel.js +1 -1
  61. package/dist/components/jump-tab.js +1 -1
  62. package/dist/esm/chunk.H33C3MRM-d1872e67.js +529 -0
  63. package/dist/esm/chunk.H33C3MRM-d1872e67.js.map +1 -0
  64. package/dist/esm/jump-button_2.entry.js +6 -528
  65. package/dist/esm/jump-button_2.entry.js.map +1 -1
  66. package/dist/esm/jump-design-system.js +1 -1
  67. package/dist/esm/jump-filter-checkbox.entry.js +841 -0
  68. package/dist/esm/jump-filter-checkbox.entry.js.map +1 -0
  69. package/dist/esm/jump-filter.entry.js +5 -4
  70. package/dist/esm/jump-filter.entry.js.map +1 -1
  71. package/dist/esm/jump-filtergroup.entry.js +32 -9
  72. package/dist/esm/jump-filtergroup.entry.js.map +1 -1
  73. package/dist/esm/jump-pagination-table.entry.js +3 -3
  74. package/dist/esm/jump-pagination.entry.js +3 -3
  75. package/dist/esm/jump-quantity.entry.js +4 -4
  76. package/dist/esm/jump-quantity.entry.js.map +1 -1
  77. package/dist/esm/jump-tab-item.entry.js +2 -2
  78. package/dist/esm/jump-tab-panel.entry.js +1 -1
  79. package/dist/esm/jump-tab.entry.js +1 -1
  80. package/dist/esm/loader.js +1 -1
  81. package/dist/jump-design-system/jump-design-system.esm.js +1 -1
  82. package/dist/jump-design-system/jump-design-system.esm.js.map +1 -1
  83. package/dist/jump-design-system/{p-95460fa4.entry.js → p-4302b229.entry.js} +2 -2
  84. package/dist/jump-design-system/p-60849b83.entry.js +2 -0
  85. package/dist/jump-design-system/p-60849b83.entry.js.map +1 -0
  86. package/dist/jump-design-system/p-839e054d.entry.js +2 -0
  87. package/dist/jump-design-system/p-839e054d.entry.js.map +1 -0
  88. package/dist/jump-design-system/{p-d2ee7b9b.entry.js → p-9d9b0076.entry.js} +2 -2
  89. package/dist/jump-design-system/p-a00d20d8.entry.js +264 -0
  90. package/dist/jump-design-system/p-a00d20d8.entry.js.map +1 -0
  91. package/dist/jump-design-system/p-a4b9515b.js +66 -0
  92. package/dist/jump-design-system/p-a4b9515b.js.map +1 -0
  93. package/dist/jump-design-system/p-aee5a8c3.entry.js +2 -0
  94. package/dist/jump-design-system/p-b4e60ca4.entry.js +2 -0
  95. package/dist/jump-design-system/p-b4e60ca4.entry.js.map +1 -0
  96. package/dist/jump-design-system/{p-37114ce3.entry.js → p-c8733544.entry.js} +2 -2
  97. package/dist/jump-design-system/{p-8efeaa79.entry.js → p-ed897778.entry.js} +2 -2
  98. package/dist/jump-design-system/p-fde99383.entry.js +2 -0
  99. package/dist/jump-design-system/p-fde99383.entry.js.map +1 -0
  100. package/dist/jump-design-system-elements.json +29 -4
  101. package/dist/types/components/jump-filter-checkbox/jump-filter-checkbox.d.ts +15 -0
  102. package/dist/types/components/jump-filter-checkbox/jump-filter-checkbox.stories.d.ts +30 -0
  103. package/dist/types/components/jump-filtergroup/jump-filtergroup.d.ts +4 -2
  104. package/dist/types/components/jump-filtergroup/jump-filtergroup.stories.d.ts +1 -1
  105. package/dist/types/components.d.ts +40 -2
  106. package/package.json +1 -1
  107. package/dist/jump-design-system/p-529a09f6.entry.js +0 -2
  108. package/dist/jump-design-system/p-529a09f6.entry.js.map +0 -1
  109. package/dist/jump-design-system/p-5da7839d.entry.js +0 -2
  110. package/dist/jump-design-system/p-8628896f.entry.js +0 -2
  111. package/dist/jump-design-system/p-8628896f.entry.js.map +0 -1
  112. package/dist/jump-design-system/p-c2bc6395.entry.js +0 -66
  113. package/dist/jump-design-system/p-c2bc6395.entry.js.map +0 -1
  114. package/dist/jump-design-system/p-d1e411fd.entry.js +0 -2
  115. package/dist/jump-design-system/p-d1e411fd.entry.js.map +0 -1
  116. /package/dist/jump-design-system/{p-95460fa4.entry.js.map → p-4302b229.entry.js.map} +0 -0
  117. /package/dist/jump-design-system/{p-d2ee7b9b.entry.js.map → p-9d9b0076.entry.js.map} +0 -0
  118. /package/dist/jump-design-system/{p-5da7839d.entry.js.map → p-aee5a8c3.entry.js.map} +0 -0
  119. /package/dist/jump-design-system/{p-37114ce3.entry.js.map → p-c8733544.entry.js.map} +0 -0
  120. /package/dist/jump-design-system/{p-8efeaa79.entry.js.map → p-ed897778.entry.js.map} +0 -0
@@ -0,0 +1,841 @@
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-70f1949a.js';
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, r, n } from './chunk.H33C3MRM-d1872e67.js';
3
+
4
+ // src/components/checkbox/checkbox.styles.ts
5
+ var checkbox_styles_default = i$1`
6
+ :host {
7
+ display: inline-block;
8
+ }
9
+
10
+ .checkbox {
11
+ position: relative;
12
+ display: inline-flex;
13
+ align-items: flex-start;
14
+ font-family: var(--sl-input-font-family);
15
+ font-weight: var(--sl-input-font-weight);
16
+ color: var(--sl-input-label-color);
17
+ vertical-align: middle;
18
+ cursor: pointer;
19
+ }
20
+
21
+ .checkbox--small {
22
+ --toggle-size: var(--sl-toggle-size-small);
23
+ font-size: var(--sl-input-font-size-small);
24
+ }
25
+
26
+ .checkbox--medium {
27
+ --toggle-size: var(--sl-toggle-size-medium);
28
+ font-size: var(--sl-input-font-size-medium);
29
+ }
30
+
31
+ .checkbox--large {
32
+ --toggle-size: var(--sl-toggle-size-large);
33
+ font-size: var(--sl-input-font-size-large);
34
+ }
35
+
36
+ .checkbox__control {
37
+ flex: 0 0 auto;
38
+ position: relative;
39
+ display: inline-flex;
40
+ align-items: center;
41
+ justify-content: center;
42
+ width: var(--toggle-size);
43
+ height: var(--toggle-size);
44
+ border: solid var(--sl-input-border-width) var(--sl-input-border-color);
45
+ border-radius: 2px;
46
+ background-color: var(--sl-input-background-color);
47
+ color: var(--sl-color-neutral-0);
48
+ transition:
49
+ var(--sl-transition-fast) border-color,
50
+ var(--sl-transition-fast) background-color,
51
+ var(--sl-transition-fast) color,
52
+ var(--sl-transition-fast) box-shadow;
53
+ }
54
+
55
+ .checkbox__input {
56
+ position: absolute;
57
+ opacity: 0;
58
+ padding: 0;
59
+ margin: 0;
60
+ pointer-events: none;
61
+ }
62
+
63
+ .checkbox__checked-icon,
64
+ .checkbox__indeterminate-icon {
65
+ display: inline-flex;
66
+ width: var(--toggle-size);
67
+ height: var(--toggle-size);
68
+ }
69
+
70
+ /* Hover */
71
+ .checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__control:hover {
72
+ border-color: var(--sl-input-border-color-hover);
73
+ background-color: var(--sl-input-background-color-hover);
74
+ }
75
+
76
+ /* Focus */
77
+ .checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control {
78
+ outline: var(--sl-focus-ring);
79
+ outline-offset: var(--sl-focus-ring-offset);
80
+ }
81
+
82
+ /* Checked/indeterminate */
83
+ .checkbox--checked .checkbox__control,
84
+ .checkbox--indeterminate .checkbox__control {
85
+ border-color: var(--sl-color-primary-600);
86
+ background-color: var(--sl-color-primary-600);
87
+ }
88
+
89
+ /* Checked/indeterminate + hover */
90
+ .checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__control:hover,
91
+ .checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__control:hover {
92
+ border-color: var(--sl-color-primary-500);
93
+ background-color: var(--sl-color-primary-500);
94
+ }
95
+
96
+ /* Checked/indeterminate + focus */
97
+ .checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control,
98
+ .checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__input:focus-visible ~ .checkbox__control {
99
+ outline: var(--sl-focus-ring);
100
+ outline-offset: var(--sl-focus-ring-offset);
101
+ }
102
+
103
+ /* Disabled */
104
+ .checkbox--disabled {
105
+ opacity: 0.5;
106
+ cursor: not-allowed;
107
+ }
108
+
109
+ .checkbox__label {
110
+ display: inline-block;
111
+ color: var(--sl-input-label-color);
112
+ line-height: var(--toggle-size);
113
+ margin-inline-start: 0.5em;
114
+ user-select: none;
115
+ -webkit-user-select: none;
116
+ }
117
+
118
+ :host([required]) .checkbox__label::after {
119
+ content: var(--sl-input-required-content);
120
+ color: var(--sl-input-required-content-color);
121
+ margin-inline-start: var(--sl-input-required-content-offset);
122
+ }
123
+ `;
124
+
125
+ // src/internal/default-value.ts
126
+ var defaultValue = (propertyName = "value") => (proto, key) => {
127
+ const ctor = proto.constructor;
128
+ const attributeChangedCallback = ctor.prototype.attributeChangedCallback;
129
+ ctor.prototype.attributeChangedCallback = function(name, old, value) {
130
+ var _a;
131
+ const options = ctor.getPropertyOptions(propertyName);
132
+ const attributeName = typeof options.attribute === "string" ? options.attribute : propertyName;
133
+ if (name === attributeName) {
134
+ const converter = options.converter || u;
135
+ const fromAttribute = typeof converter === "function" ? converter : (_a = converter == null ? void 0 : converter.fromAttribute) != null ? _a : u.fromAttribute;
136
+ const newValue = fromAttribute(value, options.type);
137
+ if (this[propertyName] !== newValue) {
138
+ this[key] = newValue;
139
+ }
140
+ }
141
+ attributeChangedCallback.call(this, name, old, value);
142
+ };
143
+ };
144
+
145
+ // src/styles/form-control.styles.ts
146
+ var form_control_styles_default = i$1`
147
+ .form-control .form-control__label {
148
+ display: none;
149
+ }
150
+
151
+ .form-control .form-control__help-text {
152
+ display: none;
153
+ }
154
+
155
+ /* Label */
156
+ .form-control--has-label .form-control__label {
157
+ display: inline-block;
158
+ color: var(--sl-input-label-color);
159
+ margin-bottom: var(--sl-spacing-3x-small);
160
+ }
161
+
162
+ .form-control--has-label.form-control--small .form-control__label {
163
+ font-size: var(--sl-input-label-font-size-small);
164
+ }
165
+
166
+ .form-control--has-label.form-control--medium .form-control__label {
167
+ font-size: var(--sl-input-label-font-size-medium);
168
+ }
169
+
170
+ .form-control--has-label.form-control--large .form-control__label {
171
+ font-size: var(--sl-input-label-font-size-large);
172
+ }
173
+
174
+ :host([required]) .form-control--has-label .form-control__label::after {
175
+ content: var(--sl-input-required-content);
176
+ margin-inline-start: var(--sl-input-required-content-offset);
177
+ color: var(--sl-input-required-content-color);
178
+ }
179
+
180
+ /* Help text */
181
+ .form-control--has-help-text .form-control__help-text {
182
+ display: block;
183
+ color: var(--sl-input-help-text-color);
184
+ margin-top: var(--sl-spacing-3x-small);
185
+ }
186
+
187
+ .form-control--has-help-text.form-control--small .form-control__help-text {
188
+ font-size: var(--sl-input-help-text-font-size-small);
189
+ }
190
+
191
+ .form-control--has-help-text.form-control--medium .form-control__help-text {
192
+ font-size: var(--sl-input-help-text-font-size-medium);
193
+ }
194
+
195
+ .form-control--has-help-text.form-control--large .form-control__help-text {
196
+ font-size: var(--sl-input-help-text-font-size-large);
197
+ }
198
+
199
+ .form-control--has-help-text.form-control--radio-group .form-control__help-text {
200
+ margin-top: var(--sl-spacing-2x-small);
201
+ }
202
+ `;
203
+
204
+ // src/internal/form.ts
205
+ var formCollections = /* @__PURE__ */ new WeakMap();
206
+ var reportValidityOverloads = /* @__PURE__ */ new WeakMap();
207
+ var checkValidityOverloads = /* @__PURE__ */ new WeakMap();
208
+ var userInteractedControls = /* @__PURE__ */ new WeakSet();
209
+ var interactions = /* @__PURE__ */ new WeakMap();
210
+ var FormControlController = class {
211
+ constructor(host, options) {
212
+ this.handleFormData = (event) => {
213
+ const disabled = this.options.disabled(this.host);
214
+ const name = this.options.name(this.host);
215
+ const value = this.options.value(this.host);
216
+ const isButton = this.host.tagName.toLowerCase() === "sl-button";
217
+ if (this.host.isConnected && !disabled && !isButton && typeof name === "string" && name.length > 0 && typeof value !== "undefined") {
218
+ if (Array.isArray(value)) {
219
+ value.forEach((val) => {
220
+ event.formData.append(name, val.toString());
221
+ });
222
+ } else {
223
+ event.formData.append(name, value.toString());
224
+ }
225
+ }
226
+ };
227
+ this.handleFormSubmit = (event) => {
228
+ var _a;
229
+ const disabled = this.options.disabled(this.host);
230
+ const reportValidity = this.options.reportValidity;
231
+ if (this.form && !this.form.noValidate) {
232
+ (_a = formCollections.get(this.form)) == null ? void 0 : _a.forEach((control) => {
233
+ this.setUserInteracted(control, true);
234
+ });
235
+ }
236
+ if (this.form && !this.form.noValidate && !disabled && !reportValidity(this.host)) {
237
+ event.preventDefault();
238
+ event.stopImmediatePropagation();
239
+ }
240
+ };
241
+ this.handleFormReset = () => {
242
+ this.options.setValue(this.host, this.options.defaultValue(this.host));
243
+ this.setUserInteracted(this.host, false);
244
+ interactions.set(this.host, []);
245
+ };
246
+ this.handleInteraction = (event) => {
247
+ const emittedEvents = interactions.get(this.host);
248
+ if (!emittedEvents.includes(event.type)) {
249
+ emittedEvents.push(event.type);
250
+ }
251
+ if (emittedEvents.length === this.options.assumeInteractionOn.length) {
252
+ this.setUserInteracted(this.host, true);
253
+ }
254
+ };
255
+ this.checkFormValidity = () => {
256
+ if (this.form && !this.form.noValidate) {
257
+ const elements = this.form.querySelectorAll("*");
258
+ for (const element of elements) {
259
+ if (typeof element.checkValidity === "function") {
260
+ if (!element.checkValidity()) {
261
+ return false;
262
+ }
263
+ }
264
+ }
265
+ }
266
+ return true;
267
+ };
268
+ this.reportFormValidity = () => {
269
+ if (this.form && !this.form.noValidate) {
270
+ const elements = this.form.querySelectorAll("*");
271
+ for (const element of elements) {
272
+ if (typeof element.reportValidity === "function") {
273
+ if (!element.reportValidity()) {
274
+ return false;
275
+ }
276
+ }
277
+ }
278
+ }
279
+ return true;
280
+ };
281
+ (this.host = host).addController(this);
282
+ this.options = __spreadValues({
283
+ form: (input) => {
284
+ const formId = input.form;
285
+ if (formId) {
286
+ const root = input.getRootNode();
287
+ const form = root.querySelector(`#${formId}`);
288
+ if (form) {
289
+ return form;
290
+ }
291
+ }
292
+ return input.closest("form");
293
+ },
294
+ name: (input) => input.name,
295
+ value: (input) => input.value,
296
+ defaultValue: (input) => input.defaultValue,
297
+ disabled: (input) => {
298
+ var _a;
299
+ return (_a = input.disabled) != null ? _a : false;
300
+ },
301
+ reportValidity: (input) => typeof input.reportValidity === "function" ? input.reportValidity() : true,
302
+ checkValidity: (input) => typeof input.checkValidity === "function" ? input.checkValidity() : true,
303
+ setValue: (input, value) => input.value = value,
304
+ assumeInteractionOn: ["sl-input"]
305
+ }, options);
306
+ }
307
+ hostConnected() {
308
+ const form = this.options.form(this.host);
309
+ if (form) {
310
+ this.attachForm(form);
311
+ }
312
+ interactions.set(this.host, []);
313
+ this.options.assumeInteractionOn.forEach((event) => {
314
+ this.host.addEventListener(event, this.handleInteraction);
315
+ });
316
+ }
317
+ hostDisconnected() {
318
+ this.detachForm();
319
+ interactions.delete(this.host);
320
+ this.options.assumeInteractionOn.forEach((event) => {
321
+ this.host.removeEventListener(event, this.handleInteraction);
322
+ });
323
+ }
324
+ hostUpdated() {
325
+ const form = this.options.form(this.host);
326
+ if (!form) {
327
+ this.detachForm();
328
+ }
329
+ if (form && this.form !== form) {
330
+ this.detachForm();
331
+ this.attachForm(form);
332
+ }
333
+ if (this.host.hasUpdated) {
334
+ this.setValidity(this.host.validity.valid);
335
+ }
336
+ }
337
+ attachForm(form) {
338
+ if (form) {
339
+ this.form = form;
340
+ if (formCollections.has(this.form)) {
341
+ formCollections.get(this.form).add(this.host);
342
+ } else {
343
+ formCollections.set(this.form, /* @__PURE__ */ new Set([this.host]));
344
+ }
345
+ this.form.addEventListener("formdata", this.handleFormData);
346
+ this.form.addEventListener("submit", this.handleFormSubmit);
347
+ this.form.addEventListener("reset", this.handleFormReset);
348
+ if (!reportValidityOverloads.has(this.form)) {
349
+ reportValidityOverloads.set(this.form, this.form.reportValidity);
350
+ this.form.reportValidity = () => this.reportFormValidity();
351
+ }
352
+ if (!checkValidityOverloads.has(this.form)) {
353
+ checkValidityOverloads.set(this.form, this.form.checkValidity);
354
+ this.form.checkValidity = () => this.checkFormValidity();
355
+ }
356
+ } else {
357
+ this.form = void 0;
358
+ }
359
+ }
360
+ detachForm() {
361
+ if (!this.form)
362
+ return;
363
+ const formCollection = formCollections.get(this.form);
364
+ if (!formCollection) {
365
+ return;
366
+ }
367
+ formCollection.delete(this.host);
368
+ if (formCollection.size <= 0) {
369
+ this.form.removeEventListener("formdata", this.handleFormData);
370
+ this.form.removeEventListener("submit", this.handleFormSubmit);
371
+ this.form.removeEventListener("reset", this.handleFormReset);
372
+ if (reportValidityOverloads.has(this.form)) {
373
+ this.form.reportValidity = reportValidityOverloads.get(this.form);
374
+ reportValidityOverloads.delete(this.form);
375
+ }
376
+ if (checkValidityOverloads.has(this.form)) {
377
+ this.form.checkValidity = checkValidityOverloads.get(this.form);
378
+ checkValidityOverloads.delete(this.form);
379
+ }
380
+ this.form = void 0;
381
+ }
382
+ }
383
+ setUserInteracted(el, hasInteracted) {
384
+ if (hasInteracted) {
385
+ userInteractedControls.add(el);
386
+ } else {
387
+ userInteractedControls.delete(el);
388
+ }
389
+ el.requestUpdate();
390
+ }
391
+ doAction(type, submitter) {
392
+ if (this.form) {
393
+ const button = document.createElement("button");
394
+ button.type = type;
395
+ button.style.position = "absolute";
396
+ button.style.width = "0";
397
+ button.style.height = "0";
398
+ button.style.clipPath = "inset(50%)";
399
+ button.style.overflow = "hidden";
400
+ button.style.whiteSpace = "nowrap";
401
+ if (submitter) {
402
+ button.name = submitter.name;
403
+ button.value = submitter.value;
404
+ ["formaction", "formenctype", "formmethod", "formnovalidate", "formtarget"].forEach((attr) => {
405
+ if (submitter.hasAttribute(attr)) {
406
+ button.setAttribute(attr, submitter.getAttribute(attr));
407
+ }
408
+ });
409
+ }
410
+ this.form.append(button);
411
+ button.click();
412
+ button.remove();
413
+ }
414
+ }
415
+ /** Returns the associated `<form>` element, if one exists. */
416
+ getForm() {
417
+ var _a;
418
+ return (_a = this.form) != null ? _a : null;
419
+ }
420
+ /** Resets the form, restoring all the control to their default value */
421
+ reset(submitter) {
422
+ this.doAction("reset", submitter);
423
+ }
424
+ /** Submits the form, triggering validation and form data injection. */
425
+ submit(submitter) {
426
+ this.doAction("submit", submitter);
427
+ }
428
+ /**
429
+ * Synchronously sets the form control's validity. Call this when you know the future validity but need to update
430
+ * the host element immediately, i.e. before Lit updates the component in the next update.
431
+ */
432
+ setValidity(isValid) {
433
+ const host = this.host;
434
+ const hasInteracted = Boolean(userInteractedControls.has(host));
435
+ const required = Boolean(host.required);
436
+ host.toggleAttribute("data-required", required);
437
+ host.toggleAttribute("data-optional", !required);
438
+ host.toggleAttribute("data-invalid", !isValid);
439
+ host.toggleAttribute("data-valid", isValid);
440
+ host.toggleAttribute("data-user-invalid", !isValid && hasInteracted);
441
+ host.toggleAttribute("data-user-valid", isValid && hasInteracted);
442
+ }
443
+ /**
444
+ * Updates the form control's validity based on the current value of `host.validity.valid`. Call this when anything
445
+ * that affects constraint validation changes so the component receives the correct validity states.
446
+ */
447
+ updateValidity() {
448
+ const host = this.host;
449
+ this.setValidity(host.validity.valid);
450
+ }
451
+ /**
452
+ * Dispatches a non-bubbling, cancelable custom event of type `sl-invalid`.
453
+ * If the `sl-invalid` event will be cancelled then the original `invalid`
454
+ * event (which may have been passed as argument) will also be cancelled.
455
+ * If no original `invalid` event has been passed then the `sl-invalid`
456
+ * event will be cancelled before being dispatched.
457
+ */
458
+ emitInvalidEvent(originalInvalidEvent) {
459
+ const slInvalidEvent = new CustomEvent("sl-invalid", {
460
+ bubbles: false,
461
+ composed: false,
462
+ cancelable: true,
463
+ detail: {}
464
+ });
465
+ if (!originalInvalidEvent) {
466
+ slInvalidEvent.preventDefault();
467
+ }
468
+ if (!this.host.dispatchEvent(slInvalidEvent)) {
469
+ originalInvalidEvent == null ? void 0 : originalInvalidEvent.preventDefault();
470
+ }
471
+ }
472
+ };
473
+ var validValidityState = Object.freeze({
474
+ badInput: false,
475
+ customError: false,
476
+ patternMismatch: false,
477
+ rangeOverflow: false,
478
+ rangeUnderflow: false,
479
+ stepMismatch: false,
480
+ tooLong: false,
481
+ tooShort: false,
482
+ typeMismatch: false,
483
+ valid: true,
484
+ valueMissing: false
485
+ });
486
+ Object.freeze(__spreadProps(__spreadValues({}, validValidityState), {
487
+ valid: false,
488
+ valueMissing: true
489
+ }));
490
+ Object.freeze(__spreadProps(__spreadValues({}, validValidityState), {
491
+ valid: false,
492
+ customError: true
493
+ }));
494
+
495
+ // src/internal/slot.ts
496
+ var HasSlotController = class {
497
+ constructor(host, ...slotNames) {
498
+ this.slotNames = [];
499
+ this.handleSlotChange = (event) => {
500
+ const slot = event.target;
501
+ if (this.slotNames.includes("[default]") && !slot.name || slot.name && this.slotNames.includes(slot.name)) {
502
+ this.host.requestUpdate();
503
+ }
504
+ };
505
+ (this.host = host).addController(this);
506
+ this.slotNames = slotNames;
507
+ }
508
+ hasDefaultSlot() {
509
+ return [...this.host.childNodes].some((node) => {
510
+ if (node.nodeType === node.TEXT_NODE && node.textContent.trim() !== "") {
511
+ return true;
512
+ }
513
+ if (node.nodeType === node.ELEMENT_NODE) {
514
+ const el = node;
515
+ const tagName = el.tagName.toLowerCase();
516
+ if (tagName === "sl-visually-hidden") {
517
+ return false;
518
+ }
519
+ if (!el.hasAttribute("slot")) {
520
+ return true;
521
+ }
522
+ }
523
+ return false;
524
+ });
525
+ }
526
+ hasNamedSlot(name) {
527
+ return this.host.querySelector(`:scope > [slot="${name}"]`) !== null;
528
+ }
529
+ test(slotName) {
530
+ return slotName === "[default]" ? this.hasDefaultSlot() : this.hasNamedSlot(slotName);
531
+ }
532
+ hostConnected() {
533
+ this.host.shadowRoot.addEventListener("slotchange", this.handleSlotChange);
534
+ }
535
+ hostDisconnected() {
536
+ this.host.shadowRoot.removeEventListener("slotchange", this.handleSlotChange);
537
+ }
538
+ };
539
+
540
+ /**
541
+ * @license
542
+ * Copyright 2017 Google LLC
543
+ * SPDX-License-Identifier: BSD-3-Clause
544
+ */
545
+ const e$3=(e,t,c)=>(c.configurable=!0,c.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,c),c);
546
+
547
+ /**
548
+ * @license
549
+ * Copyright 2017 Google LLC
550
+ * SPDX-License-Identifier: BSD-3-Clause
551
+ */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)}})}}
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 = class {
803
+ constructor(hostRef) {
804
+ registerInstance(this, hostRef);
805
+ this.toggleCheckbox = createEvent(this, "jump-checkbox-change", 7);
806
+ this.value = undefined;
807
+ this.label = undefined;
808
+ this.checked = false;
809
+ this.count = null;
810
+ }
811
+ componentDidLoad() {
812
+ this.listenSLChange();
813
+ }
814
+ listenSLChange() {
815
+ if (this.host) {
816
+ this.host.addEventListener('sl-change', () => {
817
+ //invert the checked value
818
+ this.checked = !this.checked;
819
+ this.toggleCheckbox.emit({
820
+ //@ts-ignore
821
+ value: this.el.value,
822
+ //@ts-ignore
823
+ checked: this.checked,
824
+ });
825
+ });
826
+ }
827
+ }
828
+ async isChecked() {
829
+ // @ts-ignore
830
+ return this.el.checked;
831
+ }
832
+ render() {
833
+ return (h(Host, { key: '8c7ea463a6e26c6f77962cd0295dcb41411fa074', ref: (host) => this.host = host }, this.value && this.label &&
834
+ 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, ")")));
835
+ }
836
+ };
837
+ JumpFilterCheckbox.style = JumpFilterCheckboxStyle0;
838
+
839
+ export { JumpFilterCheckbox as jump_filter_checkbox };
840
+
841
+ //# sourceMappingURL=jump-filter-checkbox.entry.js.map