qc-trousse-sdg 1.4.6 → 1.4.7
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/README.md +10 -0
- package/dist/css/qc-sdg-no-grid.min.css +1 -1
- package/dist/css/qc-sdg.min.css +1 -1
- package/dist/js/qc-sdg.min.js +1 -1
- package/package-lock.json +4689 -0
- package/package.json +1 -1
- package/public/css/qc-doc-sdg.css +38 -6
- package/public/css/qc-sdg-no-grid.css +47 -20
- package/public/css/qc-sdg.css +47 -20
- package/public/index.html +58 -20
- package/public/js/qc-doc-sdg.js +294 -204
- package/public/js/qc-sdg.js +663 -315
- package/src/doc/qc-doc-sdg.js +6 -1
- package/src/doc/scss/components/_exemple.scss +5 -1
- package/src/doc/scss/qc-doc-sdg.scss +22 -4
- package/src/sdg/bases/Icon/Icon.svelte +2 -0
- package/src/sdg/bases/links/_links.scss +18 -12
- package/src/sdg/components/Alert/Alert.svelte +28 -9
- package/src/sdg/components/Alert/AlertWC.svelte +20 -5
- package/src/sdg/components/Alert/Test/AlertSvelteTest.svelte +25 -0
- package/src/sdg/components/Alert/Test/alertBaselineTest.html +13 -0
- package/src/sdg/components/Alert/Test/alertSvelteTest.html +1 -0
- package/src/sdg/components/Alert/_alert.html +23 -11
- package/src/sdg/components/Checkbox/Checkbox.svelte +6 -5
- package/src/sdg/components/DropdownList/DropdownList.svelte +65 -14
- package/src/sdg/components/DropdownList/DropdownListButton/DropdownListButton.svelte +2 -6
- package/src/sdg/components/DropdownList/DropdownListItems/DropdownListItems.svelte +4 -22
- package/src/sdg/components/DropdownList/DropdownListItems/DropdownListItemsMultiple/DropdownListItemsMultiple.svelte +2 -1
- package/src/sdg/components/DropdownList/DropdownListItems/DropdownListItemsSingle/DropdownListItemsSingle.svelte +2 -1
- package/src/sdg/components/DropdownList/SelectWC.svelte +39 -13
- package/src/sdg/components/DropdownList/Test/DropdownListSvelteTest.svelte +2 -2
- package/src/sdg/components/DropdownList/Test/dropdownListBaselineTest.html +7 -0
- package/src/sdg/components/DropdownList/_dropdownList.scss +7 -5
- package/src/sdg/components/DropdownList/_select.html +31 -5
- package/src/sdg/components/ExternalLink/ExternalLink.svelte +36 -74
- package/src/sdg/components/ExternalLink/ExternalLinkWC.svelte +44 -1
- package/src/sdg/components/ExternalLink/externalLinkBaselineTest.html +45 -0
- package/src/sdg/components/Fieldset/_fieldset.scss +1 -1
- package/src/sdg/components/Label/LabelText.svelte +2 -1
- package/src/sdg/components/Label/_label.scss +10 -2
- package/src/sdg/components/PivFooter/_pivFooter.html +4 -4
- package/src/sdg/components/TextField/Test/TextFieldEmbededTest.svelte +19 -3
- package/src/sdg/components/TextField/Test/textFieldBaselineTest.html +5 -2
- package/src/sdg/components/TextField/TextField.svelte +12 -6
- package/src/sdg/components/TextField/TextFieldWC.svelte +18 -6
- package/src/sdg/components/TextField/textFieldUtils.js +3 -2
- package/src/sdg/components/utils.js +23 -0
- package/src/sdg/qc-sdg-test.js +2 -1
- package/src/sdg/scss/lib/_mixins.scss +6 -0
- package/src/sdg/scss/utilities/_states.scss +1 -1
- package/tests/alert-baseline.spec.ts +23 -0
- package/tests/alert-svelte.spec.ts +23 -0
- package/tests/buildSvelteTestsIgnore.json +2 -1
- package/tests/dropdown-list-baseline.spec.ts +8 -0
- package/tests/external-link-baseline.spec.ts +30 -0
- package/tests/textfield-baseline.spec.ts +5 -5
- package/tests/textfield-svelte.spec.ts +5 -5
package/public/js/qc-sdg.js
CHANGED
|
@@ -9087,6 +9087,29 @@
|
|
|
9087
9087
|
// Convertit le mot en minuscules.
|
|
9088
9088
|
return word.toLowerCase();
|
|
9089
9089
|
}
|
|
9090
|
+
|
|
9091
|
+
static now() {
|
|
9092
|
+
return (new Date()).getTime();
|
|
9093
|
+
}
|
|
9094
|
+
|
|
9095
|
+
/**
|
|
9096
|
+
* Creates a MutationObserver instance with selector nesting check
|
|
9097
|
+
* @param rootElement
|
|
9098
|
+
* @param callback
|
|
9099
|
+
* @param selector
|
|
9100
|
+
* @returns {MutationObserver | null}
|
|
9101
|
+
*/
|
|
9102
|
+
static createMutationObserver(rootElement, callback, selector) {
|
|
9103
|
+
if (!selector) {
|
|
9104
|
+
selector = rootElement.tagName.toLowerCase();
|
|
9105
|
+
}
|
|
9106
|
+
if (rootElement.querySelector(selector)) {
|
|
9107
|
+
console.warn(`Imbrication d'éléments "${selector}" détectée. Le MutationObserver n'est pas créé`);
|
|
9108
|
+
return null;
|
|
9109
|
+
}
|
|
9110
|
+
|
|
9111
|
+
return new MutationObserver(callback);
|
|
9112
|
+
}
|
|
9090
9113
|
}
|
|
9091
9114
|
|
|
9092
9115
|
function getCacheBustingParam(cssPath, currentScriptSrc) {
|
|
@@ -9133,7 +9156,7 @@
|
|
|
9133
9156
|
|
|
9134
9157
|
Icon[FILENAME] = 'src/sdg/bases/Icon/Icon.svelte';
|
|
9135
9158
|
|
|
9136
|
-
var root$n = add_locations(from_html(`<div></div>`), Icon[FILENAME], [[
|
|
9159
|
+
var root$n = add_locations(from_html(`<div></div>`), Icon[FILENAME], [[17, 0]]);
|
|
9137
9160
|
|
|
9138
9161
|
function Icon($$anchor, $$props) {
|
|
9139
9162
|
check_target(new.target);
|
|
@@ -9147,6 +9170,7 @@
|
|
|
9147
9170
|
height = prop($$props, 'height', 7, 'auto'),
|
|
9148
9171
|
src = prop($$props, 'src', 7, ''),
|
|
9149
9172
|
rotate = prop($$props, 'rotate', 7, 0),
|
|
9173
|
+
rootElement = prop($$props, 'rootElement', 15),
|
|
9150
9174
|
rest = rest_props(
|
|
9151
9175
|
$$props,
|
|
9152
9176
|
[
|
|
@@ -9161,7 +9185,8 @@
|
|
|
9161
9185
|
'width',
|
|
9162
9186
|
'height',
|
|
9163
9187
|
'src',
|
|
9164
|
-
'rotate'
|
|
9188
|
+
'rotate',
|
|
9189
|
+
'rootElement'
|
|
9165
9190
|
]);
|
|
9166
9191
|
|
|
9167
9192
|
let attributes = tag(user_derived(() => strict_equals(width(), 'auto') ? { 'data-img-size': size() } : {}), 'attributes');
|
|
@@ -9239,6 +9264,15 @@
|
|
|
9239
9264
|
flushSync();
|
|
9240
9265
|
},
|
|
9241
9266
|
|
|
9267
|
+
get rootElement() {
|
|
9268
|
+
return rootElement();
|
|
9269
|
+
},
|
|
9270
|
+
|
|
9271
|
+
set rootElement($$value) {
|
|
9272
|
+
rootElement($$value);
|
|
9273
|
+
flushSync();
|
|
9274
|
+
},
|
|
9275
|
+
|
|
9242
9276
|
...legacy_api()
|
|
9243
9277
|
};
|
|
9244
9278
|
|
|
@@ -9262,6 +9296,7 @@
|
|
|
9262
9296
|
[STYLE]: { '--img-rotate': rotate() && rotate() + "deg" }
|
|
9263
9297
|
}));
|
|
9264
9298
|
|
|
9299
|
+
bind_this(div, ($$value) => rootElement($$value), () => rootElement());
|
|
9265
9300
|
append($$anchor, div);
|
|
9266
9301
|
|
|
9267
9302
|
return pop($$exports);
|
|
@@ -9277,7 +9312,8 @@
|
|
|
9277
9312
|
width: {},
|
|
9278
9313
|
height: {},
|
|
9279
9314
|
src: {},
|
|
9280
|
-
rotate: {}
|
|
9315
|
+
rotate: {},
|
|
9316
|
+
rootElement: {}
|
|
9281
9317
|
},
|
|
9282
9318
|
[],
|
|
9283
9319
|
[],
|
|
@@ -10874,7 +10910,7 @@
|
|
|
10874
10910
|
|
|
10875
10911
|
Alert[FILENAME] = 'src/sdg/components/Alert/Alert.svelte';
|
|
10876
10912
|
|
|
10877
|
-
var root_1$7 = add_locations(from_html(`<div role="alert"><div><div class="qc-general-alert-elements"><!> <div class="qc-alert-content"><!> <!></div> <!></div></div></div>`), Alert[FILENAME], [[
|
|
10913
|
+
var root_1$7 = add_locations(from_html(`<div role="alert"><div><div class="qc-general-alert-elements"><!> <div class="qc-alert-content"><!> <!></div> <!></div></div></div>`), Alert[FILENAME], [[59, 4, [[62, 8, [[63, 12, [[69, 16]]]]]]]]);
|
|
10878
10914
|
|
|
10879
10915
|
function Alert($$anchor, $$props) {
|
|
10880
10916
|
check_target(new.target);
|
|
@@ -10883,9 +10919,14 @@
|
|
|
10883
10919
|
let type = prop($$props, 'type', 7, "general"),
|
|
10884
10920
|
maskable = prop($$props, 'maskable', 7, ""),
|
|
10885
10921
|
content = prop($$props, 'content', 7, ""),
|
|
10886
|
-
hide = prop($$props, 'hide',
|
|
10922
|
+
hide = prop($$props, 'hide', 15, "false"),
|
|
10887
10923
|
fullWidth = prop($$props, 'fullWidth', 7, "false"),
|
|
10888
|
-
slotContent = prop($$props, 'slotContent', 7)
|
|
10924
|
+
slotContent = prop($$props, 'slotContent', 7),
|
|
10925
|
+
id = prop($$props, 'id', 7),
|
|
10926
|
+
persistenceKey = prop($$props, 'persistenceKey', 7),
|
|
10927
|
+
persistHidden = prop($$props, 'persistHidden', 7, false),
|
|
10928
|
+
rootElement = prop($$props, 'rootElement', 15),
|
|
10929
|
+
hideAlertCallback = prop($$props, 'hideAlertCallback', 7, () => {});
|
|
10889
10930
|
|
|
10890
10931
|
const language = Utils.getPageLanguage();
|
|
10891
10932
|
const typeClass = strict_equals(type(), "", false) ? type() : 'general';
|
|
@@ -10897,12 +10938,38 @@
|
|
|
10897
10938
|
|
|
10898
10939
|
const generalLabel = strict_equals(language, 'fr') ? "Information importante" : "Important information";
|
|
10899
10940
|
const label = strict_equals(type(), 'general') ? generalLabel : warningLabel;
|
|
10900
|
-
let rootElement = tag(state(null), 'rootElement');
|
|
10901
10941
|
let containerClass = "qc-container" + (strict_equals(fullWidth(), 'true') ? '-fluid' : '');
|
|
10902
10942
|
|
|
10943
|
+
onMount(() => {
|
|
10944
|
+
const key = getPersistenceKey();
|
|
10945
|
+
|
|
10946
|
+
if (!key) return;
|
|
10947
|
+
|
|
10948
|
+
hide(sessionStorage.getItem(key) ? "true" : "false");
|
|
10949
|
+
});
|
|
10950
|
+
|
|
10903
10951
|
function hideAlert() {
|
|
10904
10952
|
hide("true");
|
|
10905
|
-
|
|
10953
|
+
persistHiddenState();
|
|
10954
|
+
hideAlertCallback()();
|
|
10955
|
+
}
|
|
10956
|
+
|
|
10957
|
+
function getPersistenceKey() {
|
|
10958
|
+
if (!persistHidden()) return false;
|
|
10959
|
+
|
|
10960
|
+
const key = persistenceKey() || id();
|
|
10961
|
+
|
|
10962
|
+
if (!key) return false;
|
|
10963
|
+
|
|
10964
|
+
return 'qc-alert:' + key;
|
|
10965
|
+
}
|
|
10966
|
+
|
|
10967
|
+
function persistHiddenState() {
|
|
10968
|
+
const key = getPersistenceKey();
|
|
10969
|
+
|
|
10970
|
+
if (!key) return;
|
|
10971
|
+
|
|
10972
|
+
sessionStorage.setItem(key, Utils.now());
|
|
10906
10973
|
}
|
|
10907
10974
|
|
|
10908
10975
|
var $$exports = {
|
|
@@ -10960,6 +11027,51 @@
|
|
|
10960
11027
|
flushSync();
|
|
10961
11028
|
},
|
|
10962
11029
|
|
|
11030
|
+
get id() {
|
|
11031
|
+
return id();
|
|
11032
|
+
},
|
|
11033
|
+
|
|
11034
|
+
set id($$value) {
|
|
11035
|
+
id($$value);
|
|
11036
|
+
flushSync();
|
|
11037
|
+
},
|
|
11038
|
+
|
|
11039
|
+
get persistenceKey() {
|
|
11040
|
+
return persistenceKey();
|
|
11041
|
+
},
|
|
11042
|
+
|
|
11043
|
+
set persistenceKey($$value) {
|
|
11044
|
+
persistenceKey($$value);
|
|
11045
|
+
flushSync();
|
|
11046
|
+
},
|
|
11047
|
+
|
|
11048
|
+
get persistHidden() {
|
|
11049
|
+
return persistHidden();
|
|
11050
|
+
},
|
|
11051
|
+
|
|
11052
|
+
set persistHidden($$value = false) {
|
|
11053
|
+
persistHidden($$value);
|
|
11054
|
+
flushSync();
|
|
11055
|
+
},
|
|
11056
|
+
|
|
11057
|
+
get rootElement() {
|
|
11058
|
+
return rootElement();
|
|
11059
|
+
},
|
|
11060
|
+
|
|
11061
|
+
set rootElement($$value) {
|
|
11062
|
+
rootElement($$value);
|
|
11063
|
+
flushSync();
|
|
11064
|
+
},
|
|
11065
|
+
|
|
11066
|
+
get hideAlertCallback() {
|
|
11067
|
+
return hideAlertCallback();
|
|
11068
|
+
},
|
|
11069
|
+
|
|
11070
|
+
set hideAlertCallback($$value = () => {}) {
|
|
11071
|
+
hideAlertCallback($$value);
|
|
11072
|
+
flushSync();
|
|
11073
|
+
},
|
|
11074
|
+
|
|
10963
11075
|
...legacy_api()
|
|
10964
11076
|
};
|
|
10965
11077
|
|
|
@@ -10995,7 +11107,7 @@
|
|
|
10995
11107
|
}),
|
|
10996
11108
|
'component',
|
|
10997
11109
|
Alert,
|
|
10998
|
-
|
|
11110
|
+
64,
|
|
10999
11111
|
16,
|
|
11000
11112
|
{ componentTag: 'Icon' }
|
|
11001
11113
|
);
|
|
@@ -11029,7 +11141,7 @@
|
|
|
11029
11141
|
}),
|
|
11030
11142
|
'component',
|
|
11031
11143
|
Alert,
|
|
11032
|
-
|
|
11144
|
+
74,
|
|
11033
11145
|
20,
|
|
11034
11146
|
{ componentTag: 'IconButton' }
|
|
11035
11147
|
);
|
|
@@ -11041,7 +11153,7 @@
|
|
|
11041
11153
|
}),
|
|
11042
11154
|
'if',
|
|
11043
11155
|
Alert,
|
|
11044
|
-
|
|
11156
|
+
73,
|
|
11045
11157
|
16
|
|
11046
11158
|
);
|
|
11047
11159
|
}
|
|
@@ -11049,7 +11161,7 @@
|
|
|
11049
11161
|
reset(div_2);
|
|
11050
11162
|
reset(div_1);
|
|
11051
11163
|
reset(div);
|
|
11052
|
-
bind_this(div, ($$value) =>
|
|
11164
|
+
bind_this(div, ($$value) => rootElement($$value), () => rootElement());
|
|
11053
11165
|
|
|
11054
11166
|
template_effect(() => {
|
|
11055
11167
|
set_class(div, 1, `qc-general-alert ${typeClass ?? ''}`);
|
|
@@ -11065,7 +11177,7 @@
|
|
|
11065
11177
|
}),
|
|
11066
11178
|
'if',
|
|
11067
11179
|
Alert,
|
|
11068
|
-
|
|
11180
|
+
58,
|
|
11069
11181
|
0
|
|
11070
11182
|
);
|
|
11071
11183
|
}
|
|
@@ -11083,7 +11195,12 @@
|
|
|
11083
11195
|
content: {},
|
|
11084
11196
|
hide: {},
|
|
11085
11197
|
fullWidth: {},
|
|
11086
|
-
slotContent: {}
|
|
11198
|
+
slotContent: {},
|
|
11199
|
+
id: {},
|
|
11200
|
+
persistenceKey: {},
|
|
11201
|
+
persistHidden: {},
|
|
11202
|
+
rootElement: {},
|
|
11203
|
+
hideAlertCallback: {}
|
|
11087
11204
|
},
|
|
11088
11205
|
[],
|
|
11089
11206
|
[],
|
|
@@ -11092,18 +11209,69 @@
|
|
|
11092
11209
|
|
|
11093
11210
|
AlertWC[FILENAME] = 'src/sdg/components/Alert/AlertWC.svelte';
|
|
11094
11211
|
|
|
11095
|
-
var root$f = add_locations(from_html(`<!> <link rel="stylesheet"/>`, 1), AlertWC[FILENAME], [[
|
|
11212
|
+
var root$f = add_locations(from_html(`<!> <link rel="stylesheet"/>`, 1), AlertWC[FILENAME], [[40, 0]]);
|
|
11096
11213
|
|
|
11097
11214
|
function AlertWC($$anchor, $$props) {
|
|
11098
11215
|
check_target(new.target);
|
|
11099
11216
|
push($$props, true);
|
|
11100
11217
|
|
|
11101
|
-
|
|
11102
|
-
|
|
11218
|
+
var $$ownership_validator = create_ownership_validator($$props);
|
|
11219
|
+
|
|
11220
|
+
let hide = prop($$props, 'hide', 7, "false"),
|
|
11221
|
+
props = rest_props($$props, ['$$slots', '$$events', '$$legacy', '$$host', 'hide']);
|
|
11222
|
+
|
|
11223
|
+
let rootElement = tag(state(void 0), 'rootElement');
|
|
11224
|
+
|
|
11225
|
+
function hideAlertCallback() {
|
|
11226
|
+
get(rootElement)?.dispatchEvent(new CustomEvent('qc.alert.hide', { bubbles: true, composed: true }));
|
|
11227
|
+
}
|
|
11228
|
+
|
|
11229
|
+
var $$exports = {
|
|
11230
|
+
get hide() {
|
|
11231
|
+
return hide();
|
|
11232
|
+
},
|
|
11233
|
+
|
|
11234
|
+
set hide($$value = "false") {
|
|
11235
|
+
hide($$value);
|
|
11236
|
+
flushSync();
|
|
11237
|
+
},
|
|
11238
|
+
|
|
11239
|
+
...legacy_api()
|
|
11240
|
+
};
|
|
11241
|
+
|
|
11103
11242
|
var fragment = root$f();
|
|
11104
11243
|
var node = first_child(fragment);
|
|
11105
11244
|
|
|
11106
|
-
|
|
11245
|
+
{
|
|
11246
|
+
$$ownership_validator.binding('hide', Alert, hide);
|
|
11247
|
+
|
|
11248
|
+
add_svelte_meta(
|
|
11249
|
+
() => Alert(node, spread_props({ hideAlertCallback }, () => props, {
|
|
11250
|
+
slotContent: `<slot />`,
|
|
11251
|
+
|
|
11252
|
+
get hide() {
|
|
11253
|
+
return hide();
|
|
11254
|
+
},
|
|
11255
|
+
|
|
11256
|
+
set hide($$value) {
|
|
11257
|
+
hide($$value);
|
|
11258
|
+
},
|
|
11259
|
+
|
|
11260
|
+
get rootElement() {
|
|
11261
|
+
return get(rootElement);
|
|
11262
|
+
},
|
|
11263
|
+
|
|
11264
|
+
set rootElement($$value) {
|
|
11265
|
+
set(rootElement, $$value, true);
|
|
11266
|
+
}
|
|
11267
|
+
})),
|
|
11268
|
+
'component',
|
|
11269
|
+
AlertWC,
|
|
11270
|
+
33,
|
|
11271
|
+
1,
|
|
11272
|
+
{ componentTag: 'Alert' }
|
|
11273
|
+
);
|
|
11274
|
+
}
|
|
11107
11275
|
|
|
11108
11276
|
var link = sibling(node, 2);
|
|
11109
11277
|
|
|
@@ -11120,7 +11288,9 @@
|
|
|
11120
11288
|
maskable: { attribute: 'maskable' },
|
|
11121
11289
|
fullWidth: { attribute: 'full-width' },
|
|
11122
11290
|
content: { attribute: 'content' },
|
|
11123
|
-
hide: { attribute: 'hide' }
|
|
11291
|
+
hide: { attribute: 'hide', reflect: true },
|
|
11292
|
+
persistHidden: { attribute: 'persist-hidden', type: 'Boolean' },
|
|
11293
|
+
persistenceKey: { attribute: 'persistence-key', type: 'String' }
|
|
11124
11294
|
},
|
|
11125
11295
|
[],
|
|
11126
11296
|
[],
|
|
@@ -11267,91 +11437,49 @@
|
|
|
11267
11437
|
|
|
11268
11438
|
ExternalLink[FILENAME] = 'src/sdg/components/ExternalLink/ExternalLink.svelte';
|
|
11269
11439
|
|
|
11270
|
-
var root$d = add_locations(from_html(`<
|
|
11440
|
+
var root$d = add_locations(from_html(`<div hidden=""><!></div>`), ExternalLink[FILENAME], [[48, 0]]);
|
|
11271
11441
|
|
|
11272
11442
|
function ExternalLink($$anchor, $$props) {
|
|
11273
11443
|
check_target(new.target);
|
|
11274
11444
|
push($$props, true);
|
|
11275
11445
|
|
|
11276
|
-
|
|
11277
|
-
|
|
11278
|
-
|
|
11446
|
+
let externalIconAlt = prop($$props, 'externalIconAlt', 23, () => strict_equals(Utils.getPageLanguage(), 'fr')
|
|
11447
|
+
? "Ce lien dirige vers un autre site."
|
|
11448
|
+
: "This link directs to another site."),
|
|
11449
|
+
links = prop($$props, 'links', 23, () => []),
|
|
11450
|
+
isUpdating = prop($$props, 'isUpdating', 15, false),
|
|
11451
|
+
nestedExternalLinks = prop($$props, 'nestedExternalLinks', 7, false);
|
|
11279
11452
|
|
|
11280
11453
|
let imgElement = tag(state(void 0), 'imgElement');
|
|
11454
|
+
let processedLinks = new Set();
|
|
11281
11455
|
|
|
11282
|
-
function
|
|
11283
|
-
|
|
11284
|
-
|
|
11285
|
-
if (node instanceof Element) {
|
|
11286
|
-
if (node.hasAttribute('hidden')) {
|
|
11287
|
-
return NodeFilter.FILTER_REJECT;
|
|
11288
|
-
}
|
|
11289
|
-
|
|
11290
|
-
const style = window.getComputedStyle(node);
|
|
11291
|
-
|
|
11292
|
-
// Si l'élément est masqué par CSS (display ou visibility), on l'ignore
|
|
11293
|
-
if (strict_equals(style.display, 'none') || strict_equals(style.visibility, 'hidden') || strict_equals(style.position, 'absolute')) {
|
|
11294
|
-
return NodeFilter.FILTER_REJECT;
|
|
11295
|
-
}
|
|
11296
|
-
}
|
|
11297
|
-
|
|
11298
|
-
if (!node instanceof Text) {
|
|
11299
|
-
return NodeFilter.FILTER_SKIP;
|
|
11300
|
-
}
|
|
11301
|
-
|
|
11302
|
-
// Ignore les nœuds vides
|
|
11303
|
-
if (!(/\S/).test(node.textContent)) {
|
|
11304
|
-
return NodeFilter.FILTER_SKIP;
|
|
11305
|
-
}
|
|
11306
|
-
|
|
11307
|
-
return NodeFilter.FILTER_ACCEPT;
|
|
11308
|
-
}
|
|
11309
|
-
});
|
|
11310
|
-
}
|
|
11311
|
-
|
|
11312
|
-
onMount(() => {
|
|
11313
|
-
get(imgElement).parentElement.querySelectorAll('a').forEach((link) => {
|
|
11314
|
-
// Crée un TreeWalker pour parcourir uniquement les nœuds texte visibles
|
|
11315
|
-
const walker = createVisibleNodesTreeWalker();
|
|
11316
|
-
|
|
11317
|
-
let lastTextNode = null;
|
|
11318
|
-
|
|
11319
|
-
while (walker.nextNode()) {
|
|
11320
|
-
lastTextNode = walker.currentNode;
|
|
11321
|
-
}
|
|
11322
|
-
|
|
11323
|
-
// S'il n'y a pas de nœud texte visible, on ne fait rien
|
|
11324
|
-
if (!lastTextNode) {
|
|
11456
|
+
function addExternalLinkIcon(links) {
|
|
11457
|
+
links.forEach((link) => {
|
|
11458
|
+
if (processedLinks.has(link.innerHTML)) {
|
|
11325
11459
|
return;
|
|
11326
11460
|
}
|
|
11327
11461
|
|
|
11328
|
-
|
|
11329
|
-
// le préfixe (éventuel) et le dernier mot
|
|
11330
|
-
const text = lastTextNode.textContent;
|
|
11331
|
-
|
|
11332
|
-
const match = text.match(/^([\s\S]*\s)?(\S+)\s*$/m);
|
|
11462
|
+
let linkContent = link.innerHTML;
|
|
11333
11463
|
|
|
11334
|
-
|
|
11335
|
-
|
|
11336
|
-
|
|
11464
|
+
linkContent = `<span class="qc-ext-link-text">${linkContent}</span> ${get(imgElement).outerHTML}`;
|
|
11465
|
+
link.innerHTML = linkContent;
|
|
11466
|
+
processedLinks.add(linkContent);
|
|
11467
|
+
});
|
|
11468
|
+
}
|
|
11337
11469
|
|
|
11338
|
-
|
|
11339
|
-
|
|
11470
|
+
user_effect(() => {
|
|
11471
|
+
if (nestedExternalLinks() || links().length <= 0 || !get(imgElement)) {
|
|
11472
|
+
return;
|
|
11473
|
+
}
|
|
11340
11474
|
|
|
11341
|
-
|
|
11342
|
-
const span = document.createElement('span');
|
|
11475
|
+
isUpdating(true);
|
|
11343
11476
|
|
|
11344
|
-
|
|
11345
|
-
|
|
11346
|
-
span.appendChild(get(imgElement));
|
|
11477
|
+
tick().then(() => {
|
|
11478
|
+
addExternalLinkIcon(links());
|
|
11347
11479
|
|
|
11348
|
-
|
|
11349
|
-
|
|
11350
|
-
|
|
11351
|
-
lastTextNode.parentNode.insertBefore(span, lastTextNode.nextSibling);
|
|
11352
|
-
} else {
|
|
11353
|
-
lastTextNode.parentNode.replaceChild(span, lastTextNode);
|
|
11354
|
-
}
|
|
11480
|
+
return tick();
|
|
11481
|
+
}).then(() => {
|
|
11482
|
+
isUpdating(false);
|
|
11355
11483
|
});
|
|
11356
11484
|
});
|
|
11357
11485
|
|
|
@@ -11369,19 +11497,82 @@
|
|
|
11369
11497
|
flushSync();
|
|
11370
11498
|
},
|
|
11371
11499
|
|
|
11500
|
+
get links() {
|
|
11501
|
+
return links();
|
|
11502
|
+
},
|
|
11503
|
+
|
|
11504
|
+
set links($$value = []) {
|
|
11505
|
+
links($$value);
|
|
11506
|
+
flushSync();
|
|
11507
|
+
},
|
|
11508
|
+
|
|
11509
|
+
get isUpdating() {
|
|
11510
|
+
return isUpdating();
|
|
11511
|
+
},
|
|
11512
|
+
|
|
11513
|
+
set isUpdating($$value = false) {
|
|
11514
|
+
isUpdating($$value);
|
|
11515
|
+
flushSync();
|
|
11516
|
+
},
|
|
11517
|
+
|
|
11518
|
+
get nestedExternalLinks() {
|
|
11519
|
+
return nestedExternalLinks();
|
|
11520
|
+
},
|
|
11521
|
+
|
|
11522
|
+
set nestedExternalLinks($$value = false) {
|
|
11523
|
+
nestedExternalLinks($$value);
|
|
11524
|
+
flushSync();
|
|
11525
|
+
},
|
|
11526
|
+
|
|
11372
11527
|
...legacy_api()
|
|
11373
11528
|
};
|
|
11374
11529
|
|
|
11375
|
-
var
|
|
11530
|
+
var div = root$d();
|
|
11531
|
+
var node = child(div);
|
|
11532
|
+
|
|
11533
|
+
add_svelte_meta(
|
|
11534
|
+
() => Icon(node, {
|
|
11535
|
+
type: 'external-link',
|
|
11536
|
+
|
|
11537
|
+
get alt() {
|
|
11538
|
+
return externalIconAlt();
|
|
11539
|
+
},
|
|
11540
|
+
|
|
11541
|
+
class: 'qc-ext-link-img',
|
|
11542
|
+
|
|
11543
|
+
get rootElement() {
|
|
11544
|
+
return get(imgElement);
|
|
11545
|
+
},
|
|
11546
|
+
|
|
11547
|
+
set rootElement($$value) {
|
|
11548
|
+
set(imgElement, $$value, true);
|
|
11549
|
+
}
|
|
11550
|
+
}),
|
|
11551
|
+
'component',
|
|
11552
|
+
ExternalLink,
|
|
11553
|
+
49,
|
|
11554
|
+
4,
|
|
11555
|
+
{ componentTag: 'Icon' }
|
|
11556
|
+
);
|
|
11376
11557
|
|
|
11377
|
-
|
|
11378
|
-
|
|
11379
|
-
append($$anchor, span_1);
|
|
11558
|
+
reset(div);
|
|
11559
|
+
append($$anchor, div);
|
|
11380
11560
|
|
|
11381
11561
|
return pop($$exports);
|
|
11382
11562
|
}
|
|
11383
11563
|
|
|
11384
|
-
create_custom_element(
|
|
11564
|
+
create_custom_element(
|
|
11565
|
+
ExternalLink,
|
|
11566
|
+
{
|
|
11567
|
+
externalIconAlt: {},
|
|
11568
|
+
links: {},
|
|
11569
|
+
isUpdating: {},
|
|
11570
|
+
nestedExternalLinks: {}
|
|
11571
|
+
},
|
|
11572
|
+
[],
|
|
11573
|
+
[],
|
|
11574
|
+
true
|
|
11575
|
+
);
|
|
11385
11576
|
|
|
11386
11577
|
ExternalLinkWC[FILENAME] = 'src/sdg/components/ExternalLink/ExternalLinkWC.svelte';
|
|
11387
11578
|
|
|
@@ -11390,9 +11581,75 @@
|
|
|
11390
11581
|
push($$props, true);
|
|
11391
11582
|
|
|
11392
11583
|
const props = rest_props($$props, ['$$slots', '$$events', '$$legacy', '$$host']);
|
|
11584
|
+
const nestedExternalLinks = $$props.$$host.querySelector('qc-external-link');
|
|
11585
|
+
let links = tag(state(proxy([])), 'links');
|
|
11586
|
+
const observer = Utils.createMutationObserver($$props.$$host, refreshLinks);
|
|
11587
|
+
let isUpdating = tag(state(false), 'isUpdating');
|
|
11588
|
+
let pendingUpdate = false;
|
|
11589
|
+
|
|
11590
|
+
function queryLinks() {
|
|
11591
|
+
return Array.from($$props.$$host.querySelectorAll('a'));
|
|
11592
|
+
}
|
|
11593
|
+
|
|
11594
|
+
function refreshLinks() {
|
|
11595
|
+
if (get(isUpdating) || pendingUpdate) {
|
|
11596
|
+
return;
|
|
11597
|
+
}
|
|
11598
|
+
|
|
11599
|
+
pendingUpdate = true;
|
|
11600
|
+
|
|
11601
|
+
tick().then(() => {
|
|
11602
|
+
if (get(isUpdating)) {
|
|
11603
|
+
pendingUpdate = false;
|
|
11604
|
+
|
|
11605
|
+
return;
|
|
11606
|
+
}
|
|
11607
|
+
|
|
11608
|
+
set(links, queryLinks(), true);
|
|
11609
|
+
pendingUpdate = false;
|
|
11610
|
+
});
|
|
11611
|
+
}
|
|
11612
|
+
|
|
11613
|
+
onMount(() => {
|
|
11614
|
+
$$props.$$host.classList.add('qc-external-link');
|
|
11615
|
+
set(links, queryLinks(), true);
|
|
11616
|
+
observer?.observe($$props.$$host, { childList: true, characterData: true, subtree: true });
|
|
11617
|
+
});
|
|
11618
|
+
|
|
11619
|
+
onDestroy(() => {
|
|
11620
|
+
observer?.disconnect();
|
|
11621
|
+
});
|
|
11622
|
+
|
|
11393
11623
|
var $$exports = { ...legacy_api() };
|
|
11394
11624
|
|
|
11395
|
-
add_svelte_meta(
|
|
11625
|
+
add_svelte_meta(
|
|
11626
|
+
() => ExternalLink($$anchor, spread_props(
|
|
11627
|
+
{
|
|
11628
|
+
get links() {
|
|
11629
|
+
return get(links);
|
|
11630
|
+
},
|
|
11631
|
+
|
|
11632
|
+
get nestedExternalLinks() {
|
|
11633
|
+
return nestedExternalLinks;
|
|
11634
|
+
}
|
|
11635
|
+
},
|
|
11636
|
+
() => props,
|
|
11637
|
+
{
|
|
11638
|
+
get isUpdating() {
|
|
11639
|
+
return get(isUpdating);
|
|
11640
|
+
},
|
|
11641
|
+
|
|
11642
|
+
set isUpdating($$value) {
|
|
11643
|
+
set(isUpdating, $$value, true);
|
|
11644
|
+
}
|
|
11645
|
+
}
|
|
11646
|
+
)),
|
|
11647
|
+
'component',
|
|
11648
|
+
ExternalLinkWC,
|
|
11649
|
+
58,
|
|
11650
|
+
0,
|
|
11651
|
+
{ componentTag: 'ExternalLink' }
|
|
11652
|
+
);
|
|
11396
11653
|
|
|
11397
11654
|
return pop($$exports);
|
|
11398
11655
|
}
|
|
@@ -12056,8 +12313,8 @@
|
|
|
12056
12313
|
|
|
12057
12314
|
LabelText[FILENAME] = 'src/sdg/components/Label/LabelText.svelte';
|
|
12058
12315
|
|
|
12059
|
-
var root_1$5 = add_locations(from_html(`<span class="qc-required" aria-hidden="true">*</span>`), LabelText[FILENAME], [[
|
|
12060
|
-
var root$a = add_locations(from_html(
|
|
12316
|
+
var root_1$5 = add_locations(from_html(`<span class="qc-required" aria-hidden="true">*</span>`), LabelText[FILENAME], [[5, 61]]);
|
|
12317
|
+
var root$a = add_locations(from_html(`<span class="qc-label-text"><!></span><!>`, 1), LabelText[FILENAME], [[5, 0]]);
|
|
12061
12318
|
|
|
12062
12319
|
function LabelText($$anchor, $$props) {
|
|
12063
12320
|
check_target(new.target);
|
|
@@ -12089,17 +12346,19 @@
|
|
|
12089
12346
|
};
|
|
12090
12347
|
|
|
12091
12348
|
var fragment = root$a();
|
|
12092
|
-
var
|
|
12349
|
+
var span = first_child(fragment);
|
|
12350
|
+
var node = child(span);
|
|
12093
12351
|
|
|
12094
12352
|
html(node, text);
|
|
12353
|
+
reset(span);
|
|
12095
12354
|
|
|
12096
|
-
var node_1 = sibling(
|
|
12355
|
+
var node_1 = sibling(span);
|
|
12097
12356
|
|
|
12098
12357
|
{
|
|
12099
12358
|
var consequent = ($$anchor) => {
|
|
12100
|
-
var
|
|
12359
|
+
var span_1 = root_1$5();
|
|
12101
12360
|
|
|
12102
|
-
append($$anchor,
|
|
12361
|
+
append($$anchor, span_1);
|
|
12103
12362
|
};
|
|
12104
12363
|
|
|
12105
12364
|
add_svelte_meta(
|
|
@@ -12108,8 +12367,8 @@
|
|
|
12108
12367
|
}),
|
|
12109
12368
|
'if',
|
|
12110
12369
|
LabelText,
|
|
12111
|
-
|
|
12112
|
-
|
|
12370
|
+
5,
|
|
12371
|
+
47
|
|
12113
12372
|
);
|
|
12114
12373
|
}
|
|
12115
12374
|
|
|
@@ -12917,8 +13176,8 @@
|
|
|
12917
13176
|
|
|
12918
13177
|
Checkbox[FILENAME] = 'src/sdg/components/Checkbox/Checkbox.svelte';
|
|
12919
13178
|
|
|
12920
|
-
var root_2$4 = add_locations(from_html(`<span class="qc-required" aria-hidden="true">*</span>`), Checkbox[FILENAME], [[
|
|
12921
|
-
var root$8 = add_locations(from_html(`<div><!> <!> <!></div>`), Checkbox[FILENAME], [[
|
|
13179
|
+
var root_2$4 = add_locations(from_html(`<span class="qc-required" aria-hidden="true">*</span>`), Checkbox[FILENAME], [[57, 4]]);
|
|
13180
|
+
var root$8 = add_locations(from_html(`<div><!> <!> <!></div>`), Checkbox[FILENAME], [[65, 4]]);
|
|
12922
13181
|
|
|
12923
13182
|
function Checkbox($$anchor, $$props) {
|
|
12924
13183
|
check_target(new.target);
|
|
@@ -12944,7 +13203,7 @@
|
|
|
12944
13203
|
}),
|
|
12945
13204
|
'if',
|
|
12946
13205
|
Checkbox,
|
|
12947
|
-
|
|
13206
|
+
56,
|
|
12948
13207
|
4
|
|
12949
13208
|
);
|
|
12950
13209
|
}
|
|
@@ -12990,10 +13249,11 @@
|
|
|
12990
13249
|
user_effect((_) => updateChoiceInput(input(), required(), invalid(), compact(), false, false));
|
|
12991
13250
|
|
|
12992
13251
|
user_effect(() => {
|
|
12993
|
-
if (
|
|
12994
|
-
|
|
13252
|
+
if (required() && get(label) && requiredSpan()) {
|
|
13253
|
+
const textSpan = labelElement().querySelector('span');
|
|
12995
13254
|
|
|
12996
|
-
|
|
13255
|
+
textSpan.appendChild(requiredSpan());
|
|
13256
|
+
}
|
|
12997
13257
|
});
|
|
12998
13258
|
|
|
12999
13259
|
var $$exports = {
|
|
@@ -13129,11 +13389,11 @@
|
|
|
13129
13389
|
var div = root$8();
|
|
13130
13390
|
var node_1 = child(div);
|
|
13131
13391
|
|
|
13132
|
-
add_svelte_meta(() => requiredSpanSnippet(node_1), 'render', Checkbox,
|
|
13392
|
+
add_svelte_meta(() => requiredSpanSnippet(node_1), 'render', Checkbox, 72, 8);
|
|
13133
13393
|
|
|
13134
13394
|
var node_2 = sibling(node_1, 2);
|
|
13135
13395
|
|
|
13136
|
-
add_svelte_meta(() => snippet(node_2, () => children() ?? noop), 'render', Checkbox,
|
|
13396
|
+
add_svelte_meta(() => snippet(node_2, () => children() ?? noop), 'render', Checkbox, 73, 8);
|
|
13137
13397
|
|
|
13138
13398
|
var node_3 = sibling(node_2, 2);
|
|
13139
13399
|
|
|
@@ -13153,7 +13413,7 @@
|
|
|
13153
13413
|
}),
|
|
13154
13414
|
'component',
|
|
13155
13415
|
Checkbox,
|
|
13156
|
-
|
|
13416
|
+
74,
|
|
13157
13417
|
8,
|
|
13158
13418
|
{ componentTag: 'FormError' }
|
|
13159
13419
|
);
|
|
@@ -13503,7 +13763,7 @@
|
|
|
13503
13763
|
true
|
|
13504
13764
|
);
|
|
13505
13765
|
|
|
13506
|
-
function onMountInput(input, setTextFieldRow, setValue, setInvalid) {
|
|
13766
|
+
function onMountInput(input, setTextFieldRow, setValue, setInvalid, setRequired) {
|
|
13507
13767
|
if (!input) return;
|
|
13508
13768
|
if (!input.autocomplete) {
|
|
13509
13769
|
input.autocomplete = "off";
|
|
@@ -13512,6 +13772,7 @@
|
|
|
13512
13772
|
input.id = Utils.generateId(input.type);
|
|
13513
13773
|
}
|
|
13514
13774
|
setValue(input.value);
|
|
13775
|
+
setRequired(input.required);
|
|
13515
13776
|
input.addEventListener(
|
|
13516
13777
|
'input',
|
|
13517
13778
|
() => {
|
|
@@ -13523,10 +13784,10 @@
|
|
|
13523
13784
|
|
|
13524
13785
|
TextField[FILENAME] = 'src/sdg/components/TextField/TextField.svelte';
|
|
13525
13786
|
|
|
13526
|
-
var root_3$2 = add_locations(from_html(`<div class="qc-description"><!></div>`), TextField[FILENAME], [[
|
|
13527
|
-
var root_4$1 = add_locations(from_html(`<div aria-live="polite"><!></div>`), TextField[FILENAME], [[
|
|
13787
|
+
var root_3$2 = add_locations(from_html(`<div class="qc-description"><!></div>`), TextField[FILENAME], [[141, 8]]);
|
|
13788
|
+
var root_4$1 = add_locations(from_html(`<div aria-live="polite"><!></div>`), TextField[FILENAME], [[152, 8]]);
|
|
13528
13789
|
var root_1$3 = add_locations(from_html(`<!> <!> <!> <!> <!>`, 1), TextField[FILENAME], []);
|
|
13529
|
-
var root_6 = add_locations(from_html(`<div class="qc-textfield"><!></div>`), TextField[FILENAME], [[
|
|
13790
|
+
var root_6 = add_locations(from_html(`<div class="qc-textfield"><!></div>`), TextField[FILENAME], [[176, 4]]);
|
|
13530
13791
|
|
|
13531
13792
|
function TextField($$anchor, $$props) {
|
|
13532
13793
|
check_target(new.target);
|
|
@@ -13576,7 +13837,7 @@
|
|
|
13576
13837
|
}),
|
|
13577
13838
|
'component',
|
|
13578
13839
|
TextField,
|
|
13579
|
-
|
|
13840
|
+
131,
|
|
13580
13841
|
8,
|
|
13581
13842
|
{ componentTag: 'Label' }
|
|
13582
13843
|
);
|
|
@@ -13589,7 +13850,7 @@
|
|
|
13589
13850
|
}),
|
|
13590
13851
|
'if',
|
|
13591
13852
|
TextField,
|
|
13592
|
-
|
|
13853
|
+
130,
|
|
13593
13854
|
4
|
|
13594
13855
|
);
|
|
13595
13856
|
}
|
|
@@ -13614,14 +13875,14 @@
|
|
|
13614
13875
|
}),
|
|
13615
13876
|
'if',
|
|
13616
13877
|
TextField,
|
|
13617
|
-
|
|
13878
|
+
140,
|
|
13618
13879
|
4
|
|
13619
13880
|
);
|
|
13620
13881
|
}
|
|
13621
13882
|
|
|
13622
13883
|
var node_3 = sibling(node_1, 2);
|
|
13623
13884
|
|
|
13624
|
-
add_svelte_meta(() => snippet(node_3, children), 'render', TextField,
|
|
13885
|
+
add_svelte_meta(() => snippet(node_3, () => children() ?? noop), 'render', TextField, 149, 4);
|
|
13625
13886
|
|
|
13626
13887
|
var node_4 = sibling(node_3, 2);
|
|
13627
13888
|
|
|
@@ -13652,7 +13913,7 @@
|
|
|
13652
13913
|
}),
|
|
13653
13914
|
'if',
|
|
13654
13915
|
TextField,
|
|
13655
|
-
|
|
13916
|
+
151,
|
|
13656
13917
|
4
|
|
13657
13918
|
);
|
|
13658
13919
|
}
|
|
@@ -13699,7 +13960,7 @@
|
|
|
13699
13960
|
}),
|
|
13700
13961
|
'component',
|
|
13701
13962
|
TextField,
|
|
13702
|
-
|
|
13963
|
+
165,
|
|
13703
13964
|
4,
|
|
13704
13965
|
{ componentTag: 'FormError' }
|
|
13705
13966
|
);
|
|
@@ -13736,7 +13997,9 @@
|
|
|
13736
13997
|
textFieldRow = tag(state(void 0), 'textFieldRow'),
|
|
13737
13998
|
defaultInvalidText = tag(
|
|
13738
13999
|
user_derived(() => {
|
|
13739
|
-
if (!maxlengthReached())
|
|
14000
|
+
if (!maxlengthReached()) {
|
|
14001
|
+
return undefined;
|
|
14002
|
+
}
|
|
13740
14003
|
|
|
13741
14004
|
return strict_equals(lang, 'fr')
|
|
13742
14005
|
? `La limite de caractères du champ ${label()} est dépassée.`
|
|
@@ -13749,10 +14012,14 @@
|
|
|
13749
14012
|
if (webComponentMode) return;
|
|
13750
14013
|
|
|
13751
14014
|
if (!input()) {
|
|
13752
|
-
input(get(rootElement)
|
|
14015
|
+
input(get(rootElement)?.querySelector('input,textarea'));
|
|
13753
14016
|
}
|
|
13754
14017
|
|
|
13755
|
-
onMountInput(input(), (textFieldRowParam) => set(textFieldRow, textFieldRowParam, true), (valueParam) => value(valueParam), (invalidParam) => invalid(invalidParam))
|
|
14018
|
+
onMountInput(input(), (textFieldRowParam) => set(textFieldRow, textFieldRowParam, true), (valueParam) => value(valueParam), (invalidParam) => invalid(invalidParam), (requiredParam) => {
|
|
14019
|
+
if (requiredParam) {
|
|
14020
|
+
required(requiredParam);
|
|
14021
|
+
}
|
|
14022
|
+
});
|
|
13756
14023
|
});
|
|
13757
14024
|
|
|
13758
14025
|
user_effect(() => {
|
|
@@ -13985,14 +14252,14 @@
|
|
|
13985
14252
|
|
|
13986
14253
|
{
|
|
13987
14254
|
var consequent_3 = ($$anchor) => {
|
|
13988
|
-
add_svelte_meta(() => textfield($$anchor), 'render', TextField,
|
|
14255
|
+
add_svelte_meta(() => textfield($$anchor), 'render', TextField, 174, 4);
|
|
13989
14256
|
};
|
|
13990
14257
|
|
|
13991
14258
|
var alternate = ($$anchor) => {
|
|
13992
14259
|
var div_2 = root_6();
|
|
13993
14260
|
var node_8 = child(div_2);
|
|
13994
14261
|
|
|
13995
|
-
add_svelte_meta(() => textfield(node_8), 'render', TextField,
|
|
14262
|
+
add_svelte_meta(() => textfield(node_8), 'render', TextField, 181, 8);
|
|
13996
14263
|
reset(div_2);
|
|
13997
14264
|
bind_this(div_2, ($$value) => set(rootElement, $$value), () => get(rootElement));
|
|
13998
14265
|
|
|
@@ -14010,7 +14277,7 @@
|
|
|
14010
14277
|
}),
|
|
14011
14278
|
'if',
|
|
14012
14279
|
TextField,
|
|
14013
|
-
|
|
14280
|
+
173,
|
|
14014
14281
|
0
|
|
14015
14282
|
);
|
|
14016
14283
|
}
|
|
@@ -14048,7 +14315,7 @@
|
|
|
14048
14315
|
|
|
14049
14316
|
TextFieldWC[FILENAME] = 'src/sdg/components/TextField/TextFieldWC.svelte';
|
|
14050
14317
|
|
|
14051
|
-
var root$5 = add_locations(from_html(`<!> <link rel="stylesheet"/>`, 1), TextFieldWC[FILENAME], [[
|
|
14318
|
+
var root$5 = add_locations(from_html(`<!> <link rel="stylesheet"/>`, 1), TextFieldWC[FILENAME], [[112, 0]]);
|
|
14052
14319
|
|
|
14053
14320
|
function TextFieldWC($$anchor, $$props) {
|
|
14054
14321
|
check_target(new.target);
|
|
@@ -14077,8 +14344,20 @@
|
|
|
14077
14344
|
textFieldRow = tag(state(void 0), 'textFieldRow');
|
|
14078
14345
|
|
|
14079
14346
|
onMount(() => {
|
|
14080
|
-
|
|
14081
|
-
|
|
14347
|
+
const initialLabelElement = $$props.$$host?.querySelector('label');
|
|
14348
|
+
|
|
14349
|
+
if (initialLabelElement) {
|
|
14350
|
+
label(initialLabelElement.innerHTML);
|
|
14351
|
+
initialLabelElement.remove();
|
|
14352
|
+
}
|
|
14353
|
+
|
|
14354
|
+
set(input, $$props.$$host?.querySelector('input,textarea'), true);
|
|
14355
|
+
|
|
14356
|
+
onMountInput(get(input), (textFieldRowParam) => set(textFieldRow, textFieldRowParam, true), (valueParam) => set(value, valueParam, true), (invalidParam) => invalid(invalidParam), (requiredParam) => {
|
|
14357
|
+
if (requiredParam) {
|
|
14358
|
+
required(requiredParam);
|
|
14359
|
+
}
|
|
14360
|
+
});
|
|
14082
14361
|
});
|
|
14083
14362
|
|
|
14084
14363
|
user_effect(() => {
|
|
@@ -14090,10 +14369,6 @@
|
|
|
14090
14369
|
user_effect(() => {
|
|
14091
14370
|
if (!get(input)) return;
|
|
14092
14371
|
|
|
14093
|
-
if (label()) {
|
|
14094
|
-
get(input).before(get(labelElement));
|
|
14095
|
-
}
|
|
14096
|
-
|
|
14097
14372
|
if (description()) {
|
|
14098
14373
|
get(input).before(get(descriptionElement));
|
|
14099
14374
|
}
|
|
@@ -14109,7 +14384,11 @@
|
|
|
14109
14384
|
if (get(textFieldRow)) {
|
|
14110
14385
|
get(textFieldRow).appendChild(get(formErrorElement));
|
|
14111
14386
|
} else {
|
|
14112
|
-
|
|
14387
|
+
if (get(maxlengthElement)) {
|
|
14388
|
+
get(maxlengthElement).after(get(formErrorElement));
|
|
14389
|
+
} else {
|
|
14390
|
+
get(input).after(get(formErrorElement));
|
|
14391
|
+
}
|
|
14113
14392
|
}
|
|
14114
14393
|
});
|
|
14115
14394
|
|
|
@@ -14318,7 +14597,7 @@
|
|
|
14318
14597
|
}),
|
|
14319
14598
|
'component',
|
|
14320
14599
|
TextFieldWC,
|
|
14321
|
-
|
|
14600
|
+
92,
|
|
14322
14601
|
0,
|
|
14323
14602
|
{ componentTag: 'TextField' }
|
|
14324
14603
|
);
|
|
@@ -14854,9 +15133,9 @@
|
|
|
14854
15133
|
|
|
14855
15134
|
DropdownListItemsSingle[FILENAME] = 'src/sdg/components/DropdownList/DropdownListItems/DropdownListItemsSingle/DropdownListItemsSingle.svelte';
|
|
14856
15135
|
|
|
14857
|
-
var root_3$1 = add_locations(from_html(`<span class="qc-sr-only"><!></span>`), DropdownListItemsSingle[FILENAME], [[
|
|
14858
|
-
var root_2$3 = add_locations(from_html(`<li tabindex="0" role="option"><!></li>`), DropdownListItemsSingle[FILENAME], [[
|
|
14859
|
-
var root_1$2 = add_locations(from_html(`<ul></ul>`), DropdownListItemsSingle[FILENAME], [[
|
|
15136
|
+
var root_3$1 = add_locations(from_html(`<span class="qc-sr-only"><!></span>`), DropdownListItemsSingle[FILENAME], [[130, 20]]);
|
|
15137
|
+
var root_2$3 = add_locations(from_html(`<li tabindex="0" role="option"><!></li>`), DropdownListItemsSingle[FILENAME], [[114, 12]]);
|
|
15138
|
+
var root_1$2 = add_locations(from_html(`<ul></ul>`), DropdownListItemsSingle[FILENAME], [[112, 4]]);
|
|
14860
15139
|
|
|
14861
15140
|
function DropdownListItemsSingle($$anchor, $$props) {
|
|
14862
15141
|
check_target(new.target);
|
|
@@ -14900,7 +15179,7 @@
|
|
|
14900
15179
|
event.preventDefault();
|
|
14901
15180
|
|
|
14902
15181
|
if (!item.disabled) {
|
|
14903
|
-
items().forEach((item) => assign(item, 'checked', false, 'src/sdg/components/DropdownList/DropdownListItems/DropdownListItemsSingle/DropdownListItemsSingle.svelte:
|
|
15182
|
+
items().forEach((item) => assign(item, 'checked', false, 'src/sdg/components/DropdownList/DropdownListItems/DropdownListItemsSingle/DropdownListItemsSingle.svelte:46:34'));
|
|
14904
15183
|
items().find((option) => strict_equals(option.value, item.value)).checked = true;
|
|
14905
15184
|
selectionCallback()();
|
|
14906
15185
|
}
|
|
@@ -14935,7 +15214,7 @@
|
|
|
14935
15214
|
handleSelection(event, item);
|
|
14936
15215
|
}
|
|
14937
15216
|
|
|
14938
|
-
|
|
15217
|
+
tick().then(() => {
|
|
14939
15218
|
if (canExit(event, index)) {
|
|
14940
15219
|
handleExit()(event.key);
|
|
14941
15220
|
}
|
|
@@ -15087,13 +15366,13 @@
|
|
|
15087
15366
|
}),
|
|
15088
15367
|
'if',
|
|
15089
15368
|
DropdownListItemsSingle,
|
|
15090
|
-
|
|
15369
|
+
129,
|
|
15091
15370
|
16
|
|
15092
15371
|
);
|
|
15093
15372
|
}
|
|
15094
15373
|
|
|
15095
15374
|
reset(li);
|
|
15096
|
-
validate_binding('bind:this={displayedItemsElements[index]}', [], () => get(displayedItemsElements), () => get(index),
|
|
15375
|
+
validate_binding('bind:this={displayedItemsElements[index]}', [], () => get(displayedItemsElements), () => get(index), 115, 16);
|
|
15097
15376
|
bind_this(li, ($$value, index) => get(displayedItemsElements)[index] = $$value, (index) => get(displayedItemsElements)?.[index], () => [get(index)]);
|
|
15098
15377
|
|
|
15099
15378
|
template_effect(() => {
|
|
@@ -15113,7 +15392,7 @@
|
|
|
15113
15392
|
}),
|
|
15114
15393
|
'each',
|
|
15115
15394
|
DropdownListItemsSingle,
|
|
15116
|
-
|
|
15395
|
+
113,
|
|
15117
15396
|
8
|
|
15118
15397
|
);
|
|
15119
15398
|
|
|
@@ -15127,7 +15406,7 @@
|
|
|
15127
15406
|
}),
|
|
15128
15407
|
'if',
|
|
15129
15408
|
DropdownListItemsSingle,
|
|
15130
|
-
|
|
15409
|
+
111,
|
|
15131
15410
|
0
|
|
15132
15411
|
);
|
|
15133
15412
|
}
|
|
@@ -15161,8 +15440,8 @@
|
|
|
15161
15440
|
|
|
15162
15441
|
DropdownListItemsMultiple[FILENAME] = 'src/sdg/components/DropdownList/DropdownListItems/DropdownListItemsMultiple/DropdownListItemsMultiple.svelte';
|
|
15163
15442
|
|
|
15164
|
-
var root_2$2 = add_locations(from_html(`<li><label class="qc-choicefield-label" compact=""><input type="checkbox" class="qc-choicefield qc-compact"/> <span> </span></label></li>`), DropdownListItemsMultiple[FILENAME], [[
|
|
15165
|
-
var root_1$1 = add_locations(from_html(`<ul></ul>`), DropdownListItemsMultiple[FILENAME], [[
|
|
15443
|
+
var root_2$2 = add_locations(from_html(`<li><label class="qc-choicefield-label" compact=""><input type="checkbox" class="qc-choicefield qc-compact"/> <span> </span></label></li>`), DropdownListItemsMultiple[FILENAME], [[154, 12, [[164, 16, [[169, 20], [181, 20]]]]]]);
|
|
15444
|
+
var root_1$1 = add_locations(from_html(`<ul></ul>`), DropdownListItemsMultiple[FILENAME], [[148, 4]]);
|
|
15166
15445
|
|
|
15167
15446
|
function DropdownListItemsMultiple($$anchor, $$props) {
|
|
15168
15447
|
check_target(new.target);
|
|
@@ -15248,11 +15527,11 @@
|
|
|
15248
15527
|
|
|
15249
15528
|
if (displayedItems().length > 0 && !displayedItems()[index].disabled) {
|
|
15250
15529
|
event.target.checked = !event.target.checked;
|
|
15251
|
-
$$ownership_validator.mutation('displayedItems', ['displayedItems', index, 'checked'], displayedItems()[index].checked = event.target.checked,
|
|
15530
|
+
$$ownership_validator.mutation('displayedItems', ['displayedItems', index, 'checked'], displayedItems()[index].checked = event.target.checked, 87, 16);
|
|
15252
15531
|
}
|
|
15253
15532
|
}
|
|
15254
15533
|
|
|
15255
|
-
|
|
15534
|
+
tick().then(() => {
|
|
15256
15535
|
if (canExit(event, index)) {
|
|
15257
15536
|
handleExit()(event.key);
|
|
15258
15537
|
}
|
|
@@ -15392,8 +15671,8 @@
|
|
|
15392
15671
|
remove_input_defaults(input);
|
|
15393
15672
|
input.__change = handleChange;
|
|
15394
15673
|
input.__keydown = (e) => handleKeyDown(e, get(index));
|
|
15395
|
-
validate_binding('bind:checked={item.checked}', [], () => get(item), () => 'checked',
|
|
15396
|
-
validate_binding('bind:this={displayedItemsElements[index]}', [], () => get(displayedItemsElements), () => get(index),
|
|
15674
|
+
validate_binding('bind:checked={item.checked}', [], () => get(item), () => 'checked', 176, 28);
|
|
15675
|
+
validate_binding('bind:this={displayedItemsElements[index]}', [], () => get(displayedItemsElements), () => get(index), 177, 28);
|
|
15397
15676
|
bind_this(input, ($$value, index) => get(displayedItemsElements)[index] = $$value, (index) => get(displayedItemsElements)?.[index], () => [get(index)]);
|
|
15398
15677
|
|
|
15399
15678
|
var input_value;
|
|
@@ -15428,7 +15707,7 @@
|
|
|
15428
15707
|
}),
|
|
15429
15708
|
'each',
|
|
15430
15709
|
DropdownListItemsMultiple,
|
|
15431
|
-
|
|
15710
|
+
149,
|
|
15432
15711
|
8
|
|
15433
15712
|
);
|
|
15434
15713
|
|
|
@@ -15442,7 +15721,7 @@
|
|
|
15442
15721
|
}),
|
|
15443
15722
|
'if',
|
|
15444
15723
|
DropdownListItemsMultiple,
|
|
15445
|
-
|
|
15724
|
+
147,
|
|
15446
15725
|
0
|
|
15447
15726
|
);
|
|
15448
15727
|
}
|
|
@@ -15474,15 +15753,14 @@
|
|
|
15474
15753
|
|
|
15475
15754
|
DropdownListItems[FILENAME] = 'src/sdg/components/DropdownList/DropdownListItems/DropdownListItems.svelte';
|
|
15476
15755
|
|
|
15477
|
-
var root_4 = add_locations(from_html(`<span class="qc-dropdown-list-no-options"><!></span>`), DropdownListItems[FILENAME], [[
|
|
15478
|
-
var root$3 = add_locations(from_html(`<div class="qc-dropdown-list-items" tabindex="-1"><!> <div class="qc-dropdown-list-no-options-container" role="status"><!></div></div>`), DropdownListItems[FILENAME], [[
|
|
15756
|
+
var root_4 = add_locations(from_html(`<span class="qc-dropdown-list-no-options"><!></span>`), DropdownListItems[FILENAME], [[82, 16]]);
|
|
15757
|
+
var root$3 = add_locations(from_html(`<div class="qc-dropdown-list-items" tabindex="-1"><!> <div class="qc-dropdown-list-no-options-container" role="status"><!></div></div>`), DropdownListItems[FILENAME], [[45, 0, [[79, 4]]]]);
|
|
15479
15758
|
|
|
15480
15759
|
function DropdownListItems($$anchor, $$props) {
|
|
15481
15760
|
check_target(new.target);
|
|
15482
15761
|
push($$props, true);
|
|
15483
15762
|
|
|
15484
15763
|
let id = prop($$props, 'id', 7),
|
|
15485
|
-
enableSearch = prop($$props, 'enableSearch', 7),
|
|
15486
15764
|
multiple = prop($$props, 'multiple', 7),
|
|
15487
15765
|
items = prop($$props, 'items', 7),
|
|
15488
15766
|
displayedItems = prop($$props, 'displayedItems', 7),
|
|
@@ -15497,43 +15775,21 @@
|
|
|
15497
15775
|
|
|
15498
15776
|
let itemsComponent = tag(state(void 0), 'itemsComponent');
|
|
15499
15777
|
|
|
15500
|
-
let usedHeight = tag(
|
|
15501
|
-
user_derived(() => {
|
|
15502
|
-
const maxItemsHeight = 336;
|
|
15503
|
-
const searchInputTotalHeight = 56;
|
|
15504
|
-
|
|
15505
|
-
if (enableSearch()) {
|
|
15506
|
-
if (displayedItems().length > 7) {
|
|
15507
|
-
return maxItemsHeight - searchInputTotalHeight - 17;
|
|
15508
|
-
}
|
|
15509
|
-
|
|
15510
|
-
return maxItemsHeight - searchInputTotalHeight;
|
|
15511
|
-
} else {
|
|
15512
|
-
if (displayedItems().length > 8) {
|
|
15513
|
-
return maxItemsHeight - 33;
|
|
15514
|
-
}
|
|
15515
|
-
|
|
15516
|
-
return maxItemsHeight;
|
|
15517
|
-
}
|
|
15518
|
-
}),
|
|
15519
|
-
'usedHeight'
|
|
15520
|
-
);
|
|
15521
|
-
|
|
15522
15778
|
function focus() {
|
|
15523
|
-
|
|
15779
|
+
tick().then(() => {
|
|
15524
15780
|
get(itemsComponent)?.focusOnFirstElement();
|
|
15525
15781
|
}).catch(console.error);
|
|
15526
15782
|
}
|
|
15527
15783
|
|
|
15528
15784
|
function focusOnLastElement() {
|
|
15529
|
-
|
|
15785
|
+
tick().then(() => {
|
|
15530
15786
|
get(itemsComponent)?.focusOnLastElement();
|
|
15531
15787
|
}).catch(console.error);
|
|
15532
15788
|
}
|
|
15533
15789
|
|
|
15534
15790
|
function focusOnFirstMatchingElement(value) {
|
|
15535
15791
|
if (get(itemsComponent) && value && value.length > 0) {
|
|
15536
|
-
|
|
15792
|
+
tick().then(() => {
|
|
15537
15793
|
get(itemsComponent)?.focusOnFirstMatchingElement(value);
|
|
15538
15794
|
}).catch(console.error);
|
|
15539
15795
|
}
|
|
@@ -15561,15 +15817,6 @@
|
|
|
15561
15817
|
flushSync();
|
|
15562
15818
|
},
|
|
15563
15819
|
|
|
15564
|
-
get enableSearch() {
|
|
15565
|
-
return enableSearch();
|
|
15566
|
-
},
|
|
15567
|
-
|
|
15568
|
-
set enableSearch($$value) {
|
|
15569
|
-
enableSearch($$value);
|
|
15570
|
-
flushSync();
|
|
15571
|
-
},
|
|
15572
|
-
|
|
15573
15820
|
get multiple() {
|
|
15574
15821
|
return multiple();
|
|
15575
15822
|
},
|
|
@@ -15711,7 +15958,7 @@
|
|
|
15711
15958
|
),
|
|
15712
15959
|
'component',
|
|
15713
15960
|
DropdownListItems,
|
|
15714
|
-
|
|
15961
|
+
51,
|
|
15715
15962
|
8,
|
|
15716
15963
|
{ componentTag: 'DropdownListItemsMultiple' }
|
|
15717
15964
|
);
|
|
@@ -15756,7 +16003,7 @@
|
|
|
15756
16003
|
),
|
|
15757
16004
|
'component',
|
|
15758
16005
|
DropdownListItems,
|
|
15759
|
-
|
|
16006
|
+
64,
|
|
15760
16007
|
8,
|
|
15761
16008
|
{ componentTag: 'DropdownListItemsSingle' }
|
|
15762
16009
|
);
|
|
@@ -15768,7 +16015,7 @@
|
|
|
15768
16015
|
}),
|
|
15769
16016
|
'if',
|
|
15770
16017
|
DropdownListItems,
|
|
15771
|
-
|
|
16018
|
+
50,
|
|
15772
16019
|
4
|
|
15773
16020
|
);
|
|
15774
16021
|
}
|
|
@@ -15792,7 +16039,7 @@
|
|
|
15792
16039
|
}),
|
|
15793
16040
|
'await',
|
|
15794
16041
|
DropdownListItems,
|
|
15795
|
-
|
|
16042
|
+
81,
|
|
15796
16043
|
12
|
|
15797
16044
|
);
|
|
15798
16045
|
|
|
@@ -15805,19 +16052,14 @@
|
|
|
15805
16052
|
}),
|
|
15806
16053
|
'if',
|
|
15807
16054
|
DropdownListItems,
|
|
15808
|
-
|
|
16055
|
+
80,
|
|
15809
16056
|
8
|
|
15810
16057
|
);
|
|
15811
16058
|
}
|
|
15812
16059
|
|
|
15813
16060
|
reset(div_1);
|
|
15814
16061
|
reset(div);
|
|
15815
|
-
|
|
15816
|
-
template_effect(() => {
|
|
15817
|
-
set_attribute(div, 'id', id());
|
|
15818
|
-
set_style(div, `--dropdown-items-height: ${get(usedHeight) ?? ''};`);
|
|
15819
|
-
});
|
|
15820
|
-
|
|
16062
|
+
template_effect(() => set_attribute(div, 'id', id()));
|
|
15821
16063
|
append($$anchor, div);
|
|
15822
16064
|
|
|
15823
16065
|
return pop($$exports);
|
|
@@ -15827,7 +16069,6 @@
|
|
|
15827
16069
|
DropdownListItems,
|
|
15828
16070
|
{
|
|
15829
16071
|
id: {},
|
|
15830
|
-
enableSearch: {},
|
|
15831
16072
|
multiple: {},
|
|
15832
16073
|
items: {},
|
|
15833
16074
|
displayedItems: {},
|
|
@@ -15847,9 +16088,9 @@
|
|
|
15847
16088
|
|
|
15848
16089
|
DropdownListButton[FILENAME] = 'src/sdg/components/DropdownList/DropdownListButton/DropdownListButton.svelte';
|
|
15849
16090
|
|
|
15850
|
-
var root_1 = add_locations(from_html(`<span class="qc-dropdown-choice"><!></span>`), DropdownListButton[FILENAME], [[
|
|
15851
|
-
var root_2$1 = add_locations(from_html(`<span class="qc-dropdown-placeholder"><!></span>`), DropdownListButton[FILENAME], [[
|
|
15852
|
-
var root$2 = add_locations(from_html(`<button><!> <span><!></span></button>`), DropdownListButton[FILENAME], [[
|
|
16091
|
+
var root_1 = add_locations(from_html(`<span class="qc-dropdown-choice"><!></span>`), DropdownListButton[FILENAME], [[25, 8]]);
|
|
16092
|
+
var root_2$1 = add_locations(from_html(`<span class="qc-dropdown-placeholder"><!></span>`), DropdownListButton[FILENAME], [[27, 8]]);
|
|
16093
|
+
var root$2 = add_locations(from_html(`<button><!> <span><!></span></button>`), DropdownListButton[FILENAME], [[15, 0, [[30, 4]]]]);
|
|
15853
16094
|
|
|
15854
16095
|
function DropdownListButton($$anchor, $$props) {
|
|
15855
16096
|
check_target(new.target);
|
|
@@ -15860,6 +16101,7 @@
|
|
|
15860
16101
|
disabled = prop($$props, 'disabled', 7),
|
|
15861
16102
|
selectedOptionsText = prop($$props, 'selectedOptionsText', 7, ""),
|
|
15862
16103
|
placeholder = prop($$props, 'placeholder', 7),
|
|
16104
|
+
buttonElement = prop($$props, 'buttonElement', 15),
|
|
15863
16105
|
rest = rest_props(
|
|
15864
16106
|
$$props,
|
|
15865
16107
|
[
|
|
@@ -15871,20 +16113,11 @@
|
|
|
15871
16113
|
'expanded',
|
|
15872
16114
|
'disabled',
|
|
15873
16115
|
'selectedOptionsText',
|
|
15874
|
-
'placeholder'
|
|
16116
|
+
'placeholder',
|
|
16117
|
+
'buttonElement'
|
|
15875
16118
|
]);
|
|
15876
16119
|
|
|
15877
|
-
let button;
|
|
15878
|
-
|
|
15879
|
-
function focus() {
|
|
15880
|
-
button?.focus();
|
|
15881
|
-
}
|
|
15882
|
-
|
|
15883
16120
|
var $$exports = {
|
|
15884
|
-
get focus() {
|
|
15885
|
-
return focus;
|
|
15886
|
-
},
|
|
15887
|
-
|
|
15888
16121
|
get inputId() {
|
|
15889
16122
|
return inputId();
|
|
15890
16123
|
},
|
|
@@ -15930,12 +16163,21 @@
|
|
|
15930
16163
|
flushSync();
|
|
15931
16164
|
},
|
|
15932
16165
|
|
|
16166
|
+
get buttonElement() {
|
|
16167
|
+
return buttonElement();
|
|
16168
|
+
},
|
|
16169
|
+
|
|
16170
|
+
set buttonElement($$value) {
|
|
16171
|
+
buttonElement($$value);
|
|
16172
|
+
flushSync();
|
|
16173
|
+
},
|
|
16174
|
+
|
|
15933
16175
|
...legacy_api()
|
|
15934
16176
|
};
|
|
15935
16177
|
|
|
15936
|
-
var
|
|
16178
|
+
var button = root$2();
|
|
15937
16179
|
|
|
15938
|
-
attribute_effect(
|
|
16180
|
+
attribute_effect(button, () => ({
|
|
15939
16181
|
type: 'button',
|
|
15940
16182
|
id: inputId(),
|
|
15941
16183
|
disabled: disabled(),
|
|
@@ -15944,7 +16186,7 @@
|
|
|
15944
16186
|
...rest
|
|
15945
16187
|
}));
|
|
15946
16188
|
|
|
15947
|
-
var node = child(
|
|
16189
|
+
var node = child(button);
|
|
15948
16190
|
|
|
15949
16191
|
{
|
|
15950
16192
|
var consequent = ($$anchor) => {
|
|
@@ -15971,7 +16213,7 @@
|
|
|
15971
16213
|
}),
|
|
15972
16214
|
'if',
|
|
15973
16215
|
DropdownListButton,
|
|
15974
|
-
|
|
16216
|
+
24,
|
|
15975
16217
|
4
|
|
15976
16218
|
);
|
|
15977
16219
|
}
|
|
@@ -16002,16 +16244,16 @@
|
|
|
16002
16244
|
}),
|
|
16003
16245
|
'component',
|
|
16004
16246
|
DropdownListButton,
|
|
16005
|
-
|
|
16247
|
+
31,
|
|
16006
16248
|
8,
|
|
16007
16249
|
{ componentTag: 'Icon' }
|
|
16008
16250
|
);
|
|
16009
16251
|
}
|
|
16010
16252
|
|
|
16011
16253
|
reset(span_2);
|
|
16012
|
-
reset(
|
|
16013
|
-
bind_this(
|
|
16014
|
-
append($$anchor,
|
|
16254
|
+
reset(button);
|
|
16255
|
+
bind_this(button, ($$value) => buttonElement($$value), () => buttonElement());
|
|
16256
|
+
append($$anchor, button);
|
|
16015
16257
|
|
|
16016
16258
|
return pop($$exports);
|
|
16017
16259
|
}
|
|
@@ -16023,18 +16265,19 @@
|
|
|
16023
16265
|
expanded: {},
|
|
16024
16266
|
disabled: {},
|
|
16025
16267
|
selectedOptionsText: {},
|
|
16026
|
-
placeholder: {}
|
|
16268
|
+
placeholder: {},
|
|
16269
|
+
buttonElement: {}
|
|
16027
16270
|
},
|
|
16028
16271
|
[],
|
|
16029
|
-
[
|
|
16272
|
+
[],
|
|
16030
16273
|
true
|
|
16031
16274
|
);
|
|
16032
16275
|
|
|
16033
16276
|
DropdownList[FILENAME] = 'src/sdg/components/DropdownList/DropdownList.svelte';
|
|
16034
16277
|
|
|
16035
|
-
var root_2 = add_locations(from_html(`<div class="qc-dropdown-list-search"><!></div>`), DropdownList[FILENAME], [[
|
|
16036
|
-
var root_3 = add_locations(from_html(`<span> </span>`), DropdownList[FILENAME], [[
|
|
16037
|
-
var root$1 = add_locations(from_html(`<div><div><!> <div tabindex="-1"><!> <div class="qc-dropdown-list-expanded" tabindex="-1" role="listbox"><!> <!> <div role="status" class="qc-sr-only"><!></div></div></div></div> <!></div>`), DropdownList[FILENAME], [[
|
|
16278
|
+
var root_2 = add_locations(from_html(`<div class="qc-dropdown-list-search"><!></div>`), DropdownList[FILENAME], [[386, 20]]);
|
|
16279
|
+
var root_3 = add_locations(from_html(`<span> </span>`), DropdownList[FILENAME], [[427, 24]]);
|
|
16280
|
+
var root$1 = add_locations(from_html(`<div><div><!> <div tabindex="-1"><!> <div class="qc-dropdown-list-expanded" tabindex="-1" role="listbox"><!> <!> <div role="status" class="qc-sr-only"><!></div></div></div></div> <!></div>`), DropdownList[FILENAME], [[316, 0, [[321, 4, [[340, 8, [[369, 12, [[425, 16]]]]]]]]]]);
|
|
16038
16281
|
|
|
16039
16282
|
function DropdownList($$anchor, $$props) {
|
|
16040
16283
|
check_target(new.target);
|
|
@@ -16060,7 +16303,8 @@
|
|
|
16060
16303
|
multiple = prop($$props, 'multiple', 7, false),
|
|
16061
16304
|
rootElement = prop($$props, 'rootElement', 15),
|
|
16062
16305
|
errorElement = prop($$props, 'errorElement', 15),
|
|
16063
|
-
webComponentMode = prop($$props, 'webComponentMode', 7, false)
|
|
16306
|
+
webComponentMode = prop($$props, 'webComponentMode', 7, false),
|
|
16307
|
+
expanded = prop($$props, 'expanded', 15, false);
|
|
16064
16308
|
|
|
16065
16309
|
const defaultPlaceholder = strict_equals(lang, "fr") ? "Faire une sélection" : "Select an option",
|
|
16066
16310
|
inputId = `${id()}-input`,
|
|
@@ -16068,12 +16312,14 @@
|
|
|
16068
16312
|
itemsId = `${id()}-items`,
|
|
16069
16313
|
labelId = `${id()}-label`,
|
|
16070
16314
|
errorId = `${id()}-error`,
|
|
16071
|
-
availableWidths = ["xs", "sm", "md", "lg", "xl"]
|
|
16315
|
+
availableWidths = ["xs", "sm", "md", "lg", "xl"],
|
|
16316
|
+
buttonHeight = 40;
|
|
16072
16317
|
|
|
16073
16318
|
let instance = tag(state(void 0), 'instance'),
|
|
16074
16319
|
parentRow = tag(user_derived(() => get(instance)?.closest(".qc-formfield-row")), 'parentRow'),
|
|
16075
16320
|
button = tag(state(void 0), 'button'),
|
|
16076
16321
|
searchInput = tag(state(void 0), 'searchInput'),
|
|
16322
|
+
popup = tag(state(void 0), 'popup'),
|
|
16077
16323
|
dropdownItems = tag(state(void 0), 'dropdownItems'),
|
|
16078
16324
|
selectedItems = tag(user_derived(() => items().filter((item) => item.checked) ?? []), 'selectedItems'),
|
|
16079
16325
|
selectedOptionsText = tag(
|
|
@@ -16099,7 +16345,6 @@
|
|
|
16099
16345
|
'selectedOptionsText'
|
|
16100
16346
|
),
|
|
16101
16347
|
previousValue = tag(state(proxy(value())), 'previousValue'),
|
|
16102
|
-
expanded = tag(state(false), 'expanded'),
|
|
16103
16348
|
searchText = tag(state(""), 'searchText'),
|
|
16104
16349
|
hiddenSearchText = tag(state(""), 'hiddenSearchText'),
|
|
16105
16350
|
displayedItems = tag(state(proxy(items())), 'displayedItems'),
|
|
@@ -16116,8 +16361,6 @@
|
|
|
16116
16361
|
),
|
|
16117
16362
|
widthClass = tag(
|
|
16118
16363
|
user_derived(() => {
|
|
16119
|
-
webComponentMode() ? "container" : "root";
|
|
16120
|
-
|
|
16121
16364
|
if (availableWidths.includes(width())) {
|
|
16122
16365
|
return `qc-dropdown-list-${width()}`;
|
|
16123
16366
|
}
|
|
@@ -16139,7 +16382,32 @@
|
|
|
16139
16382
|
return "";
|
|
16140
16383
|
}),
|
|
16141
16384
|
'srItemsCountText'
|
|
16142
|
-
)
|
|
16385
|
+
),
|
|
16386
|
+
buttonElementYPosition = tag(state(0), 'buttonElementYPosition'),
|
|
16387
|
+
usedHeight = tag(
|
|
16388
|
+
user_derived(() => {
|
|
16389
|
+
const maxItemsHeight = 336;
|
|
16390
|
+
const searchInputTotalHeight = 56;
|
|
16391
|
+
|
|
16392
|
+
if (enableSearch()) {
|
|
16393
|
+
if (get(displayedItems).length > 7) {
|
|
16394
|
+
return maxItemsHeight - searchInputTotalHeight - 17;
|
|
16395
|
+
}
|
|
16396
|
+
|
|
16397
|
+
return maxItemsHeight - searchInputTotalHeight;
|
|
16398
|
+
} else {
|
|
16399
|
+
if (get(displayedItems).length > 8) {
|
|
16400
|
+
return maxItemsHeight - 33;
|
|
16401
|
+
}
|
|
16402
|
+
|
|
16403
|
+
return maxItemsHeight;
|
|
16404
|
+
}
|
|
16405
|
+
}),
|
|
16406
|
+
'usedHeight'
|
|
16407
|
+
),
|
|
16408
|
+
topOffset = tag(state(0), 'topOffset'),
|
|
16409
|
+
popupTopBorderThickness = tag(user_derived(() => get(topOffset) && get(topOffset) < 0 ? 1 : 0), 'popupTopBorderThickness'),
|
|
16410
|
+
popupBottomBorderThickness = tag(user_derived(() => get(topOffset) && get(topOffset) >= 0 ? 1 : 0), 'popupBottomBorderThickness');
|
|
16143
16411
|
|
|
16144
16412
|
function focusOnSelectedOption(value) {
|
|
16145
16413
|
if (get(displayedItems).length > 0) {
|
|
@@ -16153,28 +16421,28 @@
|
|
|
16153
16421
|
|
|
16154
16422
|
function handleDropdownButtonClick(event) {
|
|
16155
16423
|
event.preventDefault();
|
|
16156
|
-
|
|
16424
|
+
expanded(!expanded());
|
|
16157
16425
|
}
|
|
16158
16426
|
|
|
16159
16427
|
function handleOuterEvent() {
|
|
16160
16428
|
if (!Utils.componentIsActive(get(instance))) {
|
|
16161
|
-
|
|
16429
|
+
expanded(false);
|
|
16162
16430
|
}
|
|
16163
16431
|
}
|
|
16164
16432
|
|
|
16165
16433
|
function handleTab(event) {
|
|
16166
16434
|
// Le changement de focus a lieu après le lancement de l'événement clavier.
|
|
16167
16435
|
// Il faut donc faire un court sleep pour avoir le nouvel élément en focus.
|
|
16168
|
-
|
|
16436
|
+
tick().then(() => {
|
|
16169
16437
|
if (strict_equals(event.key, "Tab") && !Utils.componentIsActive(get(instance))) {
|
|
16170
|
-
|
|
16438
|
+
expanded(false);
|
|
16171
16439
|
}
|
|
16172
16440
|
}).catch(console.error);
|
|
16173
16441
|
}
|
|
16174
16442
|
|
|
16175
16443
|
function handleEscape(event) {
|
|
16176
16444
|
if (strict_equals(event.key, "Escape")) {
|
|
16177
|
-
|
|
16445
|
+
expanded(false);
|
|
16178
16446
|
}
|
|
16179
16447
|
}
|
|
16180
16448
|
|
|
@@ -16188,7 +16456,7 @@
|
|
|
16188
16456
|
function handleArrowDown(event, targetComponent) {
|
|
16189
16457
|
if (strict_equals(event.key, "ArrowDown") && targetComponent) {
|
|
16190
16458
|
event.preventDefault();
|
|
16191
|
-
|
|
16459
|
+
expanded(true);
|
|
16192
16460
|
targetComponent.focus();
|
|
16193
16461
|
}
|
|
16194
16462
|
}
|
|
@@ -16200,10 +16468,10 @@
|
|
|
16200
16468
|
if (strict_equals(event.key, "ArrowDown")) {
|
|
16201
16469
|
event.preventDefault();
|
|
16202
16470
|
|
|
16203
|
-
if (
|
|
16471
|
+
if (expanded()) {
|
|
16204
16472
|
targetComponent.focus();
|
|
16205
16473
|
} else {
|
|
16206
|
-
|
|
16474
|
+
expanded(true);
|
|
16207
16475
|
focusOnSelectedOption(value());
|
|
16208
16476
|
}
|
|
16209
16477
|
}
|
|
@@ -16211,7 +16479,7 @@
|
|
|
16211
16479
|
if (strict_equals(event.key, "ArrowUp")) {
|
|
16212
16480
|
event.preventDefault();
|
|
16213
16481
|
|
|
16214
|
-
if (
|
|
16482
|
+
if (expanded()) {
|
|
16215
16483
|
get(dropdownItems)?.focusOnLastElement();
|
|
16216
16484
|
}
|
|
16217
16485
|
}
|
|
@@ -16223,7 +16491,7 @@
|
|
|
16223
16491
|
} else {
|
|
16224
16492
|
set(hiddenSearchText, get(hiddenSearchText) + event.key);
|
|
16225
16493
|
|
|
16226
|
-
if (get(hiddenSearchText).length > 0 &&
|
|
16494
|
+
if (get(hiddenSearchText).length > 0 && expanded()) {
|
|
16227
16495
|
get(dropdownItems)?.focusOnFirstMatchingElement(get(hiddenSearchText));
|
|
16228
16496
|
}
|
|
16229
16497
|
}
|
|
@@ -16238,7 +16506,7 @@
|
|
|
16238
16506
|
}
|
|
16239
16507
|
|
|
16240
16508
|
function closeDropdown(key) {
|
|
16241
|
-
|
|
16509
|
+
expanded(false);
|
|
16242
16510
|
set(hiddenSearchText, "");
|
|
16243
16511
|
|
|
16244
16512
|
if (strict_equals(key, "Escape") && get(button)) {
|
|
@@ -16264,12 +16532,13 @@
|
|
|
16264
16532
|
|
|
16265
16533
|
user_effect(() => {
|
|
16266
16534
|
if (strict_equals(get(previousValue)?.toString(), value()?.toString(), false)) {
|
|
16535
|
+
set(previousValue, value(), true);
|
|
16267
16536
|
invalid(false);
|
|
16268
16537
|
}
|
|
16269
16538
|
});
|
|
16270
16539
|
|
|
16271
16540
|
user_effect(() => {
|
|
16272
|
-
if (!
|
|
16541
|
+
if (!expanded()) {
|
|
16273
16542
|
set(hiddenSearchText, "");
|
|
16274
16543
|
set(searchText, "");
|
|
16275
16544
|
}
|
|
@@ -16309,10 +16578,34 @@
|
|
|
16309
16578
|
placeholder(strict_equals(optionWithEmptyValue.label, "", false) ? optionWithEmptyValue.label : defaultPlaceholder);
|
|
16310
16579
|
});
|
|
16311
16580
|
|
|
16581
|
+
user_effect(() => {
|
|
16582
|
+
if (expanded()) {
|
|
16583
|
+
const borderThickness = 2 * (invalid() ? 2 : 1);
|
|
16584
|
+
|
|
16585
|
+
const popupHeight = get(popup)
|
|
16586
|
+
? get(popup).getBoundingClientRect().height
|
|
16587
|
+
: get(usedHeight);
|
|
16588
|
+
|
|
16589
|
+
set(topOffset, get(buttonElementYPosition) + buttonHeight > innerHeight - popupHeight ? -popupHeight : buttonHeight - borderThickness, true);
|
|
16590
|
+
}
|
|
16591
|
+
});
|
|
16592
|
+
|
|
16312
16593
|
function findOptionWithEmptyValue() {
|
|
16313
16594
|
return items()?.find((item) => strict_equals(item.value, "") || strict_equals(item.value, null) || strict_equals(item.value, undefined));
|
|
16314
16595
|
}
|
|
16315
16596
|
|
|
16597
|
+
function setRemainingBottomHeight() {
|
|
16598
|
+
if (!get(button)) {
|
|
16599
|
+
return;
|
|
16600
|
+
}
|
|
16601
|
+
|
|
16602
|
+
set(buttonElementYPosition, get(button).getBoundingClientRect().y, true);
|
|
16603
|
+
}
|
|
16604
|
+
|
|
16605
|
+
onMount(() => {
|
|
16606
|
+
setRemainingBottomHeight();
|
|
16607
|
+
});
|
|
16608
|
+
|
|
16316
16609
|
var $$exports = {
|
|
16317
16610
|
get id() {
|
|
16318
16611
|
return id();
|
|
@@ -16476,6 +16769,15 @@
|
|
|
16476
16769
|
flushSync();
|
|
16477
16770
|
},
|
|
16478
16771
|
|
|
16772
|
+
get expanded() {
|
|
16773
|
+
return expanded();
|
|
16774
|
+
},
|
|
16775
|
+
|
|
16776
|
+
set expanded($$value = false) {
|
|
16777
|
+
expanded($$value);
|
|
16778
|
+
flushSync();
|
|
16779
|
+
},
|
|
16780
|
+
|
|
16479
16781
|
...legacy_api()
|
|
16480
16782
|
};
|
|
16481
16783
|
|
|
@@ -16483,6 +16785,7 @@
|
|
|
16483
16785
|
|
|
16484
16786
|
event('click', $document.body, handleOuterEvent);
|
|
16485
16787
|
event('keydown', $document.body, handleTab);
|
|
16788
|
+
event('scroll', $window, setRemainingBottomHeight);
|
|
16486
16789
|
|
|
16487
16790
|
var div_1 = child(div);
|
|
16488
16791
|
|
|
@@ -16523,7 +16826,7 @@
|
|
|
16523
16826
|
}),
|
|
16524
16827
|
'component',
|
|
16525
16828
|
DropdownList,
|
|
16526
|
-
|
|
16829
|
+
327,
|
|
16527
16830
|
12,
|
|
16528
16831
|
{ componentTag: 'Label' }
|
|
16529
16832
|
);
|
|
@@ -16535,7 +16838,7 @@
|
|
|
16535
16838
|
}),
|
|
16536
16839
|
'if',
|
|
16537
16840
|
DropdownList,
|
|
16538
|
-
|
|
16841
|
+
326,
|
|
16539
16842
|
8
|
|
16540
16843
|
);
|
|
16541
16844
|
}
|
|
@@ -16544,62 +16847,70 @@
|
|
|
16544
16847
|
var node_1 = child(div_2);
|
|
16545
16848
|
|
|
16546
16849
|
add_svelte_meta(
|
|
16547
|
-
() =>
|
|
16548
|
-
|
|
16549
|
-
|
|
16550
|
-
|
|
16551
|
-
},
|
|
16850
|
+
() => DropdownListButton(node_1, {
|
|
16851
|
+
get inputId() {
|
|
16852
|
+
return inputId;
|
|
16853
|
+
},
|
|
16552
16854
|
|
|
16553
|
-
|
|
16554
|
-
|
|
16555
|
-
|
|
16855
|
+
get disabled() {
|
|
16856
|
+
return disabled();
|
|
16857
|
+
},
|
|
16556
16858
|
|
|
16557
|
-
|
|
16558
|
-
|
|
16559
|
-
|
|
16859
|
+
get expanded() {
|
|
16860
|
+
return expanded();
|
|
16861
|
+
},
|
|
16560
16862
|
|
|
16561
|
-
|
|
16562
|
-
|
|
16563
|
-
|
|
16863
|
+
get 'aria-labelledby'() {
|
|
16864
|
+
return labelId;
|
|
16865
|
+
},
|
|
16564
16866
|
|
|
16565
|
-
|
|
16566
|
-
|
|
16567
|
-
|
|
16867
|
+
get 'aria-required'() {
|
|
16868
|
+
return required();
|
|
16869
|
+
},
|
|
16568
16870
|
|
|
16569
|
-
|
|
16570
|
-
|
|
16571
|
-
|
|
16871
|
+
get 'aria-expanded'() {
|
|
16872
|
+
return expanded();
|
|
16873
|
+
},
|
|
16572
16874
|
|
|
16573
|
-
|
|
16875
|
+
'aria-haspopup': 'listbox',
|
|
16574
16876
|
|
|
16575
|
-
|
|
16576
|
-
|
|
16577
|
-
|
|
16877
|
+
get 'aria-controls'() {
|
|
16878
|
+
return itemsId;
|
|
16879
|
+
},
|
|
16578
16880
|
|
|
16579
|
-
|
|
16580
|
-
|
|
16581
|
-
|
|
16881
|
+
get 'aria-invalid'() {
|
|
16882
|
+
return invalid();
|
|
16883
|
+
},
|
|
16582
16884
|
|
|
16583
|
-
|
|
16584
|
-
|
|
16585
|
-
|
|
16885
|
+
get selectedOptionsText() {
|
|
16886
|
+
return get(selectedOptionsText);
|
|
16887
|
+
},
|
|
16586
16888
|
|
|
16587
|
-
|
|
16588
|
-
|
|
16589
|
-
|
|
16889
|
+
get placeholder() {
|
|
16890
|
+
return placeholder();
|
|
16891
|
+
},
|
|
16590
16892
|
|
|
16591
|
-
|
|
16893
|
+
get usedHeight() {
|
|
16894
|
+
return get(usedHeight);
|
|
16895
|
+
},
|
|
16592
16896
|
|
|
16593
|
-
|
|
16594
|
-
|
|
16595
|
-
|
|
16596
|
-
|
|
16597
|
-
|
|
16598
|
-
|
|
16599
|
-
|
|
16897
|
+
onclick: handleDropdownButtonClick,
|
|
16898
|
+
|
|
16899
|
+
onkeydown: (e) => {
|
|
16900
|
+
handleButtonKeyDown(e, enableSearch() ? get(searchInput) : get(dropdownItems));
|
|
16901
|
+
},
|
|
16902
|
+
|
|
16903
|
+
get buttonElement() {
|
|
16904
|
+
return get(button);
|
|
16905
|
+
},
|
|
16906
|
+
|
|
16907
|
+
set buttonElement($$value) {
|
|
16908
|
+
set(button, $$value, true);
|
|
16909
|
+
}
|
|
16910
|
+
}),
|
|
16600
16911
|
'component',
|
|
16601
16912
|
DropdownList,
|
|
16602
|
-
|
|
16913
|
+
349,
|
|
16603
16914
|
12,
|
|
16604
16915
|
{ componentTag: 'DropdownListButton' }
|
|
16605
16916
|
);
|
|
@@ -16654,7 +16965,7 @@
|
|
|
16654
16965
|
),
|
|
16655
16966
|
'component',
|
|
16656
16967
|
DropdownList,
|
|
16657
|
-
|
|
16968
|
+
387,
|
|
16658
16969
|
24,
|
|
16659
16970
|
{ componentTag: 'SearchInput' }
|
|
16660
16971
|
);
|
|
@@ -16670,7 +16981,7 @@
|
|
|
16670
16981
|
}),
|
|
16671
16982
|
'if',
|
|
16672
16983
|
DropdownList,
|
|
16673
|
-
|
|
16984
|
+
385,
|
|
16674
16985
|
16
|
|
16675
16986
|
);
|
|
16676
16987
|
}
|
|
@@ -16687,10 +16998,6 @@
|
|
|
16687
16998
|
return itemsId;
|
|
16688
16999
|
},
|
|
16689
17000
|
|
|
16690
|
-
get enableSearch() {
|
|
16691
|
-
return enableSearch();
|
|
16692
|
-
},
|
|
16693
|
-
|
|
16694
17001
|
get placeholder() {
|
|
16695
17002
|
return placeholder();
|
|
16696
17003
|
},
|
|
@@ -16734,7 +17041,7 @@
|
|
|
16734
17041
|
),
|
|
16735
17042
|
'component',
|
|
16736
17043
|
DropdownList,
|
|
16737
|
-
|
|
17044
|
+
405,
|
|
16738
17045
|
16,
|
|
16739
17046
|
{ componentTag: 'DropdownListItems' }
|
|
16740
17047
|
);
|
|
@@ -16754,12 +17061,13 @@
|
|
|
16754
17061
|
}),
|
|
16755
17062
|
'key',
|
|
16756
17063
|
DropdownList,
|
|
16757
|
-
|
|
17064
|
+
426,
|
|
16758
17065
|
20
|
|
16759
17066
|
);
|
|
16760
17067
|
|
|
16761
17068
|
reset(div_5);
|
|
16762
17069
|
reset(div_3);
|
|
17070
|
+
bind_this(div_3, ($$value) => set(popup, $$value), () => get(popup));
|
|
16763
17071
|
reset(div_2);
|
|
16764
17072
|
bind_this(div_2, ($$value) => set(instance, $$value), () => get(instance));
|
|
16765
17073
|
reset(div_1);
|
|
@@ -16801,7 +17109,7 @@
|
|
|
16801
17109
|
}),
|
|
16802
17110
|
'component',
|
|
16803
17111
|
DropdownList,
|
|
16804
|
-
|
|
17112
|
+
435,
|
|
16805
17113
|
4,
|
|
16806
17114
|
{ componentTag: 'FormError' }
|
|
16807
17115
|
);
|
|
@@ -16820,7 +17128,16 @@
|
|
|
16820
17128
|
]));
|
|
16821
17129
|
|
|
16822
17130
|
set_attribute(div_3, 'id', popupId);
|
|
16823
|
-
|
|
17131
|
+
|
|
17132
|
+
set_style(div_3, `
|
|
17133
|
+
--dropdown-items-top-offset: ${get(topOffset)};
|
|
17134
|
+
--dropdown-items-height: ${get(usedHeight)};
|
|
17135
|
+
--dropdown-items-bottom-border: ${get(popupBottomBorderThickness)};
|
|
17136
|
+
--dropdown-items-top-border: ${get(popupTopBorderThickness)};
|
|
17137
|
+
--dropdown-button-border: ${invalid() ? 2 : 1};
|
|
17138
|
+
`);
|
|
17139
|
+
|
|
17140
|
+
set_attribute(div_3, 'hidden', !expanded());
|
|
16824
17141
|
});
|
|
16825
17142
|
|
|
16826
17143
|
append($$anchor, div);
|
|
@@ -16848,7 +17165,8 @@
|
|
|
16848
17165
|
multiple: {},
|
|
16849
17166
|
rootElement: {},
|
|
16850
17167
|
errorElement: {},
|
|
16851
|
-
webComponentMode: {}
|
|
17168
|
+
webComponentMode: {},
|
|
17169
|
+
expanded: {}
|
|
16852
17170
|
},
|
|
16853
17171
|
[],
|
|
16854
17172
|
[],
|
|
@@ -16857,7 +17175,7 @@
|
|
|
16857
17175
|
|
|
16858
17176
|
SelectWC[FILENAME] = 'src/sdg/components/DropdownList/SelectWC.svelte';
|
|
16859
17177
|
|
|
16860
|
-
var root = add_locations(from_html(`<div hidden=""><!></div> <!> <link rel="stylesheet"/>`, 1), SelectWC[FILENAME], [[
|
|
17178
|
+
var root = add_locations(from_html(`<div hidden=""><!></div> <!> <link rel="stylesheet"/>`, 1), SelectWC[FILENAME], [[144, 0], [165, 0]]);
|
|
16861
17179
|
|
|
16862
17180
|
function SelectWC($$anchor, $$props) {
|
|
16863
17181
|
check_target(new.target);
|
|
@@ -16873,6 +17191,7 @@
|
|
|
16873
17191
|
label = prop($$props, 'label', 7),
|
|
16874
17192
|
placeholder = prop($$props, 'placeholder', 7),
|
|
16875
17193
|
width = prop($$props, 'width', 7),
|
|
17194
|
+
expanded = prop($$props, 'expanded', 15, false),
|
|
16876
17195
|
rest = rest_props(
|
|
16877
17196
|
$$props,
|
|
16878
17197
|
[
|
|
@@ -16887,15 +17206,16 @@
|
|
|
16887
17206
|
'required',
|
|
16888
17207
|
'label',
|
|
16889
17208
|
'placeholder',
|
|
16890
|
-
'width'
|
|
17209
|
+
'width',
|
|
17210
|
+
'expanded'
|
|
16891
17211
|
]);
|
|
16892
17212
|
|
|
16893
17213
|
let selectElement = tag(state(void 0), 'selectElement');
|
|
16894
17214
|
let items = tag(state(void 0), 'items');
|
|
16895
17215
|
let labelElement = tag(state(void 0), 'labelElement');
|
|
16896
|
-
|
|
17216
|
+
const observer = Utils.createMutationObserver($$props.$$host, setupItemsList);
|
|
16897
17217
|
|
|
16898
|
-
|
|
17218
|
+
const observerOptions = {
|
|
16899
17219
|
childList: true,
|
|
16900
17220
|
attributes: true,
|
|
16901
17221
|
subtree: true,
|
|
@@ -16906,6 +17226,7 @@
|
|
|
16906
17226
|
let errorElement = tag(state(void 0), 'errorElement');
|
|
16907
17227
|
let parentRow = tag(user_derived(() => $$props.$$host.closest(".qc-formfield-row")), 'parentRow');
|
|
16908
17228
|
let internalChange = false;
|
|
17229
|
+
let previousValue = tag(state(proxy(value())), 'previousValue');
|
|
16909
17230
|
|
|
16910
17231
|
onMount(() => {
|
|
16911
17232
|
set(selectElement, $$props.$$host.querySelector("select"), true);
|
|
@@ -16919,7 +17240,7 @@
|
|
|
16919
17240
|
multiple(get(selectElement).multiple);
|
|
16920
17241
|
disabled(get(selectElement).disabled);
|
|
16921
17242
|
get(selectElement).addEventListener("change", handleSelectChange);
|
|
16922
|
-
observer
|
|
17243
|
+
observer?.observe(get(selectElement), observerOptions);
|
|
16923
17244
|
}
|
|
16924
17245
|
|
|
16925
17246
|
setupItemsList();
|
|
@@ -16937,23 +17258,31 @@
|
|
|
16937
17258
|
|
|
16938
17259
|
internalChange = true;
|
|
16939
17260
|
|
|
16940
|
-
let newOptionSelected = false;
|
|
16941
|
-
|
|
16942
17261
|
for (const option of get(selectElement).options) {
|
|
16943
17262
|
const selected = value().includes(option.value);
|
|
16944
17263
|
|
|
16945
17264
|
if (strict_equals(selected, option.selected, false)) {
|
|
16946
17265
|
option.toggleAttribute("selected", selected);
|
|
16947
17266
|
option.selected = selected;
|
|
16948
|
-
newOptionSelected = true;
|
|
16949
17267
|
}
|
|
16950
17268
|
}
|
|
16951
17269
|
|
|
16952
|
-
|
|
16953
|
-
|
|
17270
|
+
tick().then(() => internalChange = false);
|
|
17271
|
+
});
|
|
17272
|
+
|
|
17273
|
+
user_effect(() => {
|
|
17274
|
+
if (strict_equals(get(previousValue).toString(), value().toString(), false)) {
|
|
17275
|
+
set(previousValue, value(), true);
|
|
17276
|
+
get(selectElement)?.dispatchEvent(new CustomEvent('change', { detail: value() }));
|
|
16954
17277
|
}
|
|
17278
|
+
});
|
|
16955
17279
|
|
|
16956
|
-
|
|
17280
|
+
user_effect(() => {
|
|
17281
|
+
if (expanded()) {
|
|
17282
|
+
get(selectElement)?.dispatchEvent(new CustomEvent('qc.select.show', { bubbles: true, composed: true }));
|
|
17283
|
+
} else {
|
|
17284
|
+
get(selectElement)?.dispatchEvent(new CustomEvent('qc.select.hide', { bubbles: true, composed: true }));
|
|
17285
|
+
}
|
|
16957
17286
|
});
|
|
16958
17287
|
|
|
16959
17288
|
user_effect(() => {
|
|
@@ -17060,6 +17389,15 @@
|
|
|
17060
17389
|
flushSync();
|
|
17061
17390
|
},
|
|
17062
17391
|
|
|
17392
|
+
get expanded() {
|
|
17393
|
+
return expanded();
|
|
17394
|
+
},
|
|
17395
|
+
|
|
17396
|
+
set expanded($$value = false) {
|
|
17397
|
+
expanded($$value);
|
|
17398
|
+
flushSync();
|
|
17399
|
+
},
|
|
17400
|
+
|
|
17063
17401
|
...legacy_api()
|
|
17064
17402
|
};
|
|
17065
17403
|
|
|
@@ -17077,6 +17415,7 @@
|
|
|
17077
17415
|
|
|
17078
17416
|
$$ownership_validator.binding('value', DropdownList, value);
|
|
17079
17417
|
$$ownership_validator.binding('invalid', DropdownList, invalid);
|
|
17418
|
+
$$ownership_validator.binding('expanded', DropdownList, expanded);
|
|
17080
17419
|
|
|
17081
17420
|
add_svelte_meta(
|
|
17082
17421
|
() => DropdownList(node_1, spread_props(
|
|
@@ -17147,12 +17486,20 @@
|
|
|
17147
17486
|
|
|
17148
17487
|
set rootElement($$value) {
|
|
17149
17488
|
set(instance, $$value, true);
|
|
17489
|
+
},
|
|
17490
|
+
|
|
17491
|
+
get expanded() {
|
|
17492
|
+
return expanded();
|
|
17493
|
+
},
|
|
17494
|
+
|
|
17495
|
+
set expanded($$value) {
|
|
17496
|
+
expanded($$value);
|
|
17150
17497
|
}
|
|
17151
17498
|
}
|
|
17152
17499
|
)),
|
|
17153
17500
|
'component',
|
|
17154
17501
|
SelectWC,
|
|
17155
|
-
|
|
17502
|
+
148,
|
|
17156
17503
|
0,
|
|
17157
17504
|
{ componentTag: 'DropdownList' }
|
|
17158
17505
|
);
|
|
@@ -17181,7 +17528,8 @@
|
|
|
17181
17528
|
placeholder: { attribute: 'placeholder', type: 'String' },
|
|
17182
17529
|
searchPlaceholder: { attribute: 'search-placeholder', type: 'String' },
|
|
17183
17530
|
noOptionsMessage: { attribute: 'no-options-message', type: 'String' },
|
|
17184
|
-
multiple: { attribute: 'multiple', type: 'Boolean' }
|
|
17531
|
+
multiple: { attribute: 'multiple', type: 'Boolean' },
|
|
17532
|
+
expanded: { attribute: 'expanded', reflect: true, type: 'Boolean' }
|
|
17185
17533
|
},
|
|
17186
17534
|
['default'],
|
|
17187
17535
|
[],
|