@dso-toolkit/core 29.0.1 → 31.1.0
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.
- package/dist/cjs/dso-alert.cjs.entry.js +1 -1
- package/dist/cjs/dso-autosuggest.cjs.entry.js +105 -75
- package/dist/cjs/dso-banner.cjs.entry.js +1 -1
- package/dist/cjs/dso-date-picker.cjs.entry.js +56 -16
- package/dist/cjs/dso-icon.cjs.entry.js +6 -4
- package/dist/cjs/dso-info-button.cjs.entry.js +26 -0
- package/dist/cjs/{dso-info_3.cjs.entry.js → dso-info_2.cjs.entry.js} +0 -20
- package/dist/cjs/dso-label.cjs.entry.js +1 -1
- package/dist/cjs/dso-ozon-content.cjs.entry.js +26 -13
- package/dist/cjs/dso-toggletip.cjs.entry.js +62 -0
- package/dist/cjs/dso-toolkit.cjs.js +1 -1
- package/dist/cjs/dso-tooltip.cjs.entry.js +33 -26
- package/dist/cjs/dso-tree-view.cjs.entry.js +180 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/alert/alert.css +2 -0
- package/dist/collection/components/autosuggest/autosuggest.css +10 -0
- package/dist/collection/components/autosuggest/autosuggest.js +128 -98
- package/dist/collection/components/autosuggest/autosuggest.template.js +6 -6
- package/dist/collection/components/banner/banner.css +2 -0
- package/dist/collection/components/date-picker/date-localization.js +1 -1
- package/dist/collection/components/date-picker/date-picker.js +108 -14
- package/dist/collection/components/date-picker/date-picker.template.js +2 -1
- package/dist/collection/components/date-picker/date-utils.js +3 -3
- package/dist/collection/components/icon/icon.js +9 -7
- package/dist/collection/components/info-button/info-button.css +10 -3
- package/dist/collection/components/info-button/info-button.js +18 -1
- package/dist/collection/components/info-button/info-button.template.js +2 -1
- package/dist/collection/components/label/label.decorator.js +6 -0
- package/dist/collection/components/label/label.js +1 -0
- package/dist/collection/components/label/label.template.js +10 -2
- package/dist/collection/components/ozon-content/ozon-content.transformer.js +26 -13
- package/dist/collection/components/toggletip/toggletip.css +8 -0
- package/dist/collection/components/toggletip/toggletip.js +137 -0
- package/dist/collection/components/toggletip/toggletip.template.js +12 -0
- package/dist/collection/components/tooltip/tooltip.css +1 -1
- package/dist/collection/components/tooltip/tooltip.js +49 -25
- package/dist/collection/components/tree-view/tree-item.js +20 -0
- package/dist/collection/components/tree-view/tree-view.css +43 -0
- package/dist/collection/components/tree-view/tree-view.js +239 -0
- package/dist/collection/components/tree-view/tree-view.template.js +11 -0
- package/dist/custom-elements/index.d.ts +12 -0
- package/dist/custom-elements/index.js +472 -145
- package/dist/dso-toolkit/dso-toolkit.css +1 -1
- package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/dso-toolkit/{p-968d9e1d.entry.js → p-19de4cc7.entry.js} +1 -1
- package/dist/dso-toolkit/p-39dae284.entry.js +1 -0
- package/dist/dso-toolkit/p-5665f1ee.entry.js +1 -0
- package/dist/dso-toolkit/{p-eadba8c3.entry.js → p-5a67f3f7.entry.js} +1 -1
- package/dist/dso-toolkit/p-759920d0.entry.js +1 -0
- package/dist/dso-toolkit/{p-d748df48.entry.js → p-83f166b3.entry.js} +1 -1
- package/dist/dso-toolkit/p-9735f393.entry.js +1 -0
- package/dist/dso-toolkit/p-9e9f8bcf.entry.js +1 -0
- package/dist/dso-toolkit/p-a8a0e909.entry.js +1 -0
- package/dist/dso-toolkit/p-ad8f467f.entry.js +1 -0
- package/dist/dso-toolkit/p-e2dc97c4.entry.js +1 -0
- package/dist/dso-toolkit/p-faf19a1d.entry.js +1 -0
- package/dist/esm/dso-alert.entry.js +1 -1
- package/dist/esm/dso-autosuggest.entry.js +105 -75
- package/dist/esm/dso-banner.entry.js +1 -1
- package/dist/esm/dso-date-picker.entry.js +56 -16
- package/dist/esm/dso-icon.entry.js +6 -4
- package/dist/esm/dso-info-button.entry.js +22 -0
- package/dist/esm/{dso-info_3.entry.js → dso-info_2.entry.js} +1 -20
- package/dist/esm/dso-label.entry.js +1 -1
- package/dist/esm/dso-ozon-content.entry.js +26 -13
- package/dist/esm/dso-toggletip.entry.js +58 -0
- package/dist/esm/dso-toolkit.js +1 -1
- package/dist/esm/dso-tooltip.entry.js +33 -26
- package/dist/esm/dso-tree-view.entry.js +176 -0
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/autosuggest/autosuggest.d.ts +19 -20
- package/dist/types/components/autosuggest/autosuggest.template.d.ts +3 -2
- package/dist/types/components/date-picker/date-picker.d.ts +20 -0
- package/dist/types/components/date-picker/date-picker.template.d.ts +1 -1
- package/dist/types/components/icon/icon.d.ts +1 -1
- package/dist/types/components/info-button/info-button.d.ts +1 -0
- package/dist/types/components/info-button/info-button.template.d.ts +1 -1
- package/dist/types/components/label/label.decorator.d.ts +3 -0
- package/dist/types/components/label/label.template.d.ts +1 -1
- package/dist/types/components/toggletip/toggletip.d.ts +17 -0
- package/dist/types/components/toggletip/toggletip.template.d.ts +2 -0
- package/dist/types/components/tooltip/tooltip.d.ts +6 -2
- package/dist/types/components/tree-view/tree-item.d.ts +13 -0
- package/dist/types/components/tree-view/tree-view.d.ts +36 -0
- package/dist/types/components/tree-view/tree-view.template.d.ts +2 -0
- package/dist/types/components.d.ts +95 -12
- package/package.json +2 -1
- package/dist/dso-toolkit/p-05a853b9.entry.js +0 -1
- package/dist/dso-toolkit/p-2c6e9460.entry.js +0 -1
- package/dist/dso-toolkit/p-43772cee.entry.js +0 -1
- package/dist/dso-toolkit/p-94500196.entry.js +0 -1
- package/dist/dso-toolkit/p-a2357726.entry.js +0 -1
- package/dist/dso-toolkit/p-c5acf7e2.entry.js +0 -1
|
@@ -16,8 +16,12 @@ export declare class Tooltip {
|
|
|
16
16
|
*/
|
|
17
17
|
noArrow: boolean;
|
|
18
18
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
* Deactivates mouseover behaviour
|
|
20
|
+
*/
|
|
21
|
+
stateless?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Defines if the tooltip has a smaller max-width
|
|
24
|
+
*/
|
|
21
25
|
small?: boolean;
|
|
22
26
|
/**
|
|
23
27
|
* Whether or not to show the tooltip. To control the tooltip add the `active` attribute or use the `activate()` and `deactivate()` instance methods.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FunctionalComponent } from '../../stencil-public-runtime';
|
|
2
|
+
import { TreeViewItem } from '@dso-toolkit/sources';
|
|
3
|
+
import { TreeView } from './tree-view';
|
|
4
|
+
interface TreeViewItemProps<T> {
|
|
5
|
+
owner: TreeView;
|
|
6
|
+
ancestors: TreeViewItem<T>[];
|
|
7
|
+
item: TreeViewItem<T>;
|
|
8
|
+
index: number;
|
|
9
|
+
level: number;
|
|
10
|
+
setSize: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const DsoTreeItem: FunctionalComponent<TreeViewItemProps<string>>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ComponentInterface, Event, EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
import { TreeViewItem } from '@dso-toolkit/sources';
|
|
3
|
+
export declare class TreeView implements ComponentInterface {
|
|
4
|
+
/**
|
|
5
|
+
* The collection of TreeViewItems
|
|
6
|
+
*/
|
|
7
|
+
collection: TreeViewItem<string>[];
|
|
8
|
+
/**
|
|
9
|
+
* Emitted when a tree view item is opened.
|
|
10
|
+
* The `detail` property of the `CustomEvent` will contain the complete path of TreeViewItems from the
|
|
11
|
+
* root to the item that is emitting the open event. The consumer of the event is responsible for updating
|
|
12
|
+
* the TreeView's collection (usually set the open state on the last TreeViewItem in path).
|
|
13
|
+
*/
|
|
14
|
+
openItem: EventEmitter<TreeViewItem<string>[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Emitted when a tree view item is closed.
|
|
17
|
+
* The `detail` property of the `CustomEvent` will contain the complete path of TreeViewItems from the
|
|
18
|
+
* root to the item that is emitting the close event. The consumer of the event is responsible for updating
|
|
19
|
+
* the TreeView's collection (usually set the closed state on the last TreeViewItem in path).
|
|
20
|
+
*/
|
|
21
|
+
closeItem: EventEmitter<TreeViewItem<string>[]>;
|
|
22
|
+
/**
|
|
23
|
+
* Emitted when a tree view item is clicked.
|
|
24
|
+
* The `detail` property of the `CustomEvent` will contain the complete path of TreeViewItems from the
|
|
25
|
+
* root to the item that is emitting the clicked event.
|
|
26
|
+
*/
|
|
27
|
+
clickItem: EventEmitter<TreeViewItem<string>[]>;
|
|
28
|
+
keyDownListener: (event: KeyboardEvent) => void;
|
|
29
|
+
itemClick: (event: Event, ancestors: TreeViewItem<string>[], item: TreeViewItem<string>) => void;
|
|
30
|
+
private static setFocus;
|
|
31
|
+
private static moveFocus;
|
|
32
|
+
private static expandItemOrFocusChild;
|
|
33
|
+
private static collapseItemOrFocusParent;
|
|
34
|
+
private static setFocusByFirstCharacter;
|
|
35
|
+
render(): any;
|
|
36
|
+
}
|
|
@@ -6,12 +6,13 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
8
|
import { Suggestion } from "./components/autosuggest/autosuggest";
|
|
9
|
-
import { DsoDatePickerChangeEvent, DsoDatePickerDirection, DsoDatePickerFocusEvent } from "./components/date-picker/date-picker";
|
|
9
|
+
import { DsoDatePickerChangeEvent, DsoDatePickerDirection, DsoDatePickerFocusEvent, DsoDatePickerKeyboardEvent } from "./components/date-picker/date-picker";
|
|
10
10
|
import { InfoButtonToggleEvent } from "./components/info-button/info-button";
|
|
11
11
|
import { BaseLayer } from "./components/map-base-layers/map-base-layers.interfaces";
|
|
12
12
|
import { Overlay } from "./components/map-overlays/map-overlays.interfaces";
|
|
13
13
|
import { ContentAnchor } from "./components/ozon-content/ozon-content.interfaces";
|
|
14
14
|
import { SelectableChangeEvent } from "./components/selectable/selectable";
|
|
15
|
+
import { TreeViewItem } from "@dso-toolkit/sources";
|
|
15
16
|
export namespace Components {
|
|
16
17
|
interface DsoAlert {
|
|
17
18
|
/**
|
|
@@ -27,15 +28,14 @@ export namespace Components {
|
|
|
27
28
|
"count": number;
|
|
28
29
|
}
|
|
29
30
|
interface DsoAutosuggest {
|
|
30
|
-
/**
|
|
31
|
-
* A method that will be called debounced with the input value as its first parameter. This method will also be called when the input is reduced to an empty string.
|
|
32
|
-
* @returns A promise with an array of `Suggestion`s. You should limit this array to ten items.
|
|
33
|
-
*/
|
|
34
|
-
"fetchSuggestions"?: (value: string) => Promise<Array<Suggestion>>;
|
|
35
31
|
/**
|
|
36
32
|
* Whether the previous suggestions will be presented when the input gets focus again.
|
|
37
33
|
*/
|
|
38
34
|
"suggestOnFocus": boolean;
|
|
35
|
+
/**
|
|
36
|
+
* The suggestions for the value of the slotted input element
|
|
37
|
+
*/
|
|
38
|
+
"suggestions": Suggestion[];
|
|
39
39
|
}
|
|
40
40
|
interface DsoBadge {
|
|
41
41
|
"status"?: 'primary' | 'success' | 'info' | 'warning' | 'danger';
|
|
@@ -52,6 +52,10 @@ export namespace Components {
|
|
|
52
52
|
* Makes the date picker input component disabled. This prevents users from being able to interact with the input, and conveys its inactive state to assistive technologies.
|
|
53
53
|
*/
|
|
54
54
|
"disabled": boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Should the input be focused on load?
|
|
57
|
+
*/
|
|
58
|
+
"dsoAutofocus": boolean;
|
|
55
59
|
/**
|
|
56
60
|
* Hide the calendar modal. Set `moveFocusToButton` to false to prevent focus returning to the date picker's button. Default is true.
|
|
57
61
|
*/
|
|
@@ -115,7 +119,7 @@ export namespace Components {
|
|
|
115
119
|
"yellow"?: boolean;
|
|
116
120
|
}
|
|
117
121
|
interface DsoIcon {
|
|
118
|
-
"icon"
|
|
122
|
+
"icon"?: string;
|
|
119
123
|
}
|
|
120
124
|
interface DsoInfo {
|
|
121
125
|
"active"?: boolean;
|
|
@@ -124,6 +128,7 @@ export namespace Components {
|
|
|
124
128
|
interface DsoInfoButton {
|
|
125
129
|
"active"?: boolean;
|
|
126
130
|
"label": string;
|
|
131
|
+
"secondary"?: boolean;
|
|
127
132
|
}
|
|
128
133
|
interface DsoLabel {
|
|
129
134
|
"compact"?: boolean;
|
|
@@ -168,6 +173,12 @@ export namespace Components {
|
|
|
168
173
|
"type": 'checkbox' | 'radio';
|
|
169
174
|
"value": string;
|
|
170
175
|
}
|
|
176
|
+
interface DsoToggletip {
|
|
177
|
+
"label": string;
|
|
178
|
+
"position": "top" | "right" | "bottom" | "left";
|
|
179
|
+
"secondary"?: boolean;
|
|
180
|
+
"small"?: boolean;
|
|
181
|
+
}
|
|
171
182
|
interface DsoTooltip {
|
|
172
183
|
/**
|
|
173
184
|
* Activate the tooltip (Sets the `active` attribute)
|
|
@@ -197,6 +208,16 @@ export namespace Components {
|
|
|
197
208
|
* Defines if the tooltip has a smaller max-width
|
|
198
209
|
*/
|
|
199
210
|
"small"?: boolean;
|
|
211
|
+
/**
|
|
212
|
+
* Deactivates mouseover behaviour
|
|
213
|
+
*/
|
|
214
|
+
"stateless"?: boolean;
|
|
215
|
+
}
|
|
216
|
+
interface DsoTreeView {
|
|
217
|
+
/**
|
|
218
|
+
* The collection of TreeViewItems
|
|
219
|
+
*/
|
|
220
|
+
"collection": TreeViewItem<string>[];
|
|
200
221
|
}
|
|
201
222
|
}
|
|
202
223
|
declare global {
|
|
@@ -314,12 +335,24 @@ declare global {
|
|
|
314
335
|
prototype: HTMLDsoSelectableElement;
|
|
315
336
|
new (): HTMLDsoSelectableElement;
|
|
316
337
|
};
|
|
338
|
+
interface HTMLDsoToggletipElement extends Components.DsoToggletip, HTMLStencilElement {
|
|
339
|
+
}
|
|
340
|
+
var HTMLDsoToggletipElement: {
|
|
341
|
+
prototype: HTMLDsoToggletipElement;
|
|
342
|
+
new (): HTMLDsoToggletipElement;
|
|
343
|
+
};
|
|
317
344
|
interface HTMLDsoTooltipElement extends Components.DsoTooltip, HTMLStencilElement {
|
|
318
345
|
}
|
|
319
346
|
var HTMLDsoTooltipElement: {
|
|
320
347
|
prototype: HTMLDsoTooltipElement;
|
|
321
348
|
new (): HTMLDsoTooltipElement;
|
|
322
349
|
};
|
|
350
|
+
interface HTMLDsoTreeViewElement extends Components.DsoTreeView, HTMLStencilElement {
|
|
351
|
+
}
|
|
352
|
+
var HTMLDsoTreeViewElement: {
|
|
353
|
+
prototype: HTMLDsoTreeViewElement;
|
|
354
|
+
new (): HTMLDsoTreeViewElement;
|
|
355
|
+
};
|
|
323
356
|
interface HTMLElementTagNameMap {
|
|
324
357
|
"dso-alert": HTMLDsoAlertElement;
|
|
325
358
|
"dso-attachments-counter": HTMLDsoAttachmentsCounterElement;
|
|
@@ -340,7 +373,9 @@ declare global {
|
|
|
340
373
|
"dso-progress-bar": HTMLDsoProgressBarElement;
|
|
341
374
|
"dso-progress-indicator": HTMLDsoProgressIndicatorElement;
|
|
342
375
|
"dso-selectable": HTMLDsoSelectableElement;
|
|
376
|
+
"dso-toggletip": HTMLDsoToggletipElement;
|
|
343
377
|
"dso-tooltip": HTMLDsoTooltipElement;
|
|
378
|
+
"dso-tree-view": HTMLDsoTreeViewElement;
|
|
344
379
|
}
|
|
345
380
|
}
|
|
346
381
|
declare namespace LocalJSX {
|
|
@@ -359,18 +394,21 @@ declare namespace LocalJSX {
|
|
|
359
394
|
}
|
|
360
395
|
interface DsoAutosuggest {
|
|
361
396
|
/**
|
|
362
|
-
*
|
|
363
|
-
* @returns A promise with an array of `Suggestion`s. You should limit this array to ten items.
|
|
397
|
+
* This is emitted debounced for every change for the slotted input type=text element.
|
|
364
398
|
*/
|
|
365
|
-
"
|
|
399
|
+
"onDsoChange"?: (event: CustomEvent<string>) => void;
|
|
366
400
|
/**
|
|
367
401
|
* Emitted when a suggestion is selected. The `detail` property of the `CustomEvent` will contain the selected suggestion.
|
|
368
402
|
*/
|
|
369
|
-
"
|
|
403
|
+
"onDsoSelect"?: (event: CustomEvent<Suggestion>) => void;
|
|
370
404
|
/**
|
|
371
405
|
* Whether the previous suggestions will be presented when the input gets focus again.
|
|
372
406
|
*/
|
|
373
407
|
"suggestOnFocus"?: boolean;
|
|
408
|
+
/**
|
|
409
|
+
* The suggestions for the value of the slotted input element
|
|
410
|
+
*/
|
|
411
|
+
"suggestions"?: Suggestion[];
|
|
374
412
|
}
|
|
375
413
|
interface DsoBadge {
|
|
376
414
|
"status"?: 'primary' | 'success' | 'info' | 'warning' | 'danger';
|
|
@@ -387,6 +425,10 @@ declare namespace LocalJSX {
|
|
|
387
425
|
* Makes the date picker input component disabled. This prevents users from being able to interact with the input, and conveys its inactive state to assistive technologies.
|
|
388
426
|
*/
|
|
389
427
|
"disabled"?: boolean;
|
|
428
|
+
/**
|
|
429
|
+
* Should the input be focused on load?
|
|
430
|
+
*/
|
|
431
|
+
"dsoAutofocus"?: boolean;
|
|
390
432
|
/**
|
|
391
433
|
* Adds a unique identifier for the date picker input. Use this instead of html `id` attribute.
|
|
392
434
|
*/
|
|
@@ -415,6 +457,14 @@ declare namespace LocalJSX {
|
|
|
415
457
|
* Event emitted the date picker input is focused.
|
|
416
458
|
*/
|
|
417
459
|
"onDsoFocus"?: (event: CustomEvent<DsoDatePickerFocusEvent>) => void;
|
|
460
|
+
/**
|
|
461
|
+
* Event emitted on key down in the date picker input.
|
|
462
|
+
*/
|
|
463
|
+
"onDsoKeyDown"?: (event: CustomEvent<DsoDatePickerKeyboardEvent>) => void;
|
|
464
|
+
/**
|
|
465
|
+
* Event emitted on key up in the date picker input.
|
|
466
|
+
*/
|
|
467
|
+
"onDsoKeyUp"?: (event: CustomEvent<DsoDatePickerKeyboardEvent>) => void;
|
|
418
468
|
/**
|
|
419
469
|
* Should the input be marked as required?
|
|
420
470
|
*/
|
|
@@ -450,7 +500,7 @@ declare namespace LocalJSX {
|
|
|
450
500
|
"yellow"?: boolean;
|
|
451
501
|
}
|
|
452
502
|
interface DsoIcon {
|
|
453
|
-
"icon"
|
|
503
|
+
"icon"?: string;
|
|
454
504
|
}
|
|
455
505
|
interface DsoInfo {
|
|
456
506
|
"active"?: boolean;
|
|
@@ -461,6 +511,7 @@ declare namespace LocalJSX {
|
|
|
461
511
|
"active"?: boolean;
|
|
462
512
|
"label"?: string;
|
|
463
513
|
"onToggle"?: (event: CustomEvent<InfoButtonToggleEvent>) => void;
|
|
514
|
+
"secondary"?: boolean;
|
|
464
515
|
}
|
|
465
516
|
interface DsoLabel {
|
|
466
517
|
"compact"?: boolean;
|
|
@@ -512,6 +563,12 @@ declare namespace LocalJSX {
|
|
|
512
563
|
"type": 'checkbox' | 'radio';
|
|
513
564
|
"value": string;
|
|
514
565
|
}
|
|
566
|
+
interface DsoToggletip {
|
|
567
|
+
"label"?: string;
|
|
568
|
+
"position"?: "top" | "right" | "bottom" | "left";
|
|
569
|
+
"secondary"?: boolean;
|
|
570
|
+
"small"?: boolean;
|
|
571
|
+
}
|
|
515
572
|
interface DsoTooltip {
|
|
516
573
|
/**
|
|
517
574
|
* Whether or not to show the tooltip. To control the tooltip add the `active` attribute or use the `activate()` and `deactivate()` instance methods.
|
|
@@ -533,6 +590,28 @@ declare namespace LocalJSX {
|
|
|
533
590
|
* Defines if the tooltip has a smaller max-width
|
|
534
591
|
*/
|
|
535
592
|
"small"?: boolean;
|
|
593
|
+
/**
|
|
594
|
+
* Deactivates mouseover behaviour
|
|
595
|
+
*/
|
|
596
|
+
"stateless"?: boolean;
|
|
597
|
+
}
|
|
598
|
+
interface DsoTreeView {
|
|
599
|
+
/**
|
|
600
|
+
* The collection of TreeViewItems
|
|
601
|
+
*/
|
|
602
|
+
"collection": TreeViewItem<string>[];
|
|
603
|
+
/**
|
|
604
|
+
* Emitted when a tree view item is clicked. The `detail` property of the `CustomEvent` will contain the complete path of TreeViewItems from the root to the item that is emitting the clicked event.
|
|
605
|
+
*/
|
|
606
|
+
"onClickItem"?: (event: CustomEvent<TreeViewItem<string>[]>) => void;
|
|
607
|
+
/**
|
|
608
|
+
* Emitted when a tree view item is closed. The `detail` property of the `CustomEvent` will contain the complete path of TreeViewItems from the root to the item that is emitting the close event. The consumer of the event is responsible for updating the TreeView's collection (usually set the closed state on the last TreeViewItem in path).
|
|
609
|
+
*/
|
|
610
|
+
"onCloseItem"?: (event: CustomEvent<TreeViewItem<string>[]>) => void;
|
|
611
|
+
/**
|
|
612
|
+
* Emitted when a tree view item is opened. The `detail` property of the `CustomEvent` will contain the complete path of TreeViewItems from the root to the item that is emitting the open event. The consumer of the event is responsible for updating the TreeView's collection (usually set the open state on the last TreeViewItem in path).
|
|
613
|
+
*/
|
|
614
|
+
"onOpenItem"?: (event: CustomEvent<TreeViewItem<string>[]>) => void;
|
|
536
615
|
}
|
|
537
616
|
interface IntrinsicElements {
|
|
538
617
|
"dso-alert": DsoAlert;
|
|
@@ -554,7 +633,9 @@ declare namespace LocalJSX {
|
|
|
554
633
|
"dso-progress-bar": DsoProgressBar;
|
|
555
634
|
"dso-progress-indicator": DsoProgressIndicator;
|
|
556
635
|
"dso-selectable": DsoSelectable;
|
|
636
|
+
"dso-toggletip": DsoToggletip;
|
|
557
637
|
"dso-tooltip": DsoTooltip;
|
|
638
|
+
"dso-tree-view": DsoTreeView;
|
|
558
639
|
}
|
|
559
640
|
}
|
|
560
641
|
export { LocalJSX as JSX };
|
|
@@ -580,7 +661,9 @@ declare module "@stencil/core" {
|
|
|
580
661
|
"dso-progress-bar": LocalJSX.DsoProgressBar & JSXBase.HTMLAttributes<HTMLDsoProgressBarElement>;
|
|
581
662
|
"dso-progress-indicator": LocalJSX.DsoProgressIndicator & JSXBase.HTMLAttributes<HTMLDsoProgressIndicatorElement>;
|
|
582
663
|
"dso-selectable": LocalJSX.DsoSelectable & JSXBase.HTMLAttributes<HTMLDsoSelectableElement>;
|
|
664
|
+
"dso-toggletip": LocalJSX.DsoToggletip & JSXBase.HTMLAttributes<HTMLDsoToggletipElement>;
|
|
583
665
|
"dso-tooltip": LocalJSX.DsoTooltip & JSXBase.HTMLAttributes<HTMLDsoTooltipElement>;
|
|
666
|
+
"dso-tree-view": LocalJSX.DsoTreeView & JSXBase.HTMLAttributes<HTMLDsoTreeViewElement>;
|
|
584
667
|
}
|
|
585
668
|
}
|
|
586
669
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dso-toolkit/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "31.1.0",
|
|
4
4
|
"description": "DSO Toolkit Web Components",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/custom-elements/index.js",
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"cypress-axe": "^0.13.0",
|
|
55
55
|
"cypress-real-events": "^1.5.1",
|
|
56
56
|
"debounce": "^1.2.1",
|
|
57
|
+
"escape-string-regexp": "^5.0.0",
|
|
57
58
|
"http-proxy-middleware": "^2.0.1",
|
|
58
59
|
"http-server": "^13.0.2",
|
|
59
60
|
"lit-html": "^2.0.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as s,h as i,F as e,g as o}from"./p-a40eeb32.js";import{v as a}from"./p-19b890a3.js";function h(t,s,i){var e,o,a,h,n;function r(){var l=Date.now()-h;l<s&&l>=0?e=setTimeout(r,s-l):(e=null,i||(n=t.apply(a,o),a=o=null))}null==s&&(s=100);var l=function(){a=this,o=arguments,h=Date.now();var l=i&&!e;return e||(e=setTimeout(r,s)),l&&(n=t.apply(a,o),a=o=null),n};return l.clear=function(){e&&(clearTimeout(e),e=null)},l.flush=function(){e&&(n=t.apply(a,o),a=o=null,clearTimeout(e),e=null)},l}h.debounce=h;var n=h;let r=class{constructor(i){t(this,i),this.selected=s(this,"selected",7),this.suggestOnFocus=!1,this.suggestions=[],this.selectedIndex=-1,this.terms=[],this.showSuggestions=!1,this.listboxId=a(),this.inputId=a(),this.labelId=a(),this.debouncedFetchSuggestions=n((t=>(this.fetchSuggestions?this.fetchSuggestions(t.join(" ")):Promise.resolve([])).then((s=>{this.suggestions=s.map(((t,s)=>({value:t.value,type:t.type,selected:!1,id:`${s}-${this.inputId}`}))),this.terms=t,this.openSuggestions()})).catch((()=>{this.closeSuggestions(),this.suggestions=[]}))),200),this.onInput=t=>{var s;if(!(t.target instanceof HTMLInputElement))throw new Error("event.target not a instance of HTMLInputElement");this.debouncedFetchSuggestions(null!==(s=`${t.target.value}`.match(/(\S+)/g))&&void 0!==s?s:[])},this.onFocusIn=()=>{this.suggestOnFocus&&this.openSuggestions()},this.onMouseEnterOption=t=>{if(t.target instanceof HTMLElement){const s=t.target.id;this.setSelectedSuggestion(this.suggestions.findIndex((t=>t.id==s)))}},this.onMouseLeaveOption=()=>{this.setSelectedSuggestion(-1)},this.onClickOption=()=>{this.pickSelectedValue()},this.onKeyDown=t=>{if(!t.defaultPrevented){switch(t.key){case"ArrowDown":this.showSuggestions||this.openSuggestions(),this.setSelectedSuggestion(this.selectedIndex>=this.suggestions.length-1?0:this.selectedIndex+1);break;case"ArrowUp":this.showSuggestions||this.openSuggestions(),this.setSelectedSuggestion(this.selectedIndex<=0?this.suggestions.length-1:this.selectedIndex-1);break;case"Tab":return void this.closeSuggestions();case"Escape":this.closeSuggestions();break;case"Enter":this.pickSelectedValue();break;default:return}t.preventDefault()}}}onDocumentClick(t){this.showSuggestions&&this.listbox&&t.target instanceof Node&&!this.listbox.contains(t.target)&&this.input!=t.target&&this.closeSuggestions()}connectedCallback(){const t=this.host.querySelectorAll('input[type="text"]')[0];if(!(t instanceof HTMLInputElement))throw new ReferenceError("Mandatory text input not found");if(this.input=t,t.id?this.inputId=t.id:t.id=this.inputId,!this.input.labels||this.input.labels.length<1)throw new ReferenceError("Mandatory label for text input not found");const s=this.input.labels[0];s.id?this.labelId=s.id:s.id=this.labelId,this.input.setAttribute("role","combobox"),this.input.setAttribute("aria-haspopup","listbox"),this.input.setAttribute("aria-owns",this.listboxId),this.input.setAttribute("aria-expanded","false"),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("aria-autocomplete","list"),this.input.setAttribute("aria-activedescendant",""),this.input.addEventListener("input",this.onInput),this.input.addEventListener("keydown",this.onKeyDown),this.input.addEventListener("focusin",this.onFocusIn)}disconnectedCallback(){this.input.removeEventListener("input",this.onInput),this.input.removeEventListener("keydown",this.onKeyDown),this.input.removeEventListener("focusin",this.onFocusIn)}markTerms(t,s){if(!t||!s||0==s.length)return[""];const e=new RegExp(`(${s[0]})`,"gi");return t.split(e).map((t=>t?e.test(t)?i("mark",null,t):1==s.length?i("span",null,t):this.markTerms(t,s.slice(1)):""))}setSelectedSuggestion(t){this.suggestions.forEach((t=>t.selected=!1)),t<0||t>=this.suggestions.length?(this.selectedIndex=-1,this.input.setAttribute("aria-activedescendant","")):(this.selectedIndex=t,this.suggestions[t].selected=!0,this.input.setAttribute("aria-activedescendant",this.suggestions[t].id)),this.suggestions=[...this.suggestions]}openSuggestions(){this.showSuggestions=this.suggestions.length>0,this.input.setAttribute("aria-expanded",`${this.showSuggestions}`),this.setSelectedSuggestion(-1)}closeSuggestions(){this.showSuggestions=!1,this.input.setAttribute("aria-expanded","false"),this.setSelectedSuggestion(-1)}pickSelectedValue(){var t;this.selectedIndex>=0&&(this.input.value=this.suggestions[this.selectedIndex].value,null===(t=this.selected)||void 0===t||t.emit(this.input.value)),this.suggestions=[],this.closeSuggestions()}render(){return i(e,null,i("slot",null),i("ul",{role:"listbox",id:this.listboxId,"aria-labelledby":this.labelId,ref:t=>this.listbox=t,style:{display:this.showSuggestions?"block":"none"}},this.showSuggestions?this.suggestions.map((t=>i("li",{role:"option",id:t.id,key:t.id,onMouseEnter:this.onMouseEnterOption,onMouseLeave:this.onMouseLeaveOption,onClick:this.onClickOption,"aria-selected":""+t.selected,"aria-label":t.value},i("span",{class:"value"},this.markTerms(t.value,this.terms)),t.type?i("span",{class:"type"},t.type):void 0))):void 0))}get host(){return o(this)}};r.style="ul.sc-dso-autosuggest{background-clip:padding-box;background-color:#fff;border:1px solid rgba(0, 0, 0, 0.15);border-radius:4px;box-shadow:0 6px 12px rgba(0, 0, 0, 0.175);list-style-type:none;margin-top:2px;padding:4px 0}ul.sc-dso-autosuggest li.sc-dso-autosuggest{display:flex;justify-content:space-between;padding:4px 18px}li[aria-selected=true].sc-dso-autosuggest{cursor:pointer;background-color:#39870c}li[aria-selected=true].sc-dso-autosuggest,li[aria-selected=true].sc-dso-autosuggest .type.sc-dso-autosuggest{color:#fff}mark.sc-dso-autosuggest{font-weight:700;background-color:inherit;color:inherit;padding:0}.type.sc-dso-autosuggest{color:#666}";export{r as dso_autosuggest}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,c as l,h as s}from"./p-a40eeb32.js";import{c as r}from"./p-4070c1e5.js";let e=class{constructor(s){o(this,s),this.removeClick=l(this,"removeClick",7)}render(){const o=this.status&&e.statusMap.get(this.status);return s("span",{class:r("dso-label",{[`dso-label-${this.status}`]:this.status,"dso-compact":this.compact&&!this.removable,"dso-hover":this.hover})},o&&s("span",{class:"sr-only"},o,": "),s("slot",null),this.removable&&s("button",{type:"button",onClick:o=>this.removeClick.emit(o),title:"Verwijder",onMouseEnter:()=>this.hover=!0,onMouseLeave:()=>this.hover=!1},s("dso-icon",{icon:"times"})))}};e.statusMap=new Map([["info","Opmerking"],["success","Gelukt"],["warning","Waarschuwing"],["danger","Fout"]]),e.style=":host{display:inline-block}*,*::after,*::before{box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.dso-label{background-color:#f2f2f2;border-radius:4px;color:#191919;display:inline-block;line-height:1.5}.dso-label:not(.dso-label-bright){padding:4px 8px}.dso-label:focus-within,.dso-label.dso-hover{text-decoration:line-through}.dso-label button{background:none;border:0;border-radius:0 4px 4px 0;color:inherit;float:right;font-size:16px;margin-bottom:-4px;margin-left:8px;margin-right:-4px;margin-top:0;padding:0}.dso-label button:hover{cursor:pointer}.dso-label button>dso-icon,.dso-label button>svg.di{display:block}.dso-label.dso-compact{border:0;padding:0 8px}.dso-label.dso-label-info{background-color:#6ca4d9;color:#191919}.dso-label.dso-label-primary{background-color:#275937;color:#fff}.dso-label.dso-label-success{background-color:#39870c;color:#fff}.dso-label.dso-label-warning{background-color:#dcd400;color:#191919}.dso-label.dso-label-danger{background-color:#ce3f51;color:#fff}.dso-label.dso-label-bright{background-color:#fff;color:#191919;border:1px solid #ccc;padding:3px 7px}";export{e as dso_label}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as n,h as o}from"./p-a40eeb32.js";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t){if(!("string"==typeof t||t instanceof String)){var n=e(t);throw null===t?n="null":"object"===n&&(n=t.constructor.name),new TypeError("Expected a string but received a ".concat(n))}}function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;for(var o in n)void 0===t[o]&&(t[o]=n[o]);return t}var l={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1},a="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",u="(".concat(a,"[.]){3}").concat(a),d=new RegExp("^".concat(u,"$")),s="(?:[0-9a-fA-F]{1,4})",c=new RegExp("^("+"(?:".concat(s,":){7}(?:").concat(s,"|:)|")+"(?:".concat(s,":){6}(?:").concat(u,"|:").concat(s,"|:)|")+"(?:".concat(s,":){5}(?::").concat(u,"|(:").concat(s,"){1,2}|:)|")+"(?:".concat(s,":){4}(?:(:").concat(s,"){0,1}:").concat(u,"|(:").concat(s,"){1,3}|:)|")+"(?:".concat(s,":){3}(?:(:").concat(s,"){0,2}:").concat(u,"|(:").concat(s,"){1,4}|:)|")+"(?:".concat(s,":){2}(?:(:").concat(s,"){0,3}:").concat(u,"|(:").concat(s,"){1,5}|:)|")+"(?:".concat(s,":){1}(?:(:").concat(s,"){0,4}:").concat(u,"|(:").concat(s,"){1,6}|:)|")+"(?::((?::".concat(s,"){0,5}:").concat(u,"|(?::").concat(s,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");function f(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(r(t),!(n=String(n)))return f(t,4)||f(t,6);if("4"===n){if(!d.test(t))return!1;var o=t.split(".").sort((function(t,n){return t-n}));return o[3]<=255}return"6"===n&&!!c.test(t)}var p={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,validate_length:!0},h=/^\[([^\]]+)\](?::([0-9]+))?$/;function m(t,n){for(var o=0;o<n.length;o++){var e=n[o];if(t===e||"[object RegExp]"===Object.prototype.toString.call(e)&&e.test(t))return!0}return!1}const v=[function(t){return t.querySelectorAll("a.noot > div.noot_popup").forEach(((t,n)=>{const o=t.querySelector(".od-Al"),e=null==o?void 0:o.parentElement,r=null==e?void 0:e.parentElement,i=document.createElement("sup");i.replaceChildren(...Array.from(r.childNodes)),null==r||r.replaceChildren(i),null==r||r.after(o),null==e||e.remove();const l=(n+1).toString(10),[a,u]=[`dso-ozon-term-${l}`,`dso-ozon-content-${l}`];null==r||r.setAttribute("id",a),null==r||r.setAttribute("aria-controls",u),null==r||r.setAttribute("aria-expanded","false"),null==o||o.setAttribute("id",u)})),t},function(t){return t.querySelectorAll("span[data-verwijst-naar-documentcomponent]").forEach((t=>{const n=document.createElement("a");n.href=`#${t.getAttribute("data-verwijst-naar-documentcomponent")}`,n.replaceChildren(...Array.from(t.childNodes)),t.replaceWith(n)})),t}];class g{constructor(t){this.anchorClick=t,this.domParser=new DOMParser,this.eventHandlers=[this.handleValidUrls,this.handleDescriptionNoteClick,this.handleContentAnchor]}setContent(t){this.content=v.reduce(((t,n)=>n(t)),this.domParser.parseFromString(t,"text/html").body).children}handleClickEvent(t){this.eventHandlers.some((n=>n.bind(this)(t.composedPath(),t)))}handleDescriptionNoteClick(t,n){var o;const e=t.findIndex(this.isHostElement);if(-1===e)return!1;const r=null===(o=t.slice(0,e))||void 0===o?void 0:o.find((t=>t instanceof HTMLAnchorElement&&t.classList.contains("noot")));return!!r&&(n.preventDefault(),r.classList.contains("dso-open")?(r.classList.remove("dso-open"),r.setAttribute("aria-expanded","false")):(r.classList.add("dso-open"),r.setAttribute("aria-expanded","true")),!0)}handleContentAnchor(t,n){if(t.some((t=>t instanceof HTMLAnchorElement))){n.preventDefault();const o=t.find((t=>t instanceof HTMLAnchorElement)).href;return this.anchorClick.emit({href:o,documentComponent:o.substr(o.indexOf("#")+1),originalEvent:n}),!0}return!1}handleValidUrls(t){var n;const o=t.findIndex(this.isHostElement);return-1!==o&&(null===(n=t.slice(0,o))||void 0===n?void 0:n.some((t=>{var n;return t instanceof HTMLAnchorElement&&function(t,n){if(r(t),!t||/[\s<>]/.test(t))return!1;if(0===t.indexOf("mailto:"))return!1;if((n=i(n,p)).validate_length&&t.length>=2083)return!1;var o,e,a,u,d,s,c,v;if(c=t.split("#"),t=c.shift(),c=t.split("?"),t=c.shift(),(c=t.split("://")).length>1){if(o=c.shift().toLowerCase(),n.require_valid_protocol&&-1===n.protocols.indexOf(o))return!1}else{if(n.require_protocol)return!1;if("//"===t.substr(0,2)){if(!n.allow_protocol_relative_urls)return!1;c[0]=t.substr(2)}}if(""===(t=c.join("://")))return!1;if(c=t.split("/"),""===(t=c.shift())&&!n.require_host)return!0;if((c=t.split("@")).length>1){if(n.disallow_auth)return!1;if(""===c[0]||":"===c[0].substr(0,1))return!1;if((e=c.shift()).indexOf(":")>=0&&e.split(":").length>2)return!1}s=null,v=null;var g=(u=c.join("@")).match(h);if(g?(a="",v=g[1],s=g[2]||null):(a=(c=u.split(":")).shift(),c.length&&(s=c.join(":"))),null!==s){if(d=parseInt(s,10),!/^[0-9]+$/.test(s)||d<=0||d>65535)return!1}else if(n.require_port)return!1;return!(!(f(a)||function(t,n){r(t),(n=i(n,l)).allow_trailing_dot&&"."===t[t.length-1]&&(t=t.substring(0,t.length-1));var o=t.split("."),e=o[o.length-1];if(n.require_tld){if(o.length<2)return!1;if(!/^([a-z\u00a1-\uffff]{2,}|xn[a-z0-9-]{2,})$/i.test(e))return!1;if(/[\s\u2002-\u200B\u202F\u205F\u3000\uFEFF\uDB40\uDC20\u00A9\uFFFD]/.test(e))return!1}return!(!n.allow_numeric_tld&&/^\d+$/.test(e))&&o.every((function(t){return!(t.length>63||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(t)||/[\uff01-\uff5e]/.test(t)||/^-|-$/.test(t)||!n.allow_underscores&&/_/.test(t))}))}(a,n)||v&&f(v,6))||(a=a||v,n.host_whitelist&&!m(a,n.host_whitelist)||n.host_blacklist&&m(a,n.host_blacklist)))}(null!==(n=t.getAttribute("href"))&&void 0!==n?n:"",{require_tld:!1})})))}isHostElement(t){return t instanceof HTMLElement&&"DSO-OZON-CONTENT"===t.tagName}}let b=class{constructor(o){t(this,o),this.anchorClick=n(this,"anchorClick",7)}handleClick(t){this.transformer.handleClickEvent(t)}componentWillLoad(){this.transformer=new g(this.anchorClick)}componentWillRender(){this.transformer.setContent(this.content)}render(){return o("div",{class:"dso-rich-content",ref:t=>this.container=t})}componentDidRender(){var t;const n=this.transformer.content;this.container&&n?this.container.replaceChildren(...Array.from(n)):null===(t=this.container)||void 0===t||t.replaceChildren()}};b.style='dso-ozon-content{display:block}.noot{text-decoration:none}.noot:not(.dso-open)+.od-Al{display:none}.noot.dso-open+.od-Al{display:block}.noot+.od-Al{margin:4px 0;padding:8px 32px 8px 8px;position:relative}.noot+.od-Al>a{display:block;height:24px;position:absolute;right:0;text-align:center;top:0;width:24px}.noot+.od-Al>a::before{background:var(--dso-icon, var(--di-times-zwart)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em;content:"";display:block}.noot+.od-Al{background-color:#ebf3e6}.od-Term{font-weight:700}.od-Definitie,.od-Tussenkop{font-style:italic}.od-Inhoud,.od-Inhoud>.od-Lijst,.od-IntIoRef,.od-Lidnr,.od-LiNr,.od-Opschrift,.od-Tussenkop{display:inline}.od-Al,.od-Lijstaanhef{margin-bottom:0.75em}.od-IntIoRef{border-bottom:1px dotted}.od-LiNummer{float:left;min-width:0.7em;padding-right:0.3em;text-align:right}.od-Figuur img{margin-left:25px;max-width:100%;height:auto}.od-Figuur .od-Bijschrift{font-size:0.75rem;margin-left:25px;padding-bottom:2.5rem}.od-Tabel thead{font-weight:600}.od-Kadertekst{border:1px solid #e5e5e5;margin-bottom:1rem;padding:1rem}';export{b as dso_ozon_content}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e,r as t,c as i,H as s,g as a}from"./p-a40eeb32.js";import{c as o}from"./p-7b37bd52.js";var d;function n(e){if(!e)return;const t=e.split("-");return 3===t.length&&4===t[2].length?function(e,t,i){var s=parseInt(i,10),a=parseInt(t,10),o=parseInt(e,10);if(Number.isInteger(o)&&Number.isInteger(a)&&Number.isInteger(s)&&a>0&&a<=12&&s>0&&s<=31&&o>0)return new Date(o,a-1,s)}(t[2],t[1],t[0]):void 0}function r(e){return e?`${e.getDate().toString(10)}-${(e.getMonth()+1).toString(10)}-${e.getFullYear().toString(10)}`:""}function l(e,t){return!(!e||!t)&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function h(e,t){var i=new Date(e);return i.setDate(i.getDate()+t),i}function c(e,t=d.Monday){var i=new Date(e),s=i.getDay(),a=(s<t?7:0)+s-t;return i.setDate(i.getDate()-a),i}function p(e,t=d.Monday){var i=new Date(e),s=i.getDay(),a=6+(s<t?-7:0)-(s-t);return i.setDate(i.getDate()+a),i}function u(e){return new Date(e.getFullYear(),e.getMonth(),1)}function _(e){return new Date(e.getFullYear(),e.getMonth()+1,0)}function b(e,t){const i=new Date(e);return i.setMonth(t),i}function f(e,t){const i=new Date(e);return i.setFullYear(t),i}function g(e,t,i){return m(e,t,i)===e}function m(e,t,i){const s=e.getTime();return t&&t instanceof Date&&s<t.getTime()?t:i&&i instanceof Date&&s>i.getTime()?i:e}!function(e){e[e.Sunday=0]="Sunday",e[e.Monday=1]="Monday",e[e.Tuesday=2]="Tuesday",e[e.Wednesday=3]="Wednesday",e[e.Thursday=4]="Thursday",e[e.Friday=5]="Friday",e[e.Saturday=6]="Saturday"}(d||(d={}));const x=({focusedDay:t,today:i,day:s,onDaySelect:a,onKeyboardNavigation:o,focusedDayRef:d,inRange:n})=>{const h=l(s,i),c=l(s,t),p=s.getMonth()!==t.getMonth(),u=!n;return e("button",{class:{"dso-date__day":!0,"is-outside":u,"is-disabled":p,"is-today":h},tabIndex:c?0:-1,onClick:function(e){a(e,s)},onKeyDown:o,disabled:u||p,type:"button",ref:e=>{c&&e&&d&&d(e)}},e("span",{"aria-hidden":"true"},s.getDate()),e("span",{class:"dso-date__vhidden"},r(s)))},v=({selectedDate:t,focusedDate:i,labelledById:s,localization:a,firstDayOfWeek:o,min:n,max:r,onDateSelect:b,onKeyboardNavigation:f,focusedDayRef:m,onMouseDown:v,onFocusIn:y})=>{const w=new Date,k=function(e,t=d.Monday){return function(e,t){const i=[];let s=e;for(;!l(s,t);)i.push(s),s=h(s,1);return i.push(s),i}(c(u(e),t),p(_(e),t))}(i,o);return e("table",{class:"dso-date__table",role:"grid","aria-labelledby":s,onFocusin:y,onMouseDown:v},e("thead",null,e("tr",null,(z=o,M=t=>e("th",{class:"dso-date__table-header",scope:"col"},e("span",{"aria-hidden":"true"},t.substr(0,2)),e("span",{class:"dso-date__vhidden"},t)),(D=a.dayNames).map(((e,t)=>M(D[(t+z)%D.length])))))),e("tbody",null,function(e){const t=[];for(let i=0;i<e.length;i+=7)t.push(e.slice(i,i+7));return t}(k).map((s=>e("tr",{class:"dso-date__row"},s.map((s=>e("td",{class:"dso-date__cell",role:"gridcell","aria-selected":l(s,t)?"true":void 0,"aria-current":l(s,w)?"date":void 0},e(x,{day:s,today:w,focusedDay:i,inRange:g(s,n,r),onDaySelect:b,onKeyboardNavigation:f,focusedDayRef:m})))))))));var D,z,M},y={buttonLabel:"Kies datum",placeholder:"dd-mm-jjjj",selectedDateMessage:"Geselecteerde datum is",prevMonthLabel:"Vorige maand",nextMonthLabel:"Volgende maand",monthSelectLabel:"Maand",yearSelectLabel:"Jaar",closeLabel:"Sluit window",keyboardInstruction:"Gebruik de pijltjestoetsen om een dag te kiezen",calendarHeading:"Kies een datum",dayNames:["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag"],monthNames:["Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December"],monthNamesShort:["Jan","Feb","Mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"]},w=/[^0-9\.\/\-]+/g;let k=class{constructor(e){t(this,e),this.dateChange=i(this,"dateChange",7),this.dsoBlur=i(this,"dsoBlur",7),this.dsoFocus=i(this,"dsoFocus",7),this.monthSelectId=o("DsoDateMonth"),this.yearSelectId=o("DsoDateYear"),this.dialogLabelId=o("DsoDateLabel"),this.localization=y,this.firstDayOfWeek=d.Monday,this.activeFocus=!1,this.focusedDay=new Date,this.open=!1,this.name="date",this.disabled=!1,this.direction="right",this.required=!1,this.value="",this.enableActiveFocus=()=>{this.activeFocus=!0},this.disableActiveFocus=()=>{this.activeFocus=!1},this.toggleOpen=e=>{e.preventDefault(),this.open?this.hide(!1):this.show()},this.handleEscKey=e=>{27===e.keyCode&&this.hide()},this.handleBlur=e=>{e.stopPropagation(),this.dsoBlur.emit({component:"dso-date-picker"})},this.handleFocus=e=>{e.stopPropagation(),this.dsoFocus.emit({component:"dso-date-picker"})},this.handleTouchStart=e=>{const t=e.changedTouches[0];this.initialTouchX=t.pageX,this.initialTouchY=t.pageY},this.handleTouchMove=e=>{e.preventDefault()},this.handleTouchEnd=e=>{const t=e.changedTouches[0],i=t.pageX-this.initialTouchX,s=t.pageY-this.initialTouchY,a=Math.abs(i)>=70&&Math.abs(s)<=70,o=Math.abs(s)>=70&&Math.abs(i)<=70&&s>0;a?this.addMonths(i<0?1:-1):o&&(this.hide(!1),e.preventDefault()),this.initialTouchY=void 0,this.initialTouchX=void 0},this.handleNextMonthClick=e=>{e.preventDefault(),this.addMonths(1)},this.handlePreviousMonthClick=e=>{e.preventDefault(),this.addMonths(-1)},this.handleFirstFocusableKeydown=e=>{var t;9===e.keyCode&&e.shiftKey&&(null===(t=this.focusedDayNode)||void 0===t||t.focus(),e.preventDefault())},this.handleKeyboardNavigation=e=>{var t;if(9===e.keyCode&&!e.shiftKey)return e.preventDefault(),void(null===(t=this.firstFocusableElement)||void 0===t||t.focus());var i=!0;switch(e.keyCode){case 39:this.addDays(1);break;case 37:this.addDays(-1);break;case 40:this.addDays(7);break;case 38:this.addDays(-7);break;case 33:e.shiftKey?this.addYears(-1):this.addMonths(-1);break;case 34:e.shiftKey?this.addYears(1):this.addMonths(1);break;case 36:this.startOfWeek();break;case 35:this.endOfWeek();break;default:i=!1}i&&(e.preventDefault(),this.enableActiveFocus())},this.handleDaySelect=(e,t)=>{g(t,n(this.min),n(this.max))&&(t.getMonth()===this.focusedDay.getMonth()?(this.setValue(t),this.hide()):this.setFocusedDay(t))},this.handleMonthSelect=e=>{this.setMonth(parseInt(e.target.value,10))},this.handleYearSelect=e=>{this.setYear(parseInt(e.target.value,10))},this.handleInputChange=e=>{const t=e.target;t.value=t.value.replace(w,"");const i=n(t.value);(i||""===t.value)&&this.setValue(i)},this.processFocusedDayNode=e=>{this.focusedDayNode=e,this.activeFocus&&this.open&&setTimeout((()=>e.focus()),0)}}handleDocumentClick(e){var t;if(!this.open)return;const i=e.composedPath();for(const e of i)if(e instanceof Node&&(null===(t=this.element.shadowRoot)||void 0===t?void 0:t.contains(e)))return;this.hide(!1)}async setFocus(){var e;return null===(e=this.datePickerInput)||void 0===e?void 0:e.focus()}async show(){this.open=!0,this.setFocusedDay(n(this.value)||new Date),void 0!==this.focusTimeoutId&&clearTimeout(this.focusTimeoutId),this.focusTimeoutId=setTimeout((()=>{var e;return null===(e=this.monthSelectNode)||void 0===e?void 0:e.focus()}),300)}async hide(e=!0){this.open=!1,void 0!==this.focusTimeoutId&&clearTimeout(this.focusTimeoutId),e&&setTimeout((()=>{var e;return null===(e=this.datePickerButton)||void 0===e?void 0:e.focus()}),500)}addDays(e){this.setFocusedDay(h(this.focusedDay,e))}addMonths(e){this.setMonth(this.focusedDay.getMonth()+e)}addYears(e){this.setYear(this.focusedDay.getFullYear()+e)}startOfWeek(){this.setFocusedDay(c(this.focusedDay,this.firstDayOfWeek))}endOfWeek(){this.setFocusedDay(p(this.focusedDay,this.firstDayOfWeek))}setMonth(e){const t=b(u(this.focusedDay),e),i=_(t),s=b(this.focusedDay,e);this.setFocusedDay(m(s,t,i))}setYear(e){const t=f(u(this.focusedDay),e),i=_(t),s=f(this.focusedDay,e);this.setFocusedDay(m(s,t,i))}setFocusedDay(e){this.focusedDay=m(e,n(this.min),n(this.max))}setValue(e){this.value=r(e),this.dateChange.emit({component:"dso-date-picker",value:this.value,valueAsDate:e})}render(){const t=n(this.value),i=t&&r(t),a=(t||this.focusedDay).getFullYear(),o=this.focusedDay.getMonth(),d=this.focusedDay.getFullYear(),l=n(this.min),h=n(this.max),c=null!=l&&l.getMonth()===o&&l.getFullYear()===d,p=null!=h&&h.getMonth()===o&&h.getFullYear()===d;let u=a-10,_=a+10;return l&&(u=Math.max(u,l.getFullYear())),h&&(_=Math.min(_,h.getFullYear())),e(s,null,e("div",{class:"dso-date"},e("div",{class:"dso-date__input-wrapper"},e("input",{class:"dso-date__input",value:i,placeholder:this.localization.placeholder,id:this.identifier,disabled:this.disabled,role:this.role,required:!!this.required||void 0,"aria-autocomplete":"none",onInput:this.handleInputChange,onFocus:this.handleFocus,onBlur:this.handleBlur,autoComplete:"off",ref:e=>this.datePickerInput=e}),e("button",{type:"button",class:"dso-date__toggle",onClick:this.toggleOpen,disabled:this.disabled,ref:e=>this.datePickerButton=e},e("span",{class:"dso-date__toggle-icon"},e("dso-icon",{icon:"calendar"})),e("span",{class:"dso-date__vhidden"},this.localization.buttonLabel,i&&e("span",null,", ",this.localization.selectedDateMessage," ",i)))),e("div",{class:{"dso-date__dialog":!0,"is-left":"left"===this.direction,"is-active":this.open},role:"dialog","aria-modal":"true","aria-hidden":this.open?"false":"true","aria-labelledby":this.dialogLabelId,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd},e("div",{class:"dso-date__dialog-content",onKeyDown:this.handleEscKey},e("div",{class:"dso-date__vhidden dso-date__instructions","aria-live":"polite"},this.localization.keyboardInstruction),e("div",{class:"dso-date__mobile",onFocusin:this.disableActiveFocus},e("label",{class:"dso-date__mobile-heading"},this.localization.calendarHeading),e("button",{class:"dso-date__close",ref:e=>this.firstFocusableElement=e,onKeyDown:this.handleFirstFocusableKeydown,onClick:()=>this.hide(),type:"button"},e("dso-icon",{icon:"times"}),e("span",{class:"dso-date__vhidden"},this.localization.closeLabel))),e("div",{class:"dso-date__header",onFocusin:this.disableActiveFocus},e("div",null,e("h2",{id:this.dialogLabelId,class:"dso-date__vhidden","aria-live":"polite"},this.localization.monthNames[o]," ",this.focusedDay.getFullYear()),e("label",{htmlFor:this.monthSelectId,class:"dso-date__vhidden"},this.localization.monthSelectLabel),e("div",{class:"dso-date__select"},e("select",{id:this.monthSelectId,class:"dso-date__select--month",ref:e=>this.monthSelectNode=e,onChange:this.handleMonthSelect},this.localization.monthNames.map(((t,i)=>e("option",{key:t,value:i,selected:i===o},t)))),e("div",{class:"dso-date__select-label","aria-hidden":"true"},e("span",null,this.localization.monthNamesShort[o]),e("dso-icon",{icon:"chevron-down"}))),e("label",{htmlFor:this.yearSelectId,class:"dso-date__vhidden"},this.localization.yearSelectLabel),e("div",{class:"dso-date__select"},e("select",{id:this.yearSelectId,class:"dso-date__select--year",onChange:this.handleYearSelect},function(e,t){for(var i=[],s=e;s<=t;s++)i.push(s);return i}(u,_).map((t=>e("option",{key:t,selected:t===d},t)))),e("div",{class:"dso-date__select-label","aria-hidden":"true"},e("span",null,this.focusedDay.getFullYear()),e("dso-icon",{icon:"chevron-down"})))),e("div",{class:"dso-date__nav"},e("button",{class:"dso-date__prev",onClick:this.handlePreviousMonthClick,disabled:c,type:"button"},e("dso-icon",{icon:"chevron-left"}),e("span",{class:"dso-date__vhidden"},this.localization.prevMonthLabel)),e("button",{class:"dso-date__next",onClick:this.handleNextMonthClick,disabled:p,type:"button"},e("dso-icon",{icon:"chevron-right"}),e("span",{class:"dso-date__vhidden"},this.localization.nextMonthLabel)))),e(v,{selectedDate:t,focusedDate:this.focusedDay,onDateSelect:this.handleDaySelect,onKeyboardNavigation:this.handleKeyboardNavigation,labelledById:this.dialogLabelId,localization:this.localization,firstDayOfWeek:this.firstDayOfWeek,focusedDayRef:this.processFocusedDayNode,min:l,max:h})))))}get element(){return a(this)}};k.style=':host{display:block}.dso-date *,.dso-date *::before,.dso-date *::after{box-sizing:border-box}.dso-date{box-sizing:border-box;color:#191919;display:block;font-family:"Asap", sans-serif;margin:0;position:relative;text-align:left;width:100%}.dso-date__input{display:block;width:100%;height:40px;padding:6px 14px;font-size:16px;line-height:1.5;color:#191919;background-color:#fff;background-image:none;border:1px solid #275937;border-radius:4px;transition:border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s}.dso-date__input::-moz-placeholder{color:#666;opacity:1}.dso-date__input:-ms-input-placeholder{color:#666}.dso-date__input::-webkit-input-placeholder{color:#666}.dso-date__input::-ms-expand{background-color:transparent;border:0}.dso-date__input:focus{border-color:#275937;outline:0;box-shadow:inset 0 0 0 1px #275937}.dso-date__input[disabled],.dso-date__input[readonly],fieldset[disabled] .dso-date__input{background-color:#fff;opacity:1}.dso-date__input[disabled],fieldset[disabled] .dso-date__input{cursor:default}.dso-date__input[disabled]{border-color:#e5e5e5;color:#999}.dso-date__input[readonly]{border-width:1px}.dso-date__input[type=text]{line-height:40px}.dso-date__input[type=text]::placeholder{overflow:visible !important}.dso-date__input[size]{width:auto}.dso-date__toggle{-moz-appearance:none;-webkit-appearance:none;-webkit-user-select:none;align-items:center;appearance:none;background:transparent;border:0;border-radius:0;border-bottom-right-radius:4px;border-top-right-radius:4px;color:#39870c;cursor:pointer;display:flex;height:38px;justify-content:center;padding:0;position:absolute;right:0;transform:translateY(-50%);top:50%;user-select:none;width:38px;z-index:2}.dso-date__toggle:disabled{color:#afcf9d;cursor:pointer}.dso-date__dialog{display:flex;right:0;min-width:320px;opacity:0;position:absolute;top:100%;transform:scale(0.96) translateZ(0) translateY(-20px);transform-origin:top right;transition:transform 300ms ease, opacity 300ms ease, visibility 300ms ease;visibility:hidden;will-change:transform, opacity, visibility;z-index:600}@media (max-width: 35.9375em){.dso-date__dialog{background:rgba(25, 25, 25, 0.5);bottom:0;position:fixed;left:0;right:0;top:0;transform:translateZ(0);transform-origin:bottom center}}.dso-date__dialog.is-left{left:auto;right:0;width:auto}.dso-date__dialog.is-active{opacity:1;transform:scale(1.0001) translateZ(0) translateY(0);visibility:visible}.dso-date__dialog-content{background:#fff;border:1px solid rgba(0, 0, 0, 0.1);border-radius:4px;box-shadow:0 8px 10px 1px rgba(0, 0, 0, 0.4);margin-left:auto;margin-right:-1px;margin-top:8px;max-width:310px;min-width:290px;padding:16px;position:relative;transform:none;width:100%;z-index:600}@media (max-width: 35.9375em){.dso-date__dialog-content{border:0;border-radius:0;border-top-left-radius:4px;border-top-right-radius:4px;bottom:0;left:0;margin:0;max-width:none;min-height:26em;opacity:0;padding:0 8% 20px;position:absolute;transform:translateZ(0) translateY(100%);transition:transform 400ms ease, opacity 400ms ease, visibility 400ms ease;visibility:hidden;will-change:transform, opacity, visibility}.is-active .dso-date__dialog-content{opacity:1;transform:translateZ(0) translateY(0);visibility:visible}}.dso-date__table{border-collapse:collapse;border-spacing:0;color:#191919;font-size:1rem;font-weight:400;line-height:1.25;min-width:280px;table-layout:fixed;text-align:center;width:100%}.dso-date__table-header{font-size:0.875em;font-weight:600;height:36px;line-height:36px;text-decoration:none;text-transform:uppercase}.dso-date__cell{height:40px;padding:1px;text-align:center;width:40px}.dso-date__day{-moz-appearance:none;-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:50%;box-shadow:0 0 0 1px transparent;color:#191919;cursor:pointer;display:inline-block;font-family:"Asap", sans-serif;font-variant-numeric:tabular-nums;font-weight:400;height:38px;line-height:0;padding:0;position:relative;text-align:center;vertical-align:middle;width:38px;z-index:1}.dso-date__day.is-today{background:transparent;height:36px;box-shadow:0 0 0 1px #39870c;width:36px}.dso-date__day:hover,.dso-date__day:active{background:#39870c;color:#fff}.dso-date__day:focus{background:transparent;box-shadow:0 0 0 2px #275937;color:#191919;height:34px;outline:0;width:34px}[aria-selected=true] .dso-date__day{background:#39870c;color:#fff}[aria-selected=true] .dso-date__day:focus{background:transparent}[aria-selected=true] .dso-date__day:focus span[aria-hidden=true]{background:#39870c;border:1px solid #fff;line-height:32px}.dso-date__day.is-outside{background:#f2f2f2;box-shadow:none;color:#666;cursor:default;pointer-events:none}.dso-date__day.is-disabled{background:#fff;cursor:default}.dso-date__day.is-disabled:hover{color:#666}.dso-date__day span[aria-hidden=true]{border-radius:50%;display:inline-block;height:34px;line-height:34px;width:34px}.dso-date__header{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px;width:100%}.dso-date__header span{font-size:0.875rem}.dso-date__nav{white-space:nowrap}.dso-date__prev,.dso-date__next{-moz-appearance:none;-webkit-appearance:none;align-items:center;appearance:none;background:transparent;border:1px solid #39870c;border-radius:4px;box-sizing:border-box;color:#39870c;cursor:pointer;display:inline-flex;font-size:1em;height:32px;justify-content:center;margin-left:8px;padding:0;width:32px}@media (max-width: 35.9375em){.dso-date__prev,.dso-date__next{height:40px;width:40px}}.dso-date__prev:hover,.dso-date__prev:active,.dso-date__next:hover,.dso-date__next:active{background-color:#39870c;color:#fff}.dso-date__prev:focus,.dso-date__next:focus{background:transparent;color:#39870c}.dso-date__prev:disabled,.dso-date__prev:disabled:hover,.dso-date__next:disabled,.dso-date__next:disabled:hover{background-color:#fff;border-color:#afcf9d;color:#afcf9d;opacity:1}.dso-date__prev svg,.dso-date__next svg{margin:0 auto}.dso-date__select{display:inline-flex;height:28px;line-height:28px;position:relative}.dso-date__select span{margin-right:4px}.dso-date__select select{color:#275937;cursor:pointer;font-size:1rem;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:2}.dso-date__select select:focus+.dso-date__select-label{box-shadow:0 0 0 2px #275937}.dso-date__select select:disabled{color:#afcf9d}.dso-date__select-label{align-items:center;border-radius:4px;color:#39870c;display:flex;padding:0 4px 0 8px;pointer-events:none;position:relative;width:100%;z-index:1}.dso-date__select-label span{font-size:1.25rem;font-weight:600;line-height:1.25}.dso-date__select-label svg{width:16px;height:16px}.dso-date__mobile{align-items:center;border-bottom:1px solid rgba(0, 0, 0, 0.12);display:flex;font-size:1em;justify-content:space-between;margin-bottom:20px;margin-left:-10%;overflow:hidden;padding:12px 20px;position:relative;text-overflow:ellipsis;white-space:nowrap;width:120%}@media (min-width: 36em){.dso-date__mobile{border:0;margin:0;overflow:visible;padding:0;position:absolute;right:-16px;top:-16px;width:auto}}.dso-date__mobile-heading{display:inline-block;font-weight:600;max-width:84%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 36em){.dso-date__mobile-heading{display:none}}.dso-date__close{-webkit-appearance:none;align-items:center;appearance:none;background-color:#fff;border:0;border-radius:50%;color:#39870c;cursor:pointer;display:flex;font-size:1em;height:32px;justify-content:center;margin-right:-4px;padding:0;width:32px}@media (min-width: 36em){.dso-date__close{margin-right:0;opacity:0}}.dso-date__close:focus{box-shadow:0 0 0 2px #275937;outline:none}@media (min-width: 36em){.dso-date__close:focus{opacity:1}}.dso-date__vhidden{border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;padding:0;position:absolute;top:0;width:1px}';export{k as dso_date_picker}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as o,F as i,f as c,g as s}from"./p-a40eeb32.js";import{c as a}from"./p-4070c1e5.js";import{c as n}from"./p-7b37bd52.js";let r=class{constructor(o){t(this,o),this.close=e(this,"close",7)}render(){return o(i,null,!this.fixed&&o("button",{type:"button",onClick:t=>this.close.emit(t)},o("span",{class:"sr-only"},"Sluiten")),o("slot",null))}};r.style=":host{--di-times-bosgroen:url(\"data:image/svg+xml,%3csvg id='times' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %23275937%3b'%3e %3cpath fill='currentColor' d='M13.36%2c12l3.3-3.3A1%2c1%2c0%2c1%2c0%2c15.3%2c7.34L12%2c10.64%2c8.7%2c7.34A1%2c1%2c0%2c1%2c0%2c7.34%2c8.7l3.3%2c3.3-3.3%2c3.3A1%2c1%2c0%2c1%2c0%2c8.7%2c16.66l3.3-3.3%2c3.3%2c3.3a1%2c1%2c0%2c1%2c0%2c1.36-1.36Z'/%3e %3c/svg%3e\");display:block;background-color:#e5e5e5;padding:16px 32px 16px 16px;position:relative}:host>button{background-color:transparent;border-style:none;padding:0;position:absolute;right:0;top:0}:host>button::before{background:var(--dso-icon, var(--di-times-bosgroen)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em;content:\"\";display:inline-block}:host(:not([active]):not([fixed])){display:none}*,*::after,*::before{box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}";let l=class{constructor(o){t(this,o),this.toggle=e(this,"toggle",7),this.label="Toelichting bij optie"}handleToggle(t){this.active=!this.active,this.toggle.emit({originalEvent:t,active:this.active})}render(){return o("button",{type:"button",class:a("btn",{"dso-open":!!this.active}),"aria-expanded":"boolean"==typeof this.active?this.active.toString():void 0,onClick:t=>this.handleToggle(t)},o("span",{class:"sr-only"},this.label))}};l.style=":host{display:inline-block;--di-info:url(\"data:image/svg+xml,%3csvg id='info' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %2339870c%3b'%3e %3cpath fill='currentColor' d='M12%2c3a9%2c9%2c0%2c1%2c1-9%2c9%2c9%2c9%2c0%2c0%2c1%2c9-9m0-2A11%2c11%2c0%2c1%2c0%2c23%2c12%2c11%2c11%2c0%2c0%2c0%2c12%2c1Zm0%2c8a1%2c1%2c0%2c1%2c0-1-1A1%2c1%2c0%2c0%2c0%2c12%2c9Zm1%2c7.79V11.21A1.12%2c1.12%2c0%2c0%2c0%2c12%2c10a1.12%2c1.12%2c0%2c0%2c0-1%2c1.21v5.58A1.12%2c1.12%2c0%2c0%2c0%2c12%2c18%2c1.12%2c1.12%2c0%2c0%2c0%2c13%2c16.79Z'/%3e %3c/svg%3e\");--di-info-active:url(\"data:image/svg+xml,%3csvg id='info-active' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' style='color: %2339870c%3b'%3e %3cpath fill='currentColor' d='M23%2c12A11%2c11%2c0%2c1%2c1%2c12%2c1%2c11%2c11%2c0%2c0%2c1%2c23%2c12ZM12%2c9a1%2c1%2c0%2c1%2c0-1-1A1%2c1%2c0%2c0%2c0%2c12%2c9Zm1%2c7.79V11.21A1.12%2c1.12%2c0%2c0%2c0%2c12%2c10a1.12%2c1.12%2c0%2c0%2c0-1%2c1.21v5.58A1.12%2c1.12%2c0%2c0%2c0%2c12%2c18%2c1.12%2c1.12%2c0%2c0%2c0%2c13%2c16.79Z'/%3e %3c/svg%3e\")}*,*::after,*::before{box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}button{background:var(--dso-icon, var(--di-info)) no-repeat;background-position:center;background-size:cover;height:1.5em;vertical-align:top;width:1.5em;border:1px solid transparent;margin-left:8px;min-width:16px;padding:0}button.dso-open,button:hover,button:active{--dso-icon:var(--di-info-active)}";let p=class{constructor(o){t(this,o),this.change=e(this,"dsoChange",7),this.infoActive=!1,this.fallbackIdentifier=n("DsoSelectable")}componentDidLoad(){var t;null===(t=this.mutationObserver)||void 0===t||t.disconnect(),this.mutationObserver=new MutationObserver((()=>c(this.host))),this.mutationObserver.observe(this.host,{childList:!0}),this.setIndeterminate()}disconnectedCallback(){var t;null===(t=this.mutationObserver)||void 0===t||t.disconnect()}setIndeterminate(){this.input instanceof HTMLInputElement&&"checkbox"==this.type&&(this.input.indeterminate=!!this.indeterminate)}render(){var t;const e=!!this.host.querySelector('[slot="info"]');return o(i,null,o("input",{type:this.type,id:this.getIdentifier(),value:this.value,name:this.name,"aria-invalid":null===(t=this.invalid)||void 0===t?void 0:t.toString(),"aria-describedby":this.describedById,disabled:this.disabled,required:this.required,checked:this.checked,onChange:t=>this.change.emit(t),ref:t=>this.input=t}),o("label",{htmlFor:this.getIdentifier()},o("slot",null)),e&&o(i,null,!this.infoFixed&&o("dso-info-button",{active:this.infoActive,onToggle:t=>this.infoActive=t.detail.active}),o("dso-info",{fixed:this.infoFixed,active:this.infoActive,onClose:()=>this.infoActive=!1},o("slot",{name:"info"}))))}getIdentifier(){var t;return null!==(t=this.identifier)&&void 0!==t?t:this.fallbackIdentifier}get host(){return s(this)}static get watchers(){return{indeterminate:["setIndeterminate"]}}};p.style=':host{display:block;padding:0 0 0 32px;position:relative}:host .dso-selectable-options{list-style:none;margin-top:8px;padding-left:0}:host .dso-selectable-options li+li{margin-top:8px}:host label{font-weight:400;line-height:24px;margin:0}:host input[type=checkbox][disabled]+label::before,:host input[type=checkbox][disabled]:active+label::before,:host input[type=checkbox][disabled]:focus+label::before,:host input[type=radio][disabled]+label::before,:host input[type=radio][disabled]:active+label::before,:host input[type=radio][disabled]:focus+label::before{background-color:#fff;box-shadow:0 0 0 2px #e5e5e5}:host input[type=checkbox],:host input[type=radio]{height:24px;left:0;margin:0;opacity:0;position:absolute;top:0;width:24px;z-index:1;zoom:1}:host input[type=checkbox]:not([disabled]),:host input[type=radio]:not([disabled]){cursor:pointer}:host input[type=checkbox]+label,:host input[type=radio]+label{display:inline;font-style:normal;padding-left:0}:host input[type=checkbox]+label::before,:host input[type=radio]+label::before{background:#fff;border:0;box-shadow:0 0 0 2px var(--dso-selectable-color, #275937);content:"";height:20px;left:2px;position:absolute;top:2px;width:20px}:host input[type=checkbox]:focus,:host input[type=radio]:focus{outline:0}:host input[type=checkbox]:focus+label::before,:host input[type=radio]:focus+label::before{box-shadow:0 0 0 3px var(--dso-selectable-color, #275937);height:18px;left:3px;top:3px;width:18px}:host input[type=checkbox]:active+label::before,:host input[type=checkbox].active+label::before,:host input[type=radio]:active+label::before,:host input[type=radio].active+label::before{background-color:#ebf3e6;box-shadow:0 0 0 1px #275937;height:22px;left:1px;top:1px;width:22px}:host input[type=checkbox]+label::before{border-radius:4px}:host input[type=checkbox]+label::after{background:transparent;content:"";left:6px;opacity:0;position:absolute;top:6px;zoom:1}:host input[type=checkbox]:checked+label::after,:host input[type=checkbox]:indeterminate+label::after{opacity:1}:host input[type=checkbox]:checked+label::after{border:solid;border-color:var(--dso-selectable-color, #39870c);border-top-color:transparent;border-width:0 0 3px 3px;height:8px;transform:rotate(-45deg);width:13px}:host input[type=checkbox]:indeterminate+label::after{background-color:var(--dso-selectable-color, #39870c);height:12px;width:12px}:host input[type=radio]+label::before{border-radius:50%}:host input[type=radio]+label::after{background-color:transparent;border-radius:50%;content:"";height:12px;left:6px;opacity:0;position:absolute;top:6px;width:12px;zoom:1}:host input[type=radio]:checked+label::after{background-color:var(--dso-selectable-color, #39870c);opacity:1}:host>dso-info{float:none;margin:8px 16px 0 -32px;width:calc(100% + 32px)}:host(:not(:last-child)){margin-bottom:8px}*,*::after,*::before{box-sizing:border-box}';export{r as dso_info,l as dso_info_button,p as dso_selectable}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as e,H as n,g as r}from"./p-a40eeb32.js";import{c as o}from"./p-4070c1e5.js";var i="top",a="bottom",f="right",u="left",c=[i,a,f,u],p=c.reduce((function(t,e){return t.concat([e+"-start",e+"-end"])}),[]),s=[].concat(c,["auto"]).reduce((function(t,e){return t.concat([e,e+"-start",e+"-end"])}),[]),l=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function d(t){return t?(t.nodeName||"").toLowerCase():null}function h(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function v(t){return t instanceof h(t).Element||t instanceof Element}function b(t){return t instanceof h(t).HTMLElement||t instanceof HTMLElement}function m(t){return"undefined"!=typeof ShadowRoot&&(t instanceof h(t).ShadowRoot||t instanceof ShadowRoot)}function x(t){return t.split("-")[0]}function y(t){var e=t.getBoundingClientRect();return{width:e.width/1,height:e.height/1,top:e.top/1,right:e.right/1,bottom:e.bottom/1,left:e.left/1,x:e.left/1,y:e.top/1}}function w(t){var e=y(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function g(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&m(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function O(t){return h(t).getComputedStyle(t)}function j(t){return["table","td","th"].indexOf(d(t))>=0}function k(t){return((v(t)?t.ownerDocument:t.document)||window.document).documentElement}function E(t){return"html"===d(t)?t:t.assignedSlot||t.parentNode||(m(t)?t.host:null)||k(t)}function M(t){return b(t)&&"fixed"!==O(t).position?t.offsetParent:null}function L(t){for(var e=h(t),n=M(t);n&&j(n)&&"static"===O(n).position;)n=M(n);return n&&("html"===d(n)||"body"===d(n)&&"static"===O(n).position)?e:n||function(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&b(t)&&"fixed"===O(t).position)return null;for(var n=E(t);b(n)&&["html","body"].indexOf(d(n))<0;){var r=O(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||e&&"filter"===r.willChange||e&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(t)||e}function T(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}var P=Math.max,H=Math.min,q=Math.round;function B(t,e,n){return P(t,H(e,n))}function R(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function z(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}function A(t){return t.split("-")[1]}var S={top:"auto",right:"auto",bottom:"auto",left:"auto"};function W(t){var e,n=t.popper,r=t.popperRect,o=t.placement,c=t.variation,p=t.offsets,s=t.position,l=t.gpuAcceleration,d=t.adaptive,v=t.roundOffsets,b=!0===v?function(t){var e=t.y,n=window.devicePixelRatio||1;return{x:q(q(t.x*n)/n)||0,y:q(q(e*n)/n)||0}}(p):"function"==typeof v?v(p):p,m=b.x,x=void 0===m?0:m,y=b.y,w=void 0===y?0:y,g=p.hasOwnProperty("x"),j=p.hasOwnProperty("y"),E=u,M=i,T=window;if(d){var P=L(n),H="clientHeight",B="clientWidth";P===h(n)&&"static"!==O(P=k(n)).position&&"absolute"===s&&(H="scrollHeight",B="scrollWidth"),P=P,o!==i&&(o!==u&&o!==f||"end"!==c)||(M=a,w-=P[H]-r.height,w*=l?1:-1),o!==u&&(o!==i&&o!==a||"end"!==c)||(E=f,x-=P[B]-r.width,x*=l?1:-1)}var R,z=Object.assign({position:s},d&&S);return Object.assign({},z,l?((R={})[M]=j?"0":"",R[E]=g?"0":"",R.transform=(T.devicePixelRatio||1)<=1?"translate("+x+"px, "+w+"px)":"translate3d("+x+"px, "+w+"px, 0)",R):((e={})[M]=j?w+"px":"",e[E]=g?x+"px":"",e.transform="",e))}var C={passive:!0},I={left:"right",right:"left",bottom:"top",top:"bottom"};function D(t){return t.replace(/left|right|bottom|top/g,(function(t){return I[t]}))}var U={start:"end",end:"start"};function _(t){return t.replace(/start|end/g,(function(t){return U[t]}))}function N(t){var e=h(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function V(t){return y(k(t)).left+N(t).scrollLeft}function $(t){var e=O(t);return/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function F(t){return["html","body","#document"].indexOf(d(t))>=0?t.ownerDocument.body:b(t)&&$(t)?t:F(E(t))}function G(t,e){var n;void 0===e&&(e=[]);var r=F(t),o=r===(null==(n=t.ownerDocument)?void 0:n.body),i=h(r),a=o?[i].concat(i.visualViewport||[],$(r)?r:[]):r,f=e.concat(a);return o?f:f.concat(G(E(a)))}function J(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function K(t,e){return"viewport"===e?J(function(t){var e=h(t),n=k(t),r=e.visualViewport,o=n.clientWidth,i=n.clientHeight,a=0,f=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,f=r.offsetTop)),{width:o,height:i,x:a+V(t),y:f}}(t)):b(e)?function(t){var e=y(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(e):J(function(t){var e,n=k(t),r=N(t),o=null==(e=t.ownerDocument)?void 0:e.body,i=P(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=P(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),f=-r.scrollLeft+V(t),u=-r.scrollTop;return"rtl"===O(o||n).direction&&(f+=P(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:f,y:u}}(k(t)))}function Q(t){var e,n=t.reference,r=t.element,o=t.placement,c=o?x(o):null,p=o?A(o):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(c){case i:e={x:s,y:n.y-r.height};break;case a:e={x:s,y:n.y+n.height};break;case f:e={x:n.x+n.width,y:l};break;case u:e={x:n.x-r.width,y:l};break;default:e={x:n.x,y:n.y}}var d=c?T(c):null;if(null!=d){var h="y"===d?"height":"width";switch(p){case"start":e[d]=e[d]-(n[h]/2-r[h]/2);break;case"end":e[d]=e[d]+(n[h]/2-r[h]/2)}}return e}function X(t,e){void 0===e&&(e={});var n=e.placement,r=void 0===n?t.placement:n,o=e.boundary,u=void 0===o?"clippingParents":o,p=e.rootBoundary,s=void 0===p?"viewport":p,l=e.elementContext,h=void 0===l?"popper":l,m=e.altBoundary,x=void 0!==m&&m,w=e.padding,j=void 0===w?0:w,M=R("number"!=typeof j?j:z(j,c)),T=t.rects.popper,q=t.elements[x?"popper"===h?"reference":"popper":h],B=function(t,e,n){var r="clippingParents"===e?function(t){var e=G(E(t)),n=["absolute","fixed"].indexOf(O(t).position)>=0&&b(t)?L(t):t;return v(n)?e.filter((function(t){return v(t)&&g(t,n)&&"body"!==d(t)})):[]}(t):[].concat(e),o=[].concat(r,[n]),i=o.reduce((function(e,n){var r=K(t,n);return e.top=P(r.top,e.top),e.right=H(r.right,e.right),e.bottom=H(r.bottom,e.bottom),e.left=P(r.left,e.left),e}),K(t,o[0]));return i.width=i.right-i.left,i.height=i.bottom-i.top,i.x=i.left,i.y=i.top,i}(v(q)?q:q.contextElement||k(t.elements.popper),u,s),A=y(t.elements.reference),S=Q({reference:A,element:T,strategy:"absolute",placement:r}),W=J(Object.assign({},T,S)),C="popper"===h?W:A,I={top:B.top-C.top+M.top,bottom:C.bottom-B.bottom+M.bottom,left:B.left-C.left+M.left,right:C.right-B.right+M.right},D=t.modifiersData.offset;if("popper"===h&&D){var U=D[r];Object.keys(I).forEach((function(t){var e=[f,a].indexOf(t)>=0?1:-1,n=[i,a].indexOf(t)>=0?"y":"x";I[t]+=U[n]*e}))}return I}function Y(t,e){void 0===e&&(e={});var n=e.boundary,r=e.rootBoundary,o=e.padding,i=e.flipVariations,a=e.allowedAutoPlacements,f=void 0===a?s:a,u=A(e.placement),l=u?i?p:p.filter((function(t){return A(t)===u})):c,d=l.filter((function(t){return f.indexOf(t)>=0}));0===d.length&&(d=l);var h=d.reduce((function(e,i){return e[i]=X(t,{placement:i,boundary:n,rootBoundary:r,padding:o})[x(i)],e}),{});return Object.keys(h).sort((function(t,e){return h[t]-h[e]}))}function Z(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function tt(t){return[i,f,a,u].some((function(e){return t[e]>=0}))}function et(t,e,n){void 0===n&&(n=!1);var r=b(e);b(e)&&function(t){t.getBoundingClientRect()}(e);var o,i,a=k(e),f=y(t),u={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&(("body"!==d(e)||$(a))&&(u=(o=e)!==h(o)&&b(o)?{scrollLeft:(i=o).scrollLeft,scrollTop:i.scrollTop}:N(o)),b(e)?((c=y(e)).x+=e.clientLeft,c.y+=e.clientTop):a&&(c.x=V(a))),{x:f.left+u.scrollLeft-c.x,y:f.top+u.scrollTop-c.y,width:f.width,height:f.height}}function nt(t){var e=new Map,n=new Set,r=[];function o(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!n.has(t)){var r=e.get(t);r&&o(r)}})),r.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||o(t)})),r}var rt={placement:"bottom",modifiers:[],strategy:"absolute"};function ot(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function it(t){void 0===t&&(t={});var e=t.defaultModifiers,n=void 0===e?[]:e,r=t.defaultOptions,o=void 0===r?rt:r;return function(t,e,r){void 0===r&&(r=o);var i,a,f={placement:"bottom",orderedModifiers:[],options:Object.assign({},rt,o),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},u=[],c=!1,p={state:f,setOptions:function(r){var i="function"==typeof r?r(f.options):r;s(),f.options=Object.assign({},o,f.options,i),f.scrollParents={reference:v(t)?G(t):t.contextElement?G(t.contextElement):[],popper:G(e)};var a,c,d=function(t){var e=nt(t);return l.reduce((function(t,n){return t.concat(e.filter((function(t){return t.phase===n})))}),[])}((a=[].concat(n,f.options.modifiers),c=a.reduce((function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t}),{}),Object.keys(c).map((function(t){return c[t]}))));return f.orderedModifiers=d.filter((function(t){return t.enabled})),f.orderedModifiers.forEach((function(t){var e=t.options,n=t.effect;if("function"==typeof n){var r=n({state:f,name:t.name,instance:p,options:void 0===e?{}:e});u.push(r||function(){})}})),p.update()},forceUpdate:function(){if(!c){var t=f.elements,e=t.reference,n=t.popper;if(ot(e,n)){f.rects={reference:et(e,L(n),"fixed"===f.options.strategy),popper:w(n)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach((function(t){return f.modifiersData[t.name]=Object.assign({},t.data)}));for(var r=0;r<f.orderedModifiers.length;r++)if(!0!==f.reset){var o=f.orderedModifiers[r],i=o.fn,a=o.options;"function"==typeof i&&(f=i({state:f,options:void 0===a?{}:a,name:o.name,instance:p})||f)}else f.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(t){p.forceUpdate(),t(f)}))},function(){return a||(a=new Promise((function(t){Promise.resolve().then((function(){a=void 0,t(i())}))}))),a}),destroy:function(){s(),c=!0}};if(!ot(t,e))return p;function s(){u.forEach((function(t){return t()})),u=[]}return p.setOptions(r).then((function(t){!c&&r.onFirstUpdate&&r.onFirstUpdate(t)})),p}}var at=it({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,r=t.options,o=r.scroll,i=void 0===o||o,a=r.resize,f=void 0===a||a,u=h(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach((function(t){t.addEventListener("scroll",n.update,C)})),f&&u.addEventListener("resize",n.update,C),function(){i&&c.forEach((function(t){t.removeEventListener("scroll",n.update,C)})),f&&u.removeEventListener("resize",n.update,C)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state;e.modifiersData[t.name]=Q({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,f=n.roundOffsets,u=void 0===f||f,c={placement:x(e.placement),variation:A(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,W(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:u})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,W(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},r=e.attributes[t]||{},o=e.elements[t];b(o)&&d(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(t){var e=r[t];!1===e?o.removeAttribute(t):o.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var r=e.elements[t],o=e.attributes[t]||{},i=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});b(r)&&d(r)&&(Object.assign(r.style,i),Object.keys(o).forEach((function(t){r.removeAttribute(t)})))}))}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.name,r=t.options.offset,o=void 0===r?[0,0]:r,a=s.reduce((function(t,n){return t[n]=function(t,e,n){var r=x(t),o=[u,i].indexOf(r)>=0?-1:1,a="function"==typeof n?n(Object.assign({},e,{placement:t})):n,c=a[0],p=a[1];return c=c||0,p=(p||0)*o,[u,f].indexOf(r)>=0?{x:p,y:c}:{x:c,y:p}}(n,e.rects,o),t}),{}),c=a[e.placement],p=c.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=c.x,e.modifiersData.popperOffsets.y+=p),e.modifiersData[n]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var o=n.mainAxis,c=void 0===o||o,p=n.altAxis,s=void 0===p||p,l=n.fallbackPlacements,d=n.padding,h=n.boundary,v=n.rootBoundary,b=n.altBoundary,m=n.flipVariations,y=void 0===m||m,w=n.allowedAutoPlacements,g=e.options.placement,O=x(g),j=l||(O!==g&&y?function(t){if("auto"===x(t))return[];var e=D(t);return[_(t),e,_(e)]}(g):[D(g)]),k=[g].concat(j).reduce((function(t,n){return t.concat("auto"===x(n)?Y(e,{placement:n,boundary:h,rootBoundary:v,padding:d,flipVariations:y,allowedAutoPlacements:w}):n)}),[]),E=e.rects.reference,M=e.rects.popper,L=new Map,T=!0,P=k[0],H=0;H<k.length;H++){var q=k[H],B=x(q),R="start"===A(q),z=[i,a].indexOf(B)>=0,S=z?"width":"height",W=X(e,{placement:q,boundary:h,rootBoundary:v,altBoundary:b,padding:d}),C=z?R?f:u:R?a:i;E[S]>M[S]&&(C=D(C));var I=D(C),U=[];if(c&&U.push(W[B]<=0),s&&U.push(W[C]<=0,W[I]<=0),U.every((function(t){return t}))){P=q,T=!1;break}L.set(q,U)}if(T)for(var N=function(t){var e=k.find((function(e){var n=L.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return P=e,"break"},V=y?3:1;V>0&&"break"!==N(V);V--);e.placement!==P&&(e.modifiersData[r]._skip=!0,e.placement=P,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,r=t.name,o=n.mainAxis,c=void 0===o||o,p=n.altAxis,s=void 0!==p&&p,l=n.tether,d=void 0===l||l,h=n.tetherOffset,v=void 0===h?0:h,b=X(e,{boundary:n.boundary,rootBoundary:n.rootBoundary,padding:n.padding,altBoundary:n.altBoundary}),m=x(e.placement),y=A(e.placement),g=!y,O=T(m),j="x"===O?"y":"x",k=e.modifiersData.popperOffsets,E=e.rects.reference,M=e.rects.popper,q="function"==typeof v?v(Object.assign({},e.rects,{placement:e.placement})):v,R={x:0,y:0};if(k){if(c||s){var z="y"===O?i:u,S="y"===O?a:f,W="y"===O?"height":"width",C=k[O],I=k[O]+b[z],D=k[O]-b[S],U=d?-M[W]/2:0,_="start"===y?E[W]:M[W],N="start"===y?-M[W]:-E[W],V=e.elements.arrow,$=d&&V?w(V):{width:0,height:0},F=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},G=F[z],J=F[S],K=B(0,E[W],$[W]),Q=g?E[W]/2-U-K-G-q:_-K-G-q,Y=g?-E[W]/2+U+K+J+q:N+K+J+q,Z=e.elements.arrow&&L(e.elements.arrow),tt=e.modifiersData.offset?e.modifiersData.offset[e.placement][O]:0,et=k[O]+Q-tt-(Z?"y"===O?Z.clientTop||0:Z.clientLeft||0:0),nt=k[O]+Y-tt;if(c){var rt=B(d?H(I,et):I,C,d?P(D,nt):D);k[O]=rt,R[O]=rt-C}if(s){var ot=k[j],it=ot+b["x"===O?i:u],at=ot-b["x"===O?a:f],ft=B(d?H(it,et):it,ot,d?P(at,nt):at);k[j]=ft,R[j]=ft-ot}}e.modifiersData[r]=R}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,r=t.name,o=t.options,p=n.elements.arrow,s=n.modifiersData.popperOffsets,l=x(n.placement),d=T(l),h=[u,f].indexOf(l)>=0?"height":"width";if(p&&s){var v=function(t,e){return R("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:z(t,c))}(o.padding,n),b=w(p),m="y"===d?i:u,y="y"===d?a:f,g=n.rects.reference[h]+n.rects.reference[d]-s[d]-n.rects.popper[h],O=s[d]-n.rects.reference[d],j=L(p),k=j?"y"===d?j.clientHeight||0:j.clientWidth||0:0,E=k/2-b[h]/2+(g/2-O/2),M=B(v[m],E,k-b[h]-v[y]);n.modifiersData[r]=((e={})[d]=M,e.centerOffset=M-E,e)}},effect:function(t){var e=t.state,n=t.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=e.elements.popper.querySelector(r)))&&g(e.elements.popper,r)&&(e.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,a=X(e,{elementContext:"reference"}),f=X(e,{altBoundary:!0}),u=Z(a,r),c=Z(f,o,i),p=tt(u),s=tt(c);e.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:p,hasPopperEscaped:s},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":s})}}]});let ft=class{constructor(e){t(this,e),this.position="top",this.noArrow=!1,this.active=!1,this.hidden=!0}async activate(){this.active=!0}async deactivate(){this.active=!1}watchPosition(){this.popper&&this.popper.setOptions({placement:this.position})}watchActive(){this.active&&(this.hidden=!1)}listenClick(t){t.stopPropagation()}componentDidLoad(){var t;if(this.popper)return;const e=null===(t=this.element.shadowRoot)||void 0===t?void 0:t.querySelector(".tooltip");if(!(e instanceof HTMLElement))throw new Error("tooltip element is not instanceof HTMLElement");this.target=this.getTarget(),this.popper=at(this.target,e,{placement:this.position}),this.callbacks={activate:()=>{this.hidden=!1,setTimeout((()=>{var t;this.active=!0,null===(t=this.popper)||void 0===t||t.setOptions({modifiers:[{name:"eventListeners",enabled:!0}]})}))},deactivate:()=>{var t;this.active=!1,null===(t=this.popper)||void 0===t||t.setOptions({modifiers:[{name:"eventListeners",enabled:!1}]}),setTimeout((()=>this.hidden=!0),150)}},this.target.addEventListener("mouseenter",this.callbacks.activate),this.target.addEventListener("mouseleave",this.callbacks.deactivate),this.target.addEventListener("focus",this.callbacks.activate),this.target.addEventListener("blur",this.callbacks.deactivate)}disconnectedCallback(){var t;null===(t=this.popper)||void 0===t||t.destroy(),this.target&&this.callbacks&&(this.target.removeEventListener("mouseenter",this.callbacks.activate),this.target.removeEventListener("mouseleave",this.callbacks.deactivate),this.target.removeEventListener("focus",this.callbacks.activate),this.target.removeEventListener("blur",this.callbacks.deactivate)),this.callbacks=void 0,this.target=void 0}componentDidRender(){var t;this.active&&(null===(t=this.popper)||void 0===t||t.update())}render(){return e(n,{hidden:this.hidden},e("div",{class:o("tooltip",{in:this.active}),role:"tooltip"},!this.noArrow&&e("div",{class:"tooltip-arrow"}),e("div",{class:o("tooltip-inner",{"dso-small":this.small})},e("slot",null))))}getTarget(){if(this.for instanceof HTMLElement)return this.for;if("string"==typeof this.for){const t=document.getElementById(this.for);if(!t)throw new Error(`Unable to find reference with id ${this.for}`);return t}const{parentElement:t}=this.element;if(!t)throw new Error("No reference given with [for] attribute but no parent found either");return t}get element(){return r(this)}static get watchers(){return{position:["watchPosition"],active:["watchActive"]}}};ft.style=":host(:not([hidden])){display:block}*,*::after,*::before{box-sizing:border-box}.tooltip{font-family:Asap, sans-serif;font-style:normal;font-weight:400;line-height:1.5;line-break:auto;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;display:block;filter:drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));font-size:14px;opacity:0;position:absolute;transition:opacity 0.15s linear;z-index:1070}.tooltip.in{opacity:0.9}.tooltip .tooltip-inner{background-color:#fff;border-radius:4px;color:#191919;display:inline-block;font-size:16px;max-width:640px;padding:8px 16px;position:relative}.tooltip .tooltip-inner.dso-small{max-width:320px}.tooltip .tooltip-arrow{border-color:transparent;border-style:solid;height:0;position:absolute;width:0}.tooltip[data-popper-placement=top]{margin-top:-3px;padding:6px 0}.tooltip[data-popper-placement=top] .tooltip-arrow{border-top-color:#fff;border-width:6px 6px 0;bottom:0;left:50%;margin-left:-6px}.tooltip[data-popper-placement=right]{margin-left:3px;padding:0 6px}.tooltip[data-popper-placement=right] .tooltip-arrow{border-right-color:#fff;border-width:6px 6px 6px 0;left:0;margin-top:-6px;top:50%}.tooltip[data-popper-placement=bottom]{margin-top:3px;padding:6px 0}.tooltip[data-popper-placement=bottom] .tooltip-arrow{border-bottom-color:#fff;border-width:0 6px 6px;left:50%;margin-left:-6px;top:0}.tooltip[data-popper-placement=left]{margin-left:-3px;padding:0 6px}.tooltip[data-popper-placement=left] .tooltip-arrow{border-left-color:#fff;border-width:6px 0 6px 6px;margin-top:-6px;right:0;top:50%}";export{ft as dso_tooltip}
|