@quartzds/core-vue 1.0.0-beta.12 → 1.0.0-beta.121

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.
@@ -0,0 +1,507 @@
1
+ /**
2
+ * SPDX-FileCopyrightText: © 2024 Schneider Electric
3
+ *
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ [dir='rtl'] {
8
+ --qds-direction-factor: -1;
9
+ }
10
+
11
+ :is(
12
+ [class^='qds-']:not([class^='qds-platform-'], [class^='qds-theme-']),
13
+ [class*=' qds-']:not([class*=' qds-platform-'], [class*=' qds-theme-'])
14
+ )
15
+ figure {
16
+ display: flex;
17
+ flex-direction: column;
18
+ gap: var(--qds-figure-gap);
19
+ }
20
+
21
+ :is(
22
+ [class^='qds-']:not([class^='qds-platform-'], [class^='qds-theme-']),
23
+ [class*=' qds-']:not([class*=' qds-platform-'], [class*=' qds-theme-'])
24
+ )
25
+ figcaption {
26
+ color: var(--qds-theme-figure-caption);
27
+ font: var(--qds-figure-caption);
28
+ }
29
+
30
+ :is(
31
+ [class^='qds-']:not([class^='qds-platform-'], [class^='qds-theme-']),
32
+ [class*=' qds-']:not([class*=' qds-platform-'], [class*=' qds-theme-'])
33
+ )
34
+ :is(li, p, pre) {
35
+ color: var(--qds-theme-text-standard);
36
+ }
37
+
38
+ :is(
39
+ [class^='qds-']:not([class^='qds-platform-'], [class^='qds-theme-']),
40
+ [class*=' qds-']:not([class*=' qds-platform-'], [class*=' qds-theme-'])
41
+ )
42
+ :is(li, p) {
43
+ font: var(--qds-text-standard);
44
+ }
45
+
46
+ :is(
47
+ [class^='qds-']:not([class^='qds-platform-'], [class^='qds-theme-']),
48
+ [class*=' qds-']:not([class*=' qds-platform-'], [class*=' qds-theme-'])
49
+ )
50
+ :is(li, p)
51
+ strong {
52
+ font: var(--qds-text-emphasized);
53
+ }
54
+
55
+ :is(
56
+ [class^='qds-']:not([class^='qds-platform-'], [class^='qds-theme-']),
57
+ [class*=' qds-']:not([class*=' qds-platform-'], [class*=' qds-theme-'])
58
+ )
59
+ pre {
60
+ font: var(--qds-code-standard);
61
+ }
62
+
63
+ :is(
64
+ [class^='qds-']:not([class^='qds-platform-'], [class^='qds-theme-']),
65
+ [class*=' qds-']:not([class*=' qds-platform-'], [class*=' qds-theme-'])
66
+ )
67
+ pre
68
+ strong {
69
+ font: var(--qds-code-emphasized);
70
+ }
71
+
72
+ :is(
73
+ [class^='qds-']:not([class^='qds-platform-'], [class^='qds-theme-']),
74
+ [class*=' qds-']:not([class*=' qds-platform-'], [class*=' qds-theme-'])
75
+ )
76
+ :is(menu, ol, ul) {
77
+ padding-inline-start: var(--qds-list-item-standard-padding-indent-step);
78
+ }
79
+
80
+ :is(
81
+ [class^='qds-']:not([class^='qds-platform-'], [class^='qds-theme-']),
82
+ [class*=' qds-']:not([class*=' qds-platform-'], [class*=' qds-theme-'])
83
+ )
84
+ :is(li, p, span).qds-subdued {
85
+ color: var(--qds-theme-text-subdued);
86
+ font: var(--qds-text-subdued);
87
+ }
88
+
89
+ :is(
90
+ .qds-accessory-section,
91
+ .qds-accessory,
92
+ .qds-controls-jumbo,
93
+ .qds-controls-large,
94
+ .qds-controls-small,
95
+ .qds-controls,
96
+ .qds-main-section,
97
+ .qds-main-subsection,
98
+ .qds-main,
99
+ .qds-navigation-section,
100
+ .qds-navigation-subsection,
101
+ .qds-navigation,
102
+ .qds-panel-section,
103
+ .qds-panel-subsection,
104
+ .qds-panel,
105
+ .qds-popup-section,
106
+ .qds-popup-subsection,
107
+ .qds-popup
108
+ )
109
+ :is(blockquote, figure, input, menu, ol, p, pre, ul) {
110
+ margin: 0;
111
+ }
112
+
113
+ .qds-accessory-section,
114
+ .qds-accessory,
115
+ .qds-controls-jumbo,
116
+ .qds-controls-large,
117
+ .qds-controls-small,
118
+ .qds-controls,
119
+ .qds-main-section,
120
+ .qds-main-subsection,
121
+ .qds-main,
122
+ .qds-navigation-section,
123
+ .qds-navigation-subsection,
124
+ .qds-navigation,
125
+ .qds-panel-section,
126
+ .qds-panel-subsection,
127
+ .qds-panel,
128
+ .qds-popup-section,
129
+ .qds-popup-subsection,
130
+ .qds-popup {
131
+ align-items: flex-start;
132
+ display: flex;
133
+ flex-direction: column;
134
+ }
135
+
136
+ :is(
137
+ [class^='qds-']:not([class^='qds-platform-'], [class^='qds-theme-']),
138
+ [class*=' qds-']:not([class*=' qds-platform-'], [class*=' qds-theme-'])
139
+ )
140
+ :is(
141
+ .qds-accessory,
142
+ .qds-main-subsection,
143
+ .qds-main,
144
+ .qds-navigation-subsection,
145
+ .qds-navigation,
146
+ .qds-panel-subsection,
147
+ .qds-panel,
148
+ .qds-popup-subsection,
149
+ .qds-popup
150
+ ).qds-subdued {
151
+ background-color: transparent;
152
+ }
153
+
154
+ :is(
155
+ [class^='qds-']:not([class^='qds-platform-'], [class^='qds-theme-']),
156
+ [class*=' qds-']:not([class*=' qds-platform-'], [class*=' qds-theme-'])
157
+ )
158
+ :is(.qds-panel, .qds-navigation, .qds-popup, .qds-accessory).qds-subdued {
159
+ box-shadow: none;
160
+ }
161
+
162
+ .qds-main {
163
+ background-color: var(--qds-theme-main-background);
164
+ padding-block: var(--qds-main-padding-vertical);
165
+ padding-inline: var(--qds-main-padding-horizontal);
166
+ }
167
+
168
+ .qds-main,
169
+ .qds-main .qds-unrelated {
170
+ gap: var(--qds-main-gap-children-unrelated);
171
+ }
172
+
173
+ .qds-main.qds-related,
174
+ .qds-main .qds-related {
175
+ gap: var(--qds-main-gap-children-related);
176
+ }
177
+
178
+ .qds-main-section {
179
+ padding-block-start: var(--qds-main-section-padding-top);
180
+ }
181
+
182
+ .qds-main-section,
183
+ .qds-main-section .qds-unrelated {
184
+ gap: var(--qds-main-section-gap-children-unrelated);
185
+ }
186
+
187
+ .qds-main-section.qds-related,
188
+ .qds-main-section .qds-related {
189
+ gap: var(--qds-main-section-gap-children-related);
190
+ }
191
+
192
+ .qds-main-subsection {
193
+ background-color: var(--qds-theme-main-subsection-standard-background);
194
+ border-radius: var(--qds-main-subsection-border-radius);
195
+ padding: var(--qds-main-subsection-padding-top)
196
+ var(--qds-main-subsection-padding-end)
197
+ var(--qds-main-subsection-padding-bottom)
198
+ var(--qds-main-subsection-padding-start);
199
+ }
200
+
201
+ .qds-main-subsection,
202
+ .qds-main-subsection .qds-unrelated {
203
+ gap: var(--qds-main-subsection-gap-children-unrelated);
204
+ }
205
+
206
+ .qds-main-subsection.qds-emphasized {
207
+ box-shadow: var(--qds-theme-main-subsection-emphasized);
208
+ }
209
+
210
+ .qds-main-subsection.qds-related,
211
+ .qds-main-subsection .qds-related {
212
+ gap: var(--qds-main-subsection-gap-children-related);
213
+ }
214
+
215
+ .qds-navigation {
216
+ background-color: var(--qds-theme-navigation-background);
217
+ border-radius: var(--qds-navigation-border-radius);
218
+ box-shadow: var(--qds-theme-navigation-elevation);
219
+ padding: var(--qds-navigation-padding);
220
+ }
221
+
222
+ .qds-navigation,
223
+ .qds-navigation .qds-unrelated {
224
+ gap: var(--qds-navigation-gap-children-unrelated);
225
+ }
226
+
227
+ .qds-navigation.qds-related,
228
+ .qds-navigation .qds-related {
229
+ gap: var(--qds-navigation-gap-children-related);
230
+ }
231
+
232
+ .qds-navigation-section {
233
+ padding: var(--qds-navigation-section-padding);
234
+ }
235
+
236
+ .qds-navigation-section,
237
+ .qds-navigation-section .qds-unrelated {
238
+ gap: var(--qds-navigation-section-gap-children-unrelated);
239
+ }
240
+
241
+ .qds-navigation-section.qds-related,
242
+ .qds-navigation-section .qds-related {
243
+ gap: var(--qds-navigation-section-gap-children-related);
244
+ }
245
+
246
+ .qds-navigation-subsection {
247
+ background-color: var(--qds-theme-navigation-subsection-standard-background);
248
+ border-radius: var(--qds-navigation-subsection-border-radius);
249
+ padding: var(--qds-navigation-subsection-padding);
250
+ }
251
+
252
+ .qds-navigation-subsection,
253
+ .qds-navigation-subsection .qds-unrelated {
254
+ gap: var(--qds-navigation-subsection-gap-children-unrelated);
255
+ }
256
+
257
+ .qds-navigation-subsection.qds-emphasized {
258
+ box-shadow: var(--qds-theme-navigation-subsection-emphasized);
259
+ }
260
+
261
+ .qds-navigation-subsection.qds-related,
262
+ .qds-navigation-subsection .qds-related {
263
+ gap: var(--qds-navigation-subsection-gap-children-related);
264
+ }
265
+
266
+ .qds-panel {
267
+ background-color: var(--qds-theme-panel-background);
268
+ border-radius: var(--qds-panel-border-radius);
269
+ box-shadow: var(--qds-theme-panel-elevation);
270
+ padding: var(--qds-panel-padding);
271
+ }
272
+
273
+ .qds-panel,
274
+ .qds-panel .qds-unrelated {
275
+ gap: var(--qds-panel-gap-children-unrelated);
276
+ }
277
+
278
+ .qds-panel.qds-related,
279
+ .qds-panel .qds-related {
280
+ gap: var(--qds-panel-gap-children-related);
281
+ }
282
+
283
+ .qds-panel-section {
284
+ padding-block-start: var(--qds-panel-section-padding-top);
285
+ }
286
+
287
+ .qds-panel-section,
288
+ .qds-panel-section .qds-unrelated {
289
+ gap: var(--qds-panel-section-gap-children-unrelated);
290
+ }
291
+
292
+ .qds-panel-section.qds-related,
293
+ .qds-panel-section .qds-related {
294
+ gap: var(--qds-panel-section-gap-children-related);
295
+ }
296
+
297
+ .qds-panel-subsection {
298
+ background-color: var(--qds-theme-panel-subsection-standard-background);
299
+ border-radius: var(--qds-panel-subsection-border-radius);
300
+ padding: var(--qds-panel-subsection-padding);
301
+ }
302
+
303
+ .qds-panel-subsection,
304
+ .qds-panel-subsection .qds-unrelated {
305
+ gap: var(--qds-panel-subsection-gap-children-unrelated);
306
+ }
307
+
308
+ .qds-panel-subsection.qds-emphasized {
309
+ box-shadow: var(--qds-theme-panel-subsection-emphasized);
310
+ }
311
+
312
+ .qds-panel-subsection.qds-related,
313
+ .qds-panel-subsection .qds-related {
314
+ gap: var(--qds-panel-subsection-gap-children-related);
315
+ }
316
+
317
+ .qds-popup {
318
+ background-color: var(--qds-theme-popup-background);
319
+ border-radius: var(--qds-popup-border-radius);
320
+ box-shadow: var(--qds-popup-elevation);
321
+ padding: var(--qds-popup-padding-top) var(--qds-popup-padding-end)
322
+ var(--qds-popup-padding-bottom) var(--qds-popup-padding-start);
323
+ }
324
+
325
+ .qds-popup,
326
+ .qds-popup .qds-unrelated {
327
+ gap: var(--qds-popup-gap-children-unrelated);
328
+ }
329
+
330
+ .qds-popup.qds-related,
331
+ .qds-popup .qds-related {
332
+ gap: var(--qds-popup-gap-children-related);
333
+ }
334
+
335
+ .qds-popup-section,
336
+ .qds-popup-section .qds-unrelated {
337
+ gap: var(--qds-popup-section-gap-children-unrelated);
338
+ }
339
+
340
+ .qds-popup-section.qds-related,
341
+ .qds-popup-section .qds-related {
342
+ gap: var(--qds-popup-section-gap-children-related);
343
+ }
344
+
345
+ .qds-popup-subsection {
346
+ background-color: var(--qds-theme-popup-subsection-standard-background);
347
+ border-radius: var(--qds-popup-subsection-border-radius);
348
+ padding: var(--qds-popup-subsection-padding);
349
+ }
350
+
351
+ .qds-popup-subsection,
352
+ .qds-popup-subsection .qds-unrelated {
353
+ gap: var(--qds-popup-subsection-gap-children-unrelated);
354
+ }
355
+
356
+ .qds-popup-subsection.qds-emphasized {
357
+ box-shadow: var(--qds-theme-popup-subsection-emphasized);
358
+ }
359
+
360
+ .qds-popup-subsection.qds-related,
361
+ .qds-popup-subsection .qds-related {
362
+ gap: var(--qds-popup-subsection-gap-children-related);
363
+ }
364
+
365
+ .qds-accessory {
366
+ background-color: var(--qds-theme-accessory-background);
367
+ border-radius: var(--qds-accessory-border-radius);
368
+ box-shadow: var(--qds-accessory-elevation);
369
+ padding: var(--qds-accessory-padding-top) var(--qds-accessory-padding-end)
370
+ var(--qds-accessory-padding-bottom) var(--qds-accessory-padding-start);
371
+ }
372
+
373
+ .qds-accessory,
374
+ .qds-accessory .qds-unrelated {
375
+ gap: var(--qds-accessory-gap-children-unrelated);
376
+ }
377
+
378
+ .qds-accessory.qds-related,
379
+ .qds-accessory .qds-related {
380
+ gap: var(--qds-accessory-gap-children-related);
381
+ }
382
+
383
+ .qds-accessory-section {
384
+ border-radius: var(--qds-accessory-section-border-radius);
385
+ }
386
+
387
+ .qds-accessory-section,
388
+ .qds-accessory-section .qds-unrelated {
389
+ gap: var(--qds-accessory-section-gap-children-unrelated);
390
+ }
391
+
392
+ .qds-accessory-section.qds-related,
393
+ .qds-accessory-section .qds-related {
394
+ gap: var(--qds-accessory-section-gap-children-related);
395
+ }
396
+
397
+ .qds-controls-small,
398
+ .qds-controls-small .qds-unrelated {
399
+ gap: var(--qds-control-small-gap-siblings-unrelated);
400
+ }
401
+
402
+ .qds-controls-small.qds-related,
403
+ .qds-controls-small .qds-related {
404
+ gap: var(--qds-control-small-gap-siblings-related);
405
+ }
406
+
407
+ .qds-controls,
408
+ .qds-controls .qds-unrelated {
409
+ gap: var(--qds-control-standard-gap-siblings-unrelated);
410
+ }
411
+
412
+ .qds-controls.qds-related,
413
+ .qds-controls .qds-related {
414
+ gap: var(--qds-control-standard-gap-siblings-related);
415
+ }
416
+
417
+ .qds-controls-large,
418
+ .qds-controls-large .qds-unrelated {
419
+ gap: var(--qds-control-large-gap-siblings-unrelated);
420
+ }
421
+
422
+ .qds-controls-large.qds-related,
423
+ .qds-controls-large .qds-related {
424
+ gap: var(--qds-control-large-gap-siblings-related);
425
+ }
426
+
427
+ .qds-controls-jumbo,
428
+ .qds-controls-jumbo .qds-unrelated {
429
+ gap: var(--qds-control-jumbo-gap-siblings-unrelated);
430
+ }
431
+
432
+ .qds-controls-jumbo.qds-related,
433
+ .qds-controls-jumbo .qds-related {
434
+ gap: var(--qds-control-jumbo-gap-siblings-related);
435
+ }
436
+
437
+ .qds-interactive {
438
+ cursor: pointer;
439
+ user-select: none;
440
+ }
441
+
442
+ :is(
443
+ .qds-main-subsection,
444
+ .qds-navigation-subsection,
445
+ .qds-panel-subsection,
446
+ .qds-popup-subsection
447
+ ).qds-interactive:hover {
448
+ background-color: var(--qds-theme-interactive-background-hover);
449
+ text-decoration: none;
450
+ }
451
+
452
+ :is(
453
+ .qds-main-subsection,
454
+ .qds-navigation-subsection,
455
+ .qds-panel-subsection,
456
+ .qds-popup-subsection
457
+ ).qds-interactive:active {
458
+ background-color: var(--qds-theme-interactive-background-selected);
459
+ text-decoration: none;
460
+ }
461
+
462
+ .qds-control-group-inline {
463
+ display: flex;
464
+ }
465
+
466
+ .qds-control-group-inline > :first-child:not(:only-child) {
467
+ --qds-control-border-radius-top-right: 0px;
468
+ --qds-control-border-radius-bottom-right: 0px;
469
+ --qds-control-border-width-inline-end: 0px;
470
+ }
471
+
472
+ .qds-control-group-inline > :not(:first-child, :last-child) {
473
+ --qds-control-border-radius-top-left: 0px;
474
+ --qds-control-border-radius-top-right: 0px;
475
+ --qds-control-border-radius-bottom-right: 0px;
476
+ --qds-control-border-radius-bottom-left: 0px;
477
+ --qds-control-border-width-inline-end: 0px;
478
+ }
479
+
480
+ .qds-control-group-inline > :last-child:not(:only-child) {
481
+ --qds-control-border-radius-top-left: 0px;
482
+ --qds-control-border-radius-bottom-left: 0px;
483
+ }
484
+
485
+ .qds-control-group-block {
486
+ display: flex;
487
+ flex-direction: column;
488
+ }
489
+
490
+ .qds-control-group-block > :first-child:not(:only-child) {
491
+ --qds-control-border-radius-bottom-left: 0px;
492
+ --qds-control-border-radius-bottom-right: 0px;
493
+ --qds-control-border-width-block-end: 0px;
494
+ }
495
+
496
+ .qds-control-group-block > :not(:first-child, :last-child) {
497
+ --qds-control-border-radius-top-left: 0px;
498
+ --qds-control-border-radius-top-right: 0px;
499
+ --qds-control-border-radius-bottom-right: 0px;
500
+ --qds-control-border-radius-bottom-left: 0px;
501
+ --qds-control-border-width-block-end: 0px;
502
+ }
503
+
504
+ .qds-control-group-block > :last-child:not(:only-child) {
505
+ --qds-control-border-radius-top-left: 0px;
506
+ --qds-control-border-radius-top-right: 0px;
507
+ }
@@ -1,19 +0,0 @@
1
- export interface InputProps<T> {
2
- modelValue?: T;
3
- }
4
- /**
5
- * Create a callback to define a Vue component wrapper around a Web Component.
6
- *
7
- * @prop name - The component tag name (i.e. `ion-button`)
8
- * @prop componentProps - An array of properties on the
9
- * component. These usually match up with the @Prop definitions
10
- * in each component's TSX file.
11
- * @prop customElement - An option custom element instance to pass
12
- * to customElements.define. Only set if `includeImportCustomElements: true` in your config.
13
- * @prop modelProp - The prop that v-model binds to (i.e. value)
14
- * @prop modelUpdateEvent - The event that is fired from your Web Component when the value changes (i.e. ionChange)
15
- * @prop externalModelUpdateEvent - The external event to fire from your Vue component when modelUpdateEvent fires. This is used for ensuring that v-model references have been
16
- * correctly updated when a user's event callback fires.
17
- */
18
- export declare const defineContainer: <Props, VModelType = string | number | boolean>(name: string, defineCustomElement: any, componentProps?: string[], modelProp?: string, modelUpdateEvent?: string, externalModelUpdateEvent?: string) => (props: Props & InputProps<VModelType> & {}) => any;
19
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/generated/vue-component-lib/utils.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,UAAU,CAAC,EAAE,CAAC,CAAC;CAChB;AAsCD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe,wDACpB,MAAM,uBACS,GAAG,mBACR,MAAM,EAAE,cACZ,MAAM,qBACC,MAAM,6BACE,MAAM,wDA8IlC,CAAC"}
@@ -1,168 +0,0 @@
1
- // @ts-nocheck
2
- // It's easier and safer for Volar to disable typechecking and let the return type inference do its job.
3
- import { defineComponent, getCurrentInstance, h, inject, ref } from 'vue';
4
- const UPDATE_VALUE_EVENT = 'update:modelValue';
5
- const MODEL_VALUE = 'modelValue';
6
- const ROUTER_LINK_VALUE = 'routerLink';
7
- const NAV_MANAGER = 'navManager';
8
- const ROUTER_PROP_PREFIX = 'router';
9
- const ARIA_PROP_PREFIX = 'aria';
10
- /**
11
- * Starting in Vue 3.1.0, all properties are
12
- * added as keys to the props object, even if
13
- * they are not being used. In order to correctly
14
- * account for both value props and v-model props,
15
- * we need to check if the key exists for Vue <3.1.0
16
- * and then check if it is not undefined for Vue >= 3.1.0.
17
- * See https://github.com/vuejs/vue-next/issues/3889
18
- */
19
- const EMPTY_PROP = Symbol();
20
- const DEFAULT_EMPTY_PROP = { default: EMPTY_PROP };
21
- const getComponentClasses = (classes) => {
22
- return classes?.split(' ') || [];
23
- };
24
- const getElementClasses = (ref, componentClasses, defaultClasses = []) => {
25
- return [...Array.from(ref.value?.classList || []), ...defaultClasses].filter((c, i, self) => !componentClasses.has(c) && self.indexOf(c) === i);
26
- };
27
- /**
28
- * Create a callback to define a Vue component wrapper around a Web Component.
29
- *
30
- * @prop name - The component tag name (i.e. `ion-button`)
31
- * @prop componentProps - An array of properties on the
32
- * component. These usually match up with the @Prop definitions
33
- * in each component's TSX file.
34
- * @prop customElement - An option custom element instance to pass
35
- * to customElements.define. Only set if `includeImportCustomElements: true` in your config.
36
- * @prop modelProp - The prop that v-model binds to (i.e. value)
37
- * @prop modelUpdateEvent - The event that is fired from your Web Component when the value changes (i.e. ionChange)
38
- * @prop externalModelUpdateEvent - The external event to fire from your Vue component when modelUpdateEvent fires. This is used for ensuring that v-model references have been
39
- * correctly updated when a user's event callback fires.
40
- */
41
- export const defineContainer = (name, defineCustomElement, componentProps = [], modelProp, modelUpdateEvent, externalModelUpdateEvent) => {
42
- /**
43
- * Create a Vue component wrapper around a Web Component.
44
- * Note: The `props` here are not all properties on a component.
45
- * They refer to whatever properties are set on an instance of a component.
46
- */
47
- if (defineCustomElement !== undefined) {
48
- defineCustomElement();
49
- }
50
- const Container = defineComponent((props, { attrs, slots, emit }) => {
51
- let modelPropValue = props[modelProp];
52
- const containerRef = ref();
53
- const classes = new Set(getComponentClasses(attrs.class));
54
- const onVnodeBeforeMount = (vnode) => {
55
- // Add a listener to tell Vue to update the v-model
56
- if (vnode.el) {
57
- const eventsNames = Array.isArray(modelUpdateEvent) ? modelUpdateEvent : [modelUpdateEvent];
58
- eventsNames.forEach((eventName) => {
59
- vnode.el.addEventListener(eventName.toLowerCase(), (e) => {
60
- modelPropValue = (e?.target)[modelProp];
61
- emit(UPDATE_VALUE_EVENT, modelPropValue);
62
- /**
63
- * We need to emit the change event here
64
- * rather than on the web component to ensure
65
- * that any v-model bindings have been updated.
66
- * Otherwise, the developer will listen on the
67
- * native web component, but the v-model will
68
- * not have been updated yet.
69
- */
70
- if (externalModelUpdateEvent) {
71
- emit(externalModelUpdateEvent, e);
72
- }
73
- });
74
- });
75
- }
76
- };
77
- const currentInstance = getCurrentInstance();
78
- const hasRouter = currentInstance?.appContext?.provides[NAV_MANAGER];
79
- const navManager = hasRouter ? inject(NAV_MANAGER) : undefined;
80
- const handleRouterLink = (ev) => {
81
- const { routerLink } = props;
82
- if (routerLink === EMPTY_PROP)
83
- return;
84
- if (navManager !== undefined) {
85
- let navigationPayload = { event: ev };
86
- for (const key in props) {
87
- const value = props[key];
88
- if (props.hasOwnProperty(key) && key.startsWith(ROUTER_PROP_PREFIX) && value !== EMPTY_PROP) {
89
- navigationPayload[key] = value;
90
- }
91
- }
92
- navManager.navigate(navigationPayload);
93
- }
94
- else {
95
- console.warn('Tried to navigate, but no router was found. Make sure you have mounted Vue Router.');
96
- }
97
- };
98
- return () => {
99
- modelPropValue = props[modelProp];
100
- getComponentClasses(attrs.class).forEach((value) => {
101
- classes.add(value);
102
- });
103
- const oldClick = props.onClick;
104
- const handleClick = (ev) => {
105
- if (oldClick !== undefined) {
106
- oldClick(ev);
107
- }
108
- if (!ev.defaultPrevented) {
109
- handleRouterLink(ev);
110
- }
111
- };
112
- let propsToAdd = {
113
- ref: containerRef,
114
- class: getElementClasses(containerRef, classes),
115
- onClick: handleClick,
116
- onVnodeBeforeMount: modelUpdateEvent ? onVnodeBeforeMount : undefined,
117
- };
118
- /**
119
- * We can use Object.entries here
120
- * to avoid the hasOwnProperty check,
121
- * but that would require 2 iterations
122
- * where as this only requires 1.
123
- */
124
- for (const key in props) {
125
- const value = props[key];
126
- if ((props.hasOwnProperty(key) && value !== EMPTY_PROP) || key.startsWith(ARIA_PROP_PREFIX)) {
127
- propsToAdd[key] = value;
128
- }
129
- }
130
- if (modelProp) {
131
- /**
132
- * If form value property was set using v-model
133
- * then we should use that value.
134
- * Otherwise, check to see if form value property
135
- * was set as a static value (i.e. no v-model).
136
- */
137
- if (props[MODEL_VALUE] !== EMPTY_PROP) {
138
- propsToAdd = {
139
- ...propsToAdd,
140
- [modelProp]: props[MODEL_VALUE],
141
- };
142
- }
143
- else if (modelPropValue !== EMPTY_PROP) {
144
- propsToAdd = {
145
- ...propsToAdd,
146
- [modelProp]: modelPropValue,
147
- };
148
- }
149
- }
150
- return h(name, propsToAdd, slots.default && slots.default());
151
- };
152
- });
153
- if (typeof Container !== 'function') {
154
- Container.name = name;
155
- Container.props = {
156
- [ROUTER_LINK_VALUE]: DEFAULT_EMPTY_PROP,
157
- };
158
- componentProps.forEach((componentProp) => {
159
- Container.props[componentProp] = DEFAULT_EMPTY_PROP;
160
- });
161
- if (modelProp) {
162
- Container.props[MODEL_VALUE] = DEFAULT_EMPTY_PROP;
163
- Container.emits = [UPDATE_VALUE_EVENT, externalModelUpdateEvent];
164
- }
165
- }
166
- return Container;
167
- };
168
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/generated/vue-component-lib/utils.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,wGAAwG;AACxG,OAAO,EAAS,eAAe,EAAE,kBAAkB,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,EAAO,MAAM,KAAK,CAAC;AAMtF,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAC/C,MAAM,WAAW,GAAG,YAAY,CAAC;AACjC,MAAM,iBAAiB,GAAG,YAAY,CAAC;AACvC,MAAM,WAAW,GAAG,YAAY,CAAC;AACjC,MAAM,kBAAkB,GAAG,QAAQ,CAAC;AACpC,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAChC;;;;;;;;GAQG;AACH,MAAM,UAA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