@dso-toolkit/core 47.0.0 → 48.0.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-accordion-section.cjs.entry.js +1447 -58
- package/dist/cjs/dso-autosuggest.cjs.entry.js +57 -47
- package/dist/cjs/dso-date-picker.cjs.entry.js +3 -2
- package/dist/cjs/dso-dropdown-menu.cjs.entry.js +2 -2
- package/dist/cjs/dso-helpcenter-panel.cjs.entry.js +1 -1
- package/dist/cjs/dso-image-overlay.cjs.entry.js +1 -1
- package/dist/cjs/dso-info_2.cjs.entry.js +2 -2
- package/dist/cjs/dso-label.cjs.entry.js +2 -2
- package/dist/cjs/dso-modal.cjs.entry.js +4 -7
- package/dist/cjs/dso-ozon-content.cjs.entry.js +3 -3
- package/dist/cjs/dso-table.cjs.entry.js +3 -5
- package/dist/cjs/dso-toggletip.cjs.entry.js +1 -1
- package/dist/cjs/dso-toolkit.cjs.js +2 -2
- package/dist/cjs/dso-tooltip.cjs.entry.js +13 -21
- package/dist/cjs/dso-viewer-grid.cjs.entry.js +8 -3
- package/dist/cjs/{focus-trap.esm-d83fd673.js → focus-trap.esm-c501d382.js} +82 -155
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +8 -8
- package/dist/collection/components/accordion/components/accordion-section.css +27 -4
- package/dist/collection/components/accordion/components/accordion-section.interfaces.js +6 -0
- package/dist/collection/components/accordion/components/accordion-section.js +91 -59
- package/dist/collection/components/accordion/components/handles/element.handle.js +7 -0
- package/dist/collection/components/accordion/components/handles/heading.handle.js +14 -0
- package/dist/collection/components/accordion/components/handles/icon.handle.js +13 -0
- package/dist/collection/components/accordion/components/handles/index.js +4 -0
- package/dist/collection/components/accordion/components/handles/state-icon.handle.js +15 -0
- package/dist/collection/components/autosuggest/autosuggest.interfaces.js +1 -0
- package/dist/collection/components/autosuggest/autosuggest.js +61 -49
- package/dist/collection/components/banner/banner.js +1 -1
- package/dist/collection/components/card-container/card-container.js +1 -1
- package/dist/collection/components/date-picker/date-picker.interfaces.js +1 -0
- package/dist/collection/components/date-picker/date-picker.js +19 -11
- package/dist/collection/components/dropdown-menu/dropdown-menu.js +2 -2
- package/dist/collection/components/header/header.js +2 -6
- package/dist/collection/components/info-button/info-button.interfaces.js +1 -0
- package/dist/collection/components/info-button/info-button.js +2 -1
- package/dist/collection/components/label/label.js +2 -2
- package/dist/collection/components/modal/modal.css +103 -75
- package/dist/collection/components/modal/modal.interfaces.js +1 -0
- package/dist/collection/components/modal/modal.js +6 -9
- package/dist/collection/components/ozon-content/nodes/noot.node.js +1 -1
- package/dist/collection/components/ozon-content/nodes/table.node/table.node.js +1 -1
- package/dist/collection/components/progress-indicator/progress-indicator.js +1 -1
- package/dist/collection/components/selectable/selectable.css +18 -1
- package/dist/collection/components/selectable/selectable.interfaces.js +1 -0
- package/dist/collection/components/selectable/selectable.js +3 -2
- package/dist/collection/components/table/table.css +49 -16
- package/dist/collection/components/table/table.js +2 -4
- package/dist/collection/components/toggletip/toggletip.js +1 -1
- package/dist/collection/components/tooltip/tooltip.js +13 -42
- package/dist/collection/components/tree-view/tree-view.js +8 -2
- package/dist/collection/components/viewer-grid/viewer-grid.interfaces.js +1 -0
- package/dist/collection/components/viewer-grid/viewer-grid.js +19 -11
- package/dist/collection/index.js +13 -0
- package/dist/components/clsx.m.js +3 -0
- package/dist/components/create-identifier.js +15 -0
- package/dist/components/dropdown-menu.js +151 -0
- package/dist/components/dso-accordion-section.d.ts +11 -0
- package/dist/components/dso-accordion-section.js +1535 -0
- package/dist/components/dso-accordion.d.ts +11 -0
- package/dist/components/dso-accordion.js +316 -0
- package/dist/components/dso-alert.d.ts +11 -0
- package/dist/components/dso-alert.js +55 -0
- package/dist/components/dso-attachments-counter.d.ts +11 -0
- package/dist/components/dso-attachments-counter.js +42 -0
- package/dist/components/dso-autosuggest.d.ts +11 -0
- package/dist/components/dso-autosuggest.js +309 -0
- package/dist/components/dso-badge.d.ts +11 -0
- package/dist/components/dso-badge.js +37 -0
- package/dist/components/dso-banner.d.ts +11 -0
- package/dist/components/dso-banner.js +37 -0
- package/dist/components/dso-card-container.d.ts +11 -0
- package/dist/components/dso-card-container.js +36 -0
- package/dist/components/dso-card.d.ts +11 -0
- package/dist/components/dso-card.js +66 -0
- package/dist/components/dso-date-picker.d.ts +11 -0
- package/dist/components/dso-date-picker.js +682 -0
- package/dist/components/dso-dropdown-menu.d.ts +11 -0
- package/dist/components/dso-dropdown-menu.js +6 -0
- package/dist/components/dso-header.d.ts +11 -0
- package/dist/components/dso-header.js +159 -0
- package/dist/components/dso-helpcenter-panel.d.ts +11 -0
- package/dist/components/dso-helpcenter-panel.js +127 -0
- package/dist/components/dso-highlight-box.d.ts +11 -0
- package/dist/components/dso-highlight-box.js +55 -0
- package/dist/components/dso-icon.d.ts +11 -0
- package/dist/components/dso-icon.js +6 -0
- package/dist/components/dso-image-overlay.d.ts +11 -0
- package/dist/components/dso-image-overlay.js +129 -0
- package/dist/components/dso-info-button.d.ts +11 -0
- package/dist/components/dso-info-button.js +6 -0
- package/dist/components/dso-info.d.ts +11 -0
- package/dist/components/dso-info.js +6 -0
- package/dist/components/dso-label.d.ts +11 -0
- package/dist/components/dso-label.js +156 -0
- package/dist/components/dso-map-base-layers.d.ts +11 -0
- package/dist/components/dso-map-base-layers.js +80 -0
- package/dist/components/dso-map-controls.d.ts +11 -0
- package/dist/components/dso-map-controls.js +86 -0
- package/dist/components/dso-map-overlays.d.ts +11 -0
- package/dist/components/dso-map-overlays.js +81 -0
- package/dist/components/dso-modal.d.ts +11 -0
- package/dist/components/dso-modal.js +85 -0
- package/dist/components/dso-ozon-content.d.ts +11 -0
- package/dist/components/dso-ozon-content.js +507 -0
- package/dist/components/dso-pagination.d.ts +11 -0
- package/dist/components/dso-pagination.js +159 -0
- package/dist/components/dso-progress-bar.d.ts +11 -0
- package/dist/components/dso-progress-bar.js +42 -0
- package/dist/components/dso-progress-indicator.d.ts +11 -0
- package/dist/components/dso-progress-indicator.js +6 -0
- package/dist/components/dso-responsive-element.d.ts +11 -0
- package/dist/components/dso-responsive-element.js +6 -0
- package/dist/components/dso-selectable.d.ts +11 -0
- package/dist/components/dso-selectable.js +6 -0
- package/dist/components/dso-table.d.ts +11 -0
- package/dist/components/dso-table.js +111 -0
- package/dist/components/dso-toggletip.d.ts +11 -0
- package/dist/components/dso-toggletip.js +90 -0
- package/dist/components/dso-tooltip.d.ts +11 -0
- package/dist/components/dso-tooltip.js +6 -0
- package/dist/components/dso-tree-view.d.ts +11 -0
- package/dist/components/dso-tree-view.js +227 -0
- package/dist/components/dso-viewer-grid.d.ts +11 -0
- package/dist/components/dso-viewer-grid.js +171 -0
- package/dist/components/focus-trap.esm.js +688 -0
- package/dist/components/icon.js +663 -0
- package/dist/components/index.d.ts +55 -0
- package/dist/components/index.esm.js +458 -0
- package/dist/components/index.js +35 -0
- package/dist/components/index2.js +70 -0
- package/dist/components/info-button.js +56 -0
- package/dist/components/info.js +42 -0
- package/dist/components/is-modified-event.js +4 -0
- package/dist/components/progress-indicator.js +44 -0
- package/dist/components/responsive-element.js +67 -0
- package/dist/components/selectable.js +108 -0
- package/dist/components/tooltip.js +2047 -0
- package/dist/components/v4.js +66 -0
- package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/dso-toolkit/p-04ffcc93.entry.js +1 -0
- package/dist/dso-toolkit/{p-e0a37d82.entry.js → p-06b4f78d.entry.js} +1 -1
- package/dist/dso-toolkit/{p-2b83a825.entry.js → p-35687d62.entry.js} +1 -1
- package/dist/dso-toolkit/p-52bc72d0.entry.js +1 -0
- package/dist/dso-toolkit/p-57ceabab.js +5 -0
- package/dist/dso-toolkit/p-655eff47.entry.js +1 -0
- package/dist/dso-toolkit/p-672c8323.entry.js +1 -0
- package/dist/dso-toolkit/p-7f8be9bc.entry.js +1 -0
- package/dist/dso-toolkit/p-80575700.entry.js +1 -0
- package/dist/dso-toolkit/p-8e9f6355.entry.js +1 -0
- package/dist/dso-toolkit/p-a8cb2eae.entry.js +1 -0
- package/dist/dso-toolkit/p-d31805a9.entry.js +1 -0
- package/dist/dso-toolkit/{p-dcc74039.entry.js → p-d7b2adc3.entry.js} +1 -1
- package/dist/dso-toolkit/{p-800e1267.entry.js → p-daee3252.entry.js} +1 -1
- package/dist/dso-toolkit/p-ec5412aa.entry.js +1 -0
- package/dist/esm/dso-accordion-section.entry.js +1448 -59
- package/dist/esm/dso-autosuggest.entry.js +57 -47
- package/dist/esm/dso-date-picker.entry.js +3 -2
- package/dist/esm/dso-dropdown-menu.entry.js +2 -2
- package/dist/esm/dso-helpcenter-panel.entry.js +1 -1
- package/dist/esm/dso-image-overlay.entry.js +1 -1
- package/dist/esm/dso-info_2.entry.js +2 -2
- package/dist/esm/dso-label.entry.js +2 -2
- package/dist/esm/dso-modal.entry.js +5 -8
- package/dist/esm/dso-ozon-content.entry.js +3 -3
- package/dist/esm/dso-table.entry.js +3 -5
- package/dist/esm/dso-toggletip.entry.js +1 -1
- package/dist/esm/dso-toolkit.js +2 -2
- package/dist/esm/dso-tooltip.entry.js +13 -21
- package/dist/esm/dso-viewer-grid.entry.js +8 -3
- package/dist/esm/{focus-trap.esm-33203b60.js → focus-trap.esm-94794d92.js} +82 -155
- package/dist/esm/loader.js +2 -2
- package/dist/types/components/accordion/accordion.interfaces.d.ts +0 -2
- package/dist/types/components/accordion/components/accordion-section.d.ts +10 -1
- package/dist/types/components/accordion/components/accordion-section.interfaces.d.ts +3 -0
- package/dist/types/components/accordion/components/handles/element.handle.d.ts +6 -0
- package/dist/types/components/accordion/components/handles/heading.handle.d.ts +5 -0
- package/dist/types/components/accordion/components/handles/icon.handle.d.ts +7 -0
- package/dist/types/components/accordion/components/handles/index.d.ts +4 -0
- package/dist/types/components/accordion/components/handles/state-icon.handle.d.ts +5 -0
- package/dist/types/components/autosuggest/autosuggest.d.ts +2 -15
- package/dist/types/components/autosuggest/autosuggest.interfaces.d.ts +14 -0
- package/dist/types/components/date-picker/date-picker.d.ts +2 -15
- package/dist/types/components/date-picker/date-picker.interfaces.d.ts +14 -0
- package/dist/types/components/dropdown-menu/dropdown-menu.d.ts +1 -1
- package/dist/types/components/header/header.d.ts +2 -2
- package/dist/types/components/header/header.interfaces.d.ts +1 -0
- package/dist/types/components/info-button/info-button.d.ts +1 -4
- package/dist/types/components/info-button/info-button.interfaces.d.ts +4 -0
- package/dist/types/components/map-overlays/map-overlays.d.ts +1 -1
- package/dist/types/components/modal/modal.d.ts +3 -5
- package/dist/types/components/modal/modal.interfaces.d.ts +3 -0
- package/dist/types/components/selectable/selectable.d.ts +1 -2
- package/dist/types/components/selectable/selectable.interfaces.d.ts +2 -0
- package/dist/types/components/table/table.d.ts +1 -1
- package/dist/types/components/tooltip/tooltip.d.ts +0 -8
- package/dist/types/components/tree-view/tree-view.d.ts +2 -2
- package/dist/types/components/viewer-grid/viewer-grid.d.ts +5 -16
- package/dist/types/components/viewer-grid/viewer-grid.interfaces.d.ts +15 -0
- package/dist/types/components.d.ts +20 -27
- package/dist/types/index.d.ts +13 -0
- package/package.json +8 -8
- package/dist/custom-elements/index.d.ts +0 -243
- package/dist/custom-elements/index.js +0 -7555
- package/dist/dso-toolkit/p-0917f18a.entry.js +0 -1
- package/dist/dso-toolkit/p-0c8cd0d8.entry.js +0 -1
- package/dist/dso-toolkit/p-203fc66c.entry.js +0 -1
- package/dist/dso-toolkit/p-3ab4441a.entry.js +0 -1
- package/dist/dso-toolkit/p-44c0bb3e.entry.js +0 -1
- package/dist/dso-toolkit/p-89d262b7.js +0 -5
- package/dist/dso-toolkit/p-9aa3fa9d.entry.js +0 -1
- package/dist/dso-toolkit/p-ba253bcd.entry.js +0 -1
- package/dist/dso-toolkit/p-e43e39cf.entry.js +0 -1
- package/dist/dso-toolkit/p-e8b22546.entry.js +0 -1
- package/dist/dso-toolkit/p-f93b7c7a.entry.js +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface DsoAccordion extends Components.DsoAccordion, HTMLElement {}
|
|
4
|
+
export const DsoAccordion: {
|
|
5
|
+
prototype: DsoAccordion;
|
|
6
|
+
new (): DsoAccordion;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import { getRenderingRef, forceUpdate, proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const appendToMap = (map, propName, value) => {
|
|
4
|
+
const items = map.get(propName);
|
|
5
|
+
if (!items) {
|
|
6
|
+
map.set(propName, [value]);
|
|
7
|
+
}
|
|
8
|
+
else if (!items.includes(value)) {
|
|
9
|
+
items.push(value);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const debounce = (fn, ms) => {
|
|
13
|
+
let timeoutId;
|
|
14
|
+
return (...args) => {
|
|
15
|
+
if (timeoutId) {
|
|
16
|
+
clearTimeout(timeoutId);
|
|
17
|
+
}
|
|
18
|
+
timeoutId = setTimeout(() => {
|
|
19
|
+
timeoutId = 0;
|
|
20
|
+
fn(...args);
|
|
21
|
+
}, ms);
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Check if a possible element isConnected.
|
|
27
|
+
* The property might not be there, so we check for it.
|
|
28
|
+
*
|
|
29
|
+
* We want it to return true if isConnected is not a property,
|
|
30
|
+
* otherwise we would remove these elements and would not update.
|
|
31
|
+
*
|
|
32
|
+
* Better leak in Edge than to be useless.
|
|
33
|
+
*/
|
|
34
|
+
const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
|
|
35
|
+
const cleanupElements = debounce((map) => {
|
|
36
|
+
for (let key of map.keys()) {
|
|
37
|
+
map.set(key, map.get(key).filter(isConnected));
|
|
38
|
+
}
|
|
39
|
+
}, 2000);
|
|
40
|
+
const stencilSubscription = () => {
|
|
41
|
+
if (typeof getRenderingRef !== 'function') {
|
|
42
|
+
// If we are not in a stencil project, we do nothing.
|
|
43
|
+
// This function is not really exported by @stencil/core.
|
|
44
|
+
return {};
|
|
45
|
+
}
|
|
46
|
+
const elmsToUpdate = new Map();
|
|
47
|
+
return {
|
|
48
|
+
dispose: () => elmsToUpdate.clear(),
|
|
49
|
+
get: (propName) => {
|
|
50
|
+
const elm = getRenderingRef();
|
|
51
|
+
if (elm) {
|
|
52
|
+
appendToMap(elmsToUpdate, propName, elm);
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
set: (propName) => {
|
|
56
|
+
const elements = elmsToUpdate.get(propName);
|
|
57
|
+
if (elements) {
|
|
58
|
+
elmsToUpdate.set(propName, elements.filter(forceUpdate));
|
|
59
|
+
}
|
|
60
|
+
cleanupElements(elmsToUpdate);
|
|
61
|
+
},
|
|
62
|
+
reset: () => {
|
|
63
|
+
elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));
|
|
64
|
+
cleanupElements(elmsToUpdate);
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const unwrap = (val) => (typeof val === 'function' ? val() : val);
|
|
70
|
+
const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
|
|
71
|
+
const unwrappedState = unwrap(defaultState);
|
|
72
|
+
let states = new Map(Object.entries(unwrappedState !== null && unwrappedState !== void 0 ? unwrappedState : {}));
|
|
73
|
+
const handlers = {
|
|
74
|
+
dispose: [],
|
|
75
|
+
get: [],
|
|
76
|
+
set: [],
|
|
77
|
+
reset: [],
|
|
78
|
+
};
|
|
79
|
+
const reset = () => {
|
|
80
|
+
var _a;
|
|
81
|
+
// When resetting the state, the default state may be a function - unwrap it to invoke it.
|
|
82
|
+
// otherwise, the state won't be properly reset
|
|
83
|
+
states = new Map(Object.entries((_a = unwrap(defaultState)) !== null && _a !== void 0 ? _a : {}));
|
|
84
|
+
handlers.reset.forEach((cb) => cb());
|
|
85
|
+
};
|
|
86
|
+
const dispose = () => {
|
|
87
|
+
// Call first dispose as resetting the state would
|
|
88
|
+
// cause less updates ;)
|
|
89
|
+
handlers.dispose.forEach((cb) => cb());
|
|
90
|
+
reset();
|
|
91
|
+
};
|
|
92
|
+
const get = (propName) => {
|
|
93
|
+
handlers.get.forEach((cb) => cb(propName));
|
|
94
|
+
return states.get(propName);
|
|
95
|
+
};
|
|
96
|
+
const set = (propName, value) => {
|
|
97
|
+
const oldValue = states.get(propName);
|
|
98
|
+
if (shouldUpdate(value, oldValue, propName)) {
|
|
99
|
+
states.set(propName, value);
|
|
100
|
+
handlers.set.forEach((cb) => cb(propName, value, oldValue));
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
const state = (typeof Proxy === 'undefined'
|
|
104
|
+
? {}
|
|
105
|
+
: new Proxy(unwrappedState, {
|
|
106
|
+
get(_, propName) {
|
|
107
|
+
return get(propName);
|
|
108
|
+
},
|
|
109
|
+
ownKeys(_) {
|
|
110
|
+
return Array.from(states.keys());
|
|
111
|
+
},
|
|
112
|
+
getOwnPropertyDescriptor() {
|
|
113
|
+
return {
|
|
114
|
+
enumerable: true,
|
|
115
|
+
configurable: true,
|
|
116
|
+
};
|
|
117
|
+
},
|
|
118
|
+
has(_, propName) {
|
|
119
|
+
return states.has(propName);
|
|
120
|
+
},
|
|
121
|
+
set(_, propName, value) {
|
|
122
|
+
set(propName, value);
|
|
123
|
+
return true;
|
|
124
|
+
},
|
|
125
|
+
}));
|
|
126
|
+
const on = (eventName, callback) => {
|
|
127
|
+
handlers[eventName].push(callback);
|
|
128
|
+
return () => {
|
|
129
|
+
removeFromArray(handlers[eventName], callback);
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
const onChange = (propName, cb) => {
|
|
133
|
+
const unSet = on('set', (key, newValue) => {
|
|
134
|
+
if (key === propName) {
|
|
135
|
+
cb(newValue);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
// We need to unwrap the defaultState because it might be a function.
|
|
139
|
+
// Otherwise we might not be sending the right reset value.
|
|
140
|
+
const unReset = on('reset', () => cb(unwrap(defaultState)[propName]));
|
|
141
|
+
return () => {
|
|
142
|
+
unSet();
|
|
143
|
+
unReset();
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
const use = (...subscriptions) => {
|
|
147
|
+
const unsubs = subscriptions.reduce((unsubs, subscription) => {
|
|
148
|
+
if (subscription.set) {
|
|
149
|
+
unsubs.push(on('set', subscription.set));
|
|
150
|
+
}
|
|
151
|
+
if (subscription.get) {
|
|
152
|
+
unsubs.push(on('get', subscription.get));
|
|
153
|
+
}
|
|
154
|
+
if (subscription.reset) {
|
|
155
|
+
unsubs.push(on('reset', subscription.reset));
|
|
156
|
+
}
|
|
157
|
+
if (subscription.dispose) {
|
|
158
|
+
unsubs.push(on('dispose', subscription.dispose));
|
|
159
|
+
}
|
|
160
|
+
return unsubs;
|
|
161
|
+
}, []);
|
|
162
|
+
return () => unsubs.forEach((unsub) => unsub());
|
|
163
|
+
};
|
|
164
|
+
const forceUpdate = (key) => {
|
|
165
|
+
const oldValue = states.get(key);
|
|
166
|
+
handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
|
|
167
|
+
};
|
|
168
|
+
return {
|
|
169
|
+
state,
|
|
170
|
+
get,
|
|
171
|
+
set,
|
|
172
|
+
on,
|
|
173
|
+
onChange,
|
|
174
|
+
use,
|
|
175
|
+
dispose,
|
|
176
|
+
reset,
|
|
177
|
+
forceUpdate,
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
const removeFromArray = (array, item) => {
|
|
181
|
+
const index = array.indexOf(item);
|
|
182
|
+
if (index >= 0) {
|
|
183
|
+
array[index] = array[array.length - 1];
|
|
184
|
+
array.length--;
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
const createStore = (defaultState, shouldUpdate) => {
|
|
189
|
+
const map = createObservableMap(defaultState, shouldUpdate);
|
|
190
|
+
map.use(stencilSubscription());
|
|
191
|
+
return map;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
const accordionCss = ":host{display:block}*,*::after,*::before{box-sizing:border-box}";
|
|
195
|
+
|
|
196
|
+
const Accordion = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
197
|
+
constructor() {
|
|
198
|
+
super();
|
|
199
|
+
this.__registerHost();
|
|
200
|
+
this.__attachShadow();
|
|
201
|
+
this.dsoToggleSection = createEvent(this, "dsoToggleSection", 7);
|
|
202
|
+
this.variant = "default";
|
|
203
|
+
this.reverseAlign = false;
|
|
204
|
+
this.allowMultipleOpen = false;
|
|
205
|
+
const { state } = createStore({
|
|
206
|
+
variant: this.variant || "default",
|
|
207
|
+
reverseAlign: this.reverseAlign,
|
|
208
|
+
});
|
|
209
|
+
this.accordionState = state;
|
|
210
|
+
}
|
|
211
|
+
updateVariant(variant = "default") {
|
|
212
|
+
this.accordionState.variant = variant || "default";
|
|
213
|
+
}
|
|
214
|
+
updateReverseAlign(reverseAlign) {
|
|
215
|
+
this.accordionState.reverseAlign = reverseAlign;
|
|
216
|
+
}
|
|
217
|
+
watchAllowMultiple(allowMultipleOpen) {
|
|
218
|
+
if (!allowMultipleOpen) {
|
|
219
|
+
const openSections = Array.from(this.host.querySelectorAll(":scope > dso-accordion-section[open]"));
|
|
220
|
+
// By removing the first section, it is kept open;
|
|
221
|
+
openSections.shift();
|
|
222
|
+
openSections.forEach((section) => this.controlOpenAttribute(section, false));
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
async getState() {
|
|
226
|
+
return this.accordionState;
|
|
227
|
+
}
|
|
228
|
+
/** Toggle a section. Pass the `<dso-accordion-section>` element or the index of the section. */
|
|
229
|
+
async toggleSection(sectionElement, event) {
|
|
230
|
+
const sections = Array.from(this.host.querySelectorAll(":scope > dso-accordion-section"));
|
|
231
|
+
if (typeof sectionElement === "number") {
|
|
232
|
+
sectionElement = sections[sectionElement];
|
|
233
|
+
}
|
|
234
|
+
if (!(sectionElement instanceof HTMLElement) || !sections.includes(sectionElement)) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
const sectionIsOpen = this.isSectionOpen(sectionElement);
|
|
238
|
+
if (this.allowMultipleOpen) {
|
|
239
|
+
this.controlOpenAttribute(sectionElement, !sectionIsOpen);
|
|
240
|
+
this.emitToggleEvent(sectionElement, sections, event);
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
if (sectionIsOpen) {
|
|
244
|
+
this.controlOpenAttribute(sectionElement, false);
|
|
245
|
+
this.emitToggleEvent(sectionElement, sections, event);
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
await this.closeOpenSections();
|
|
249
|
+
this.controlOpenAttribute(sectionElement, true);
|
|
250
|
+
this.emitToggleEvent(sectionElement, sections, event);
|
|
251
|
+
}
|
|
252
|
+
/** Closes all sections belonging to this accordion. */
|
|
253
|
+
async closeOpenSections() {
|
|
254
|
+
const sections = Array.from(this.host.querySelectorAll(":scope > dso-accordion-section"));
|
|
255
|
+
const openSections = sections.filter((s) => this.isSectionOpen(s));
|
|
256
|
+
openSections.forEach((section) => this.controlOpenAttribute(section, false));
|
|
257
|
+
}
|
|
258
|
+
render() {
|
|
259
|
+
return (h(Host, { class: {
|
|
260
|
+
"dso-accordion": true,
|
|
261
|
+
} }, h("slot", null)));
|
|
262
|
+
}
|
|
263
|
+
emitToggleEvent(sectionElement, sections, e) {
|
|
264
|
+
this.dsoToggleSection.emit({
|
|
265
|
+
originalEvent: e,
|
|
266
|
+
section: {
|
|
267
|
+
element: sectionElement,
|
|
268
|
+
open: this.isSectionOpen(sectionElement),
|
|
269
|
+
},
|
|
270
|
+
sections,
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
isSectionOpen(sectionElement) {
|
|
274
|
+
return typeof sectionElement.getAttribute("open") === "string";
|
|
275
|
+
}
|
|
276
|
+
controlOpenAttribute(sectionElement, setAttribute) {
|
|
277
|
+
if (setAttribute) {
|
|
278
|
+
sectionElement.setAttribute("open", "");
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
sectionElement.removeAttribute("open");
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
get host() { return this; }
|
|
285
|
+
static get watchers() { return {
|
|
286
|
+
"variant": ["updateVariant"],
|
|
287
|
+
"reverseAlign": ["updateReverseAlign"],
|
|
288
|
+
"allowMultipleOpen": ["watchAllowMultiple"]
|
|
289
|
+
}; }
|
|
290
|
+
static get style() { return accordionCss; }
|
|
291
|
+
}, [1, "dso-accordion", {
|
|
292
|
+
"variant": [513],
|
|
293
|
+
"reverseAlign": [516, "reverse-align"],
|
|
294
|
+
"allowMultipleOpen": [516, "allow-multiple-open"],
|
|
295
|
+
"getState": [64],
|
|
296
|
+
"toggleSection": [64],
|
|
297
|
+
"closeOpenSections": [64]
|
|
298
|
+
}]);
|
|
299
|
+
function defineCustomElement$1() {
|
|
300
|
+
if (typeof customElements === "undefined") {
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
const components = ["dso-accordion"];
|
|
304
|
+
components.forEach(tagName => { switch (tagName) {
|
|
305
|
+
case "dso-accordion":
|
|
306
|
+
if (!customElements.get(tagName)) {
|
|
307
|
+
customElements.define(tagName, Accordion);
|
|
308
|
+
}
|
|
309
|
+
break;
|
|
310
|
+
} });
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
const DsoAccordion = Accordion;
|
|
314
|
+
const defineCustomElement = defineCustomElement$1;
|
|
315
|
+
|
|
316
|
+
export { DsoAccordion, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface DsoAlert extends Components.DsoAlert, HTMLElement {}
|
|
4
|
+
export const DsoAlert: {
|
|
5
|
+
prototype: DsoAlert;
|
|
6
|
+
new (): DsoAlert;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { c as clsx } from './clsx.m.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './icon.js';
|
|
4
|
+
|
|
5
|
+
const alertCss = ":host{display:block}:host(:not(:first-child)){margin-top:24px}*,*::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}.alert{border:1px solid transparent;line-height:1.5;margin-bottom:24px;min-height:64px;position:relative}@media screen and (min-width: 481px){.alert{padding:19px 16px 19px 63px}}@media screen and (max-width: 480px){.alert{padding:63px 16px 16px}}.alert:not(:first-child){margin-top:24px}.alert.alert-success{color:#191919;background-color:#e4f1d4;border-color:#e4f1d4}.alert.alert-error{color:#191919;background-color:#f5d8dc;border-color:#f5d8dc}.alert.alert-warning{color:#191919;background-color:#f8f6cc;border-color:#f8f6cc}.alert.alert-info{color:#191919;background-color:#e1ecf7;border-color:#e1ecf7}.alert dso-icon{left:15px;position:absolute;top:15px;height:32px;width:32px}";
|
|
6
|
+
|
|
7
|
+
const Alert = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
this.__attachShadow();
|
|
12
|
+
this.status = undefined;
|
|
13
|
+
this.roleAlert = undefined;
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
const status = Alert.statusMap.get(this.status);
|
|
17
|
+
if (!status) {
|
|
18
|
+
throw new Error(`Invalid status ${this.status}`);
|
|
19
|
+
}
|
|
20
|
+
return (h("div", { class: clsx("alert", `alert-${this.status}`), role: this.roleAlert ? "alert" : undefined }, h("dso-icon", { icon: "status-" + this.status }), h("span", { class: "sr-only" }, status, ":"), h("slot", null)));
|
|
21
|
+
}
|
|
22
|
+
static get style() { return alertCss; }
|
|
23
|
+
}, [1, "dso-alert", {
|
|
24
|
+
"status": [1],
|
|
25
|
+
"roleAlert": [4, "role-alert"]
|
|
26
|
+
}]);
|
|
27
|
+
Alert.statusMap = new Map([
|
|
28
|
+
["success", "Gelukt"],
|
|
29
|
+
["info", "Opmerking"],
|
|
30
|
+
["warning", "Waarschuwing"],
|
|
31
|
+
["error", "Fout"],
|
|
32
|
+
]);
|
|
33
|
+
function defineCustomElement$1() {
|
|
34
|
+
if (typeof customElements === "undefined") {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const components = ["dso-alert", "dso-icon"];
|
|
38
|
+
components.forEach(tagName => { switch (tagName) {
|
|
39
|
+
case "dso-alert":
|
|
40
|
+
if (!customElements.get(tagName)) {
|
|
41
|
+
customElements.define(tagName, Alert);
|
|
42
|
+
}
|
|
43
|
+
break;
|
|
44
|
+
case "dso-icon":
|
|
45
|
+
if (!customElements.get(tagName)) {
|
|
46
|
+
defineCustomElement$2();
|
|
47
|
+
}
|
|
48
|
+
break;
|
|
49
|
+
} });
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const DsoAlert = Alert;
|
|
53
|
+
const defineCustomElement = defineCustomElement$1;
|
|
54
|
+
|
|
55
|
+
export { DsoAlert, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface DsoAttachmentsCounter extends Components.DsoAttachmentsCounter, HTMLElement {}
|
|
4
|
+
export const DsoAttachmentsCounter: {
|
|
5
|
+
prototype: DsoAttachmentsCounter;
|
|
6
|
+
new (): DsoAttachmentsCounter;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$2 } from './icon.js';
|
|
3
|
+
|
|
4
|
+
const attachmentsCounterCss = ":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-attachments{color:var(--dso-attachments-counter-color, #666);display:inline-block;font-weight:400;text-decoration:none;white-space:nowrap}";
|
|
5
|
+
|
|
6
|
+
const AttachmentsCounter = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.__attachShadow();
|
|
11
|
+
this.count = undefined;
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return (h("span", { class: "dso-attachments" }, this.count, " ", h("span", { class: "sr-only" }, "bijlage", this.count !== 1 ? "n" : ""), h("dso-icon", { icon: "paperclip" })));
|
|
15
|
+
}
|
|
16
|
+
static get style() { return attachmentsCounterCss; }
|
|
17
|
+
}, [1, "dso-attachments-counter", {
|
|
18
|
+
"count": [2]
|
|
19
|
+
}]);
|
|
20
|
+
function defineCustomElement$1() {
|
|
21
|
+
if (typeof customElements === "undefined") {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const components = ["dso-attachments-counter", "dso-icon"];
|
|
25
|
+
components.forEach(tagName => { switch (tagName) {
|
|
26
|
+
case "dso-attachments-counter":
|
|
27
|
+
if (!customElements.get(tagName)) {
|
|
28
|
+
customElements.define(tagName, AttachmentsCounter);
|
|
29
|
+
}
|
|
30
|
+
break;
|
|
31
|
+
case "dso-icon":
|
|
32
|
+
if (!customElements.get(tagName)) {
|
|
33
|
+
defineCustomElement$2();
|
|
34
|
+
}
|
|
35
|
+
break;
|
|
36
|
+
} });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const DsoAttachmentsCounter = AttachmentsCounter;
|
|
40
|
+
const defineCustomElement = defineCustomElement$1;
|
|
41
|
+
|
|
42
|
+
export { DsoAttachmentsCounter, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface DsoAutosuggest extends Components.DsoAutosuggest, HTMLElement {}
|
|
4
|
+
export const DsoAutosuggest: {
|
|
5
|
+
prototype: DsoAutosuggest;
|
|
6
|
+
new (): DsoAutosuggest;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|