@ionic/core 8.2.3-dev.11724326037.1eacfaff → 8.2.3-dev.11724680612.1b9ef92a
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/components/ion-input.js +14 -5
- package/components/ion-textarea.js +30 -7
- package/components/ion-thumbnail.js +2 -2
- package/components/ion-title.js +2 -2
- package/components/ion-toast.js +2 -2
- package/components/ion-toggle.js +14 -11
- package/components/ion-toolbar.js +2 -2
- package/css/ionic/bundle.ionic.css.map +1 -1
- package/css/ionic/global.bundle.ionic.css.map +1 -1
- package/css/ionic/typography.ionic.css.map +1 -1
- package/dist/cjs/ion-app_8.cjs.entry.js +4 -4
- package/dist/cjs/ion-avatar_3.cjs.entry.js +2 -2
- package/dist/cjs/ion-input.cjs.entry.js +14 -5
- package/dist/cjs/ion-textarea.cjs.entry.js +29 -7
- package/dist/cjs/ion-toast.cjs.entry.js +2 -2
- package/dist/cjs/ion-toggle.cjs.entry.js +14 -11
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/input/input.js +14 -5
- package/dist/collection/components/textarea/test/shape/textarea.e2e.js +79 -0
- package/dist/collection/components/textarea/test/size/textarea.e2e.js +123 -0
- package/dist/collection/components/textarea/textarea.ionic.css +801 -0
- package/dist/collection/components/textarea/textarea.ios.css +175 -95
- package/dist/collection/components/textarea/textarea.js +48 -8
- package/dist/collection/components/textarea/textarea.md.css +175 -95
- package/dist/collection/components/thumbnail/thumbnail.js +2 -2
- package/dist/collection/components/title/title.js +2 -2
- package/dist/collection/components/toast/toast.js +2 -2
- package/dist/collection/components/toggle/test/color/toggle.e2e.js +1 -1
- package/dist/collection/components/toggle/test/enable-on-off-labels/toggle.e2e.js +1 -1
- package/dist/collection/components/toggle/test/item/toggle.e2e.js +4 -2
- package/dist/collection/components/toggle/test/label/toggle.e2e.js +29 -0
- package/dist/collection/components/toggle/test/sizes/toggle.e2e.js +1 -1
- package/dist/collection/components/toggle/test/states/toggle.e2e.js +29 -1
- package/dist/collection/components/toggle/toggle.ionic.css +391 -0
- package/dist/collection/components/toggle/toggle.ios.css +163 -138
- package/dist/collection/components/toggle/toggle.js +12 -9
- package/dist/collection/components/toggle/toggle.md.css +163 -138
- package/dist/collection/components/toolbar/toolbar.js +2 -2
- package/dist/docs.json +47 -5
- package/dist/esm/ion-app_8.entry.js +4 -4
- package/dist/esm/ion-avatar_3.entry.js +2 -2
- package/dist/esm/ion-input.entry.js +14 -5
- package/dist/esm/ion-textarea.entry.js +29 -7
- package/dist/esm/ion-toast.entry.js +2 -2
- package/dist/esm/ion-toggle.entry.js +14 -11
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/ion-app_8.entry.js +1 -1
- package/dist/esm-es5/ion-avatar_3.entry.js +1 -1
- package/dist/esm-es5/ion-input.entry.js +1 -1
- package/dist/esm-es5/ion-textarea.entry.js +1 -1
- package/dist/esm-es5/ion-toast.entry.js +1 -1
- package/dist/esm-es5/ion-toggle.entry.js +1 -1
- package/dist/esm-es5/ionic.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/html.html-data.json +22 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-13405b29.entry.js +4 -0
- package/dist/ionic/p-13c363e4.entry.js +4 -0
- package/dist/ionic/p-22711da4.system.entry.js +4 -0
- package/dist/ionic/{p-7dad531c.system.entry.js → p-31692628.system.entry.js} +1 -1
- package/dist/ionic/{p-b4b44bf9.system.entry.js → p-35fde411.system.entry.js} +1 -1
- package/dist/ionic/{p-39a39279.entry.js → p-6e7d4537.entry.js} +1 -1
- package/dist/ionic/p-7b590e46.system.js +1 -1
- package/dist/ionic/{p-f84ea1e9.system.entry.js → p-984e02c3.system.entry.js} +1 -1
- package/dist/ionic/{p-c11fdca2.entry.js → p-a971dec3.entry.js} +1 -1
- package/dist/ionic/p-aad91b75.system.entry.js +4 -0
- package/dist/ionic/{p-201d8768.system.entry.js → p-c2c3807b.system.entry.js} +1 -1
- package/dist/ionic/p-c8453a83.entry.js +4 -0
- package/dist/ionic/p-de8e8567.entry.js +4 -0
- package/dist/types/components/input/input.d.ts +1 -0
- package/dist/types/components/textarea/textarea.d.ts +13 -2
- package/dist/types/components.d.ts +12 -4
- package/hydrate/index.js +66 -31
- package/package.json +1 -1
- package/dist/ionic/p-01ae1aa0.entry.js +0 -4
- package/dist/ionic/p-4346453b.entry.js +0 -4
- package/dist/ionic/p-56c72f65.system.entry.js +0 -4
- package/dist/ionic/p-7ab9c88c.system.entry.js +0 -4
- package/dist/ionic/p-8ac5efa9.entry.js +0 -4
- package/dist/ionic/p-a6bb62ea.entry.js +0 -4
|
@@ -1,3 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a pixels given value into rem
|
|
3
|
+
*
|
|
4
|
+
* @param pixels - Value in pixels to be converted (i.e. px)
|
|
5
|
+
* @param context (optional) - Baseline value
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Convert a font size to a dynamic font size.
|
|
9
|
+
* Fonts that participate in Dynamic Type should use
|
|
10
|
+
* dynamic font sizes.
|
|
11
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
12
|
+
* @param unit (optional) - The unit to convert to. Use this if you want to
|
|
13
|
+
* convert to a unit other than $baselineUnit.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Convert a font size to a dynamic font size but impose
|
|
17
|
+
* a maximum font size.
|
|
18
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
19
|
+
* @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
|
|
20
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
|
21
|
+
* convert to a unit other than $baselineUnit.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Convert a font size to a dynamic font size but impose
|
|
25
|
+
* a minimum font size.
|
|
26
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
27
|
+
* @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
|
|
28
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
|
29
|
+
* convert to a unit other than $baselineUnit.
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* Convert a font size to a dynamic font size but impose
|
|
33
|
+
* maximum and minimum font sizes.
|
|
34
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
35
|
+
* @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
|
|
36
|
+
* @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
|
|
37
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
|
38
|
+
* convert to a unit other than $baselineUnit.
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* A heuristic that applies CSS to tablet
|
|
42
|
+
* viewports.
|
|
43
|
+
*
|
|
44
|
+
* Usage:
|
|
45
|
+
* @include tablet-viewport() {
|
|
46
|
+
* :host {
|
|
47
|
+
* background-color: green;
|
|
48
|
+
* }
|
|
49
|
+
* }
|
|
50
|
+
*/
|
|
51
|
+
/**
|
|
52
|
+
* A heuristic that applies CSS to mobile
|
|
53
|
+
* viewports (i.e. phones, not tablets).
|
|
54
|
+
*
|
|
55
|
+
* Usage:
|
|
56
|
+
* @include mobile-viewport() {
|
|
57
|
+
* :host {
|
|
58
|
+
* background-color: blue;
|
|
59
|
+
* }
|
|
60
|
+
* }
|
|
61
|
+
*/
|
|
1
62
|
/**
|
|
2
63
|
* Convert a pixels given value into rem
|
|
3
64
|
*
|
|
@@ -111,27 +172,10 @@
|
|
|
111
172
|
display: block;
|
|
112
173
|
position: relative;
|
|
113
174
|
width: 100%;
|
|
114
|
-
min-height: 44px;
|
|
115
175
|
color: var(--color);
|
|
116
|
-
font-family: var(--ion-font-family, inherit);
|
|
117
|
-
z-index: 2;
|
|
118
176
|
box-sizing: border-box;
|
|
119
177
|
}
|
|
120
178
|
|
|
121
|
-
/**
|
|
122
|
-
* Since the label sits on top of the element,
|
|
123
|
-
* the component needs to be taller otherwise the
|
|
124
|
-
* label will appear too close to the textarea text.
|
|
125
|
-
* Also, floating and stacked labels should not
|
|
126
|
-
* push the label down since it it
|
|
127
|
-
* sits on top of the textarea.
|
|
128
|
-
*/
|
|
129
|
-
:host(.textarea-label-placement-floating),
|
|
130
|
-
:host(.textarea-label-placement-stacked) {
|
|
131
|
-
--padding-top: 0px;
|
|
132
|
-
min-height: 56px;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
179
|
/**
|
|
136
180
|
* When the cols property is set we should
|
|
137
181
|
* respect that width instead of defaulting
|
|
@@ -195,6 +239,7 @@
|
|
|
195
239
|
resize: none;
|
|
196
240
|
appearance: none;
|
|
197
241
|
}
|
|
242
|
+
|
|
198
243
|
.native-textarea::placeholder {
|
|
199
244
|
padding-left: 0;
|
|
200
245
|
padding-right: 0;
|
|
@@ -229,6 +274,7 @@
|
|
|
229
274
|
position: absolute;
|
|
230
275
|
pointer-events: none;
|
|
231
276
|
}
|
|
277
|
+
|
|
232
278
|
.cloned-input {
|
|
233
279
|
inset-inline-start: 0;
|
|
234
280
|
}
|
|
@@ -279,21 +325,10 @@
|
|
|
279
325
|
caret-color: var(--highlight-color);
|
|
280
326
|
}
|
|
281
327
|
|
|
282
|
-
.native-wrapper textarea {
|
|
283
|
-
-webkit-padding-start: 0px;
|
|
284
|
-
padding-inline-start: 0px;
|
|
285
|
-
-webkit-padding-end: 0px;
|
|
286
|
-
padding-inline-end: 0px;
|
|
287
|
-
padding-top: var(--padding-top);
|
|
288
|
-
padding-bottom: var(--padding-bottom);
|
|
289
|
-
}
|
|
290
|
-
|
|
291
328
|
.native-wrapper {
|
|
292
329
|
display: grid;
|
|
293
330
|
min-width: inherit;
|
|
294
331
|
max-width: inherit;
|
|
295
|
-
min-height: inherit;
|
|
296
|
-
max-height: inherit;
|
|
297
332
|
/**
|
|
298
333
|
* This avoids a WebKit bug where
|
|
299
334
|
* the height of the inner textarea
|
|
@@ -303,6 +338,7 @@
|
|
|
303
338
|
*/
|
|
304
339
|
grid-auto-rows: 100%;
|
|
305
340
|
}
|
|
341
|
+
|
|
306
342
|
.native-wrapper::after {
|
|
307
343
|
white-space: pre-wrap;
|
|
308
344
|
content: attr(data-replicated-value) " ";
|
|
@@ -364,21 +400,9 @@
|
|
|
364
400
|
}
|
|
365
401
|
|
|
366
402
|
.textarea-bottom {
|
|
367
|
-
/**
|
|
368
|
-
* The bottom content should take on the start and end
|
|
369
|
-
* padding so it is always aligned with either the label
|
|
370
|
-
* or the start of the textarea.
|
|
371
|
-
*/
|
|
372
|
-
-webkit-padding-start: var(--padding-start);
|
|
373
|
-
padding-inline-start: var(--padding-start);
|
|
374
|
-
-webkit-padding-end: var(--padding-end);
|
|
375
|
-
padding-inline-end: var(--padding-end);
|
|
376
|
-
padding-top: 5px;
|
|
377
|
-
padding-bottom: 0;
|
|
378
403
|
display: flex;
|
|
379
404
|
justify-content: space-between;
|
|
380
405
|
border-top: var(--border-width) var(--border-style) var(--border-color);
|
|
381
|
-
font-size: 0.75rem;
|
|
382
406
|
}
|
|
383
407
|
|
|
384
408
|
/**
|
|
@@ -421,9 +445,7 @@
|
|
|
421
445
|
*/
|
|
422
446
|
-webkit-margin-start: auto;
|
|
423
447
|
margin-inline-start: auto;
|
|
424
|
-
color: var(--ion-color-step-550, var(--ion-text-color-step-450, #737373));
|
|
425
448
|
white-space: nowrap;
|
|
426
|
-
padding-inline-start: 16px;
|
|
427
449
|
}
|
|
428
450
|
|
|
429
451
|
.label-text-wrapper {
|
|
@@ -498,20 +520,6 @@
|
|
|
498
520
|
flex-direction: row;
|
|
499
521
|
}
|
|
500
522
|
|
|
501
|
-
:host(.textarea-label-placement-start) .label-text-wrapper {
|
|
502
|
-
/**
|
|
503
|
-
* The margin between the label and
|
|
504
|
-
* the textarea should be on the end
|
|
505
|
-
* when the label sits at the start.
|
|
506
|
-
*/
|
|
507
|
-
-webkit-margin-start: 0;
|
|
508
|
-
margin-inline-start: 0;
|
|
509
|
-
-webkit-margin-end: 16px;
|
|
510
|
-
margin-inline-end: 16px;
|
|
511
|
-
margin-top: 0;
|
|
512
|
-
margin-bottom: 0;
|
|
513
|
-
}
|
|
514
|
-
|
|
515
523
|
/**
|
|
516
524
|
* Label is on the right of the textarea in LTR and
|
|
517
525
|
* on the left in RTL.
|
|
@@ -520,34 +528,6 @@
|
|
|
520
528
|
flex-direction: row-reverse;
|
|
521
529
|
}
|
|
522
530
|
|
|
523
|
-
/**
|
|
524
|
-
* The margin between the label and
|
|
525
|
-
* the textarea should be on the start
|
|
526
|
-
* when the label sits at the end.
|
|
527
|
-
*/
|
|
528
|
-
:host(.textarea-label-placement-end) .label-text-wrapper {
|
|
529
|
-
-webkit-margin-start: 16px;
|
|
530
|
-
margin-inline-start: 16px;
|
|
531
|
-
-webkit-margin-end: 0;
|
|
532
|
-
margin-inline-end: 0;
|
|
533
|
-
margin-top: 0;
|
|
534
|
-
margin-bottom: 0;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
:host(.textarea-label-placement-fixed) .label-text-wrapper {
|
|
538
|
-
/**
|
|
539
|
-
* The margin between the label and
|
|
540
|
-
* the textarea should be on the end
|
|
541
|
-
* when the label sits at the start.
|
|
542
|
-
*/
|
|
543
|
-
-webkit-margin-start: 0;
|
|
544
|
-
margin-inline-start: 0;
|
|
545
|
-
-webkit-margin-end: 16px;
|
|
546
|
-
margin-inline-end: 16px;
|
|
547
|
-
margin-top: 0;
|
|
548
|
-
margin-bottom: 0;
|
|
549
|
-
}
|
|
550
|
-
|
|
551
531
|
/**
|
|
552
532
|
* Label is on the left of the textarea in LTR and
|
|
553
533
|
* on the right in RTL. Label also has a fixed width.
|
|
@@ -594,6 +574,7 @@
|
|
|
594
574
|
*/
|
|
595
575
|
z-index: 2;
|
|
596
576
|
}
|
|
577
|
+
|
|
597
578
|
:host-context([dir=rtl]):host(.textarea-label-placement-stacked) .label-text-wrapper, :host-context([dir=rtl]).textarea-label-placement-stacked .label-text-wrapper, :host-context([dir=rtl]):host(.textarea-label-placement-floating) .label-text-wrapper, :host-context([dir=rtl]).textarea-label-placement-floating .label-text-wrapper {
|
|
598
579
|
transform-origin: right top;
|
|
599
580
|
}
|
|
@@ -603,7 +584,6 @@
|
|
|
603
584
|
transform-origin: right top;
|
|
604
585
|
}
|
|
605
586
|
}
|
|
606
|
-
|
|
607
587
|
/**
|
|
608
588
|
* Ensures the textarea does not
|
|
609
589
|
* overlap the label.
|
|
@@ -620,13 +600,6 @@
|
|
|
620
600
|
margin-bottom: 0px;
|
|
621
601
|
}
|
|
622
602
|
|
|
623
|
-
:host(.textarea-label-placement-stacked) ::slotted([slot=start]),
|
|
624
|
-
:host(.textarea-label-placement-stacked) ::slotted([slot=end]),
|
|
625
|
-
:host(.textarea-label-placement-floating) ::slotted([slot=start]),
|
|
626
|
-
:host(.textarea-label-placement-floating) ::slotted([slot=end]) {
|
|
627
|
-
margin-top: 8px;
|
|
628
|
-
}
|
|
629
|
-
|
|
630
603
|
/**
|
|
631
604
|
* This makes the label sit over the textarea
|
|
632
605
|
* when the textarea is blurred and has no value.
|
|
@@ -661,15 +634,122 @@
|
|
|
661
634
|
max-width: calc(100% / 0.75);
|
|
662
635
|
}
|
|
663
636
|
|
|
637
|
+
.start-slot-wrapper,
|
|
638
|
+
.end-slot-wrapper {
|
|
639
|
+
display: flex;
|
|
640
|
+
flex-shrink: 0;
|
|
641
|
+
align-self: start;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
:host {
|
|
645
|
+
min-height: 44px;
|
|
646
|
+
font-family: var(--ion-font-family, inherit);
|
|
647
|
+
z-index: 2;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* Since the label sits on top of the element,
|
|
652
|
+
* the component needs to be taller otherwise the
|
|
653
|
+
* label will appear too close to the textarea text.
|
|
654
|
+
* Also, floating and stacked labels should not
|
|
655
|
+
* push the label down since it it
|
|
656
|
+
* sits on top of the textarea.
|
|
657
|
+
*/
|
|
658
|
+
:host(.textarea-label-placement-floating),
|
|
659
|
+
:host(.textarea-label-placement-stacked) {
|
|
660
|
+
--padding-top: 0px;
|
|
661
|
+
min-height: 56px;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
.native-wrapper {
|
|
665
|
+
min-height: inherit;
|
|
666
|
+
max-height: inherit;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
.native-wrapper textarea {
|
|
670
|
+
-webkit-padding-start: 0px;
|
|
671
|
+
padding-inline-start: 0px;
|
|
672
|
+
-webkit-padding-end: 0px;
|
|
673
|
+
padding-inline-end: 0px;
|
|
674
|
+
padding-top: var(--padding-top);
|
|
675
|
+
padding-bottom: var(--padding-bottom);
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
.textarea-bottom {
|
|
679
|
+
/**
|
|
680
|
+
* The bottom content should take on the start and end
|
|
681
|
+
* padding so it is always aligned with either the label
|
|
682
|
+
* or the start of the textarea.
|
|
683
|
+
*/
|
|
684
|
+
-webkit-padding-start: var(--padding-start);
|
|
685
|
+
padding-inline-start: var(--padding-start);
|
|
686
|
+
-webkit-padding-end: var(--padding-end);
|
|
687
|
+
padding-inline-end: var(--padding-end);
|
|
688
|
+
padding-top: 5px;
|
|
689
|
+
padding-bottom: 0;
|
|
690
|
+
font-size: 0.75rem;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
.textarea-bottom .counter {
|
|
694
|
+
color: var(--ion-color-step-550, var(--ion-text-color-step-450, #737373));
|
|
695
|
+
padding-inline-start: 16px;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
:host(.textarea-label-placement-start) .label-text-wrapper {
|
|
699
|
+
/**
|
|
700
|
+
* The margin between the label and
|
|
701
|
+
* the textarea should be on the end
|
|
702
|
+
* when the label sits at the start.
|
|
703
|
+
*/
|
|
704
|
+
-webkit-margin-start: 0;
|
|
705
|
+
margin-inline-start: 0;
|
|
706
|
+
-webkit-margin-end: 16px;
|
|
707
|
+
margin-inline-end: 16px;
|
|
708
|
+
margin-top: 0;
|
|
709
|
+
margin-bottom: 0;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
/**
|
|
713
|
+
* The margin between the label and
|
|
714
|
+
* the textarea should be on the start
|
|
715
|
+
* when the label sits at the end.
|
|
716
|
+
*/
|
|
717
|
+
:host(.textarea-label-placement-end) .label-text-wrapper {
|
|
718
|
+
-webkit-margin-start: 16px;
|
|
719
|
+
margin-inline-start: 16px;
|
|
720
|
+
-webkit-margin-end: 0;
|
|
721
|
+
margin-inline-end: 0;
|
|
722
|
+
margin-top: 0;
|
|
723
|
+
margin-bottom: 0;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
:host(.textarea-label-placement-fixed) .label-text-wrapper {
|
|
727
|
+
/**
|
|
728
|
+
* The margin between the label and
|
|
729
|
+
* the textarea should be on the end
|
|
730
|
+
* when the label sits at the start.
|
|
731
|
+
*/
|
|
732
|
+
-webkit-margin-start: 0;
|
|
733
|
+
margin-inline-start: 0;
|
|
734
|
+
-webkit-margin-end: 16px;
|
|
735
|
+
margin-inline-end: 16px;
|
|
736
|
+
margin-top: 0;
|
|
737
|
+
margin-bottom: 0;
|
|
738
|
+
}
|
|
739
|
+
|
|
664
740
|
.start-slot-wrapper,
|
|
665
741
|
.end-slot-wrapper {
|
|
666
742
|
padding-left: 0;
|
|
667
743
|
padding-right: 0;
|
|
668
744
|
padding-top: var(--padding-top);
|
|
669
745
|
padding-bottom: var(--padding-bottom);
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
:host(.textarea-label-placement-stacked) ::slotted([slot=start]),
|
|
749
|
+
:host(.textarea-label-placement-stacked) ::slotted([slot=end]),
|
|
750
|
+
:host(.textarea-label-placement-floating) ::slotted([slot=start]),
|
|
751
|
+
:host(.textarea-label-placement-floating) ::slotted([slot=end]) {
|
|
752
|
+
margin-top: 8px;
|
|
673
753
|
}
|
|
674
754
|
|
|
675
755
|
::slotted([slot=start]),
|
|
@@ -91,6 +91,7 @@ export class Textarea {
|
|
|
91
91
|
this.label = undefined;
|
|
92
92
|
this.labelPlacement = 'start';
|
|
93
93
|
this.shape = undefined;
|
|
94
|
+
this.size = 'medium';
|
|
94
95
|
}
|
|
95
96
|
debounceChanged() {
|
|
96
97
|
const { ionInput, debounce, originalIonInput } = this;
|
|
@@ -274,6 +275,15 @@ export class Textarea {
|
|
|
274
275
|
get hasLabel() {
|
|
275
276
|
return this.label !== undefined || this.labelSlot !== null;
|
|
276
277
|
}
|
|
278
|
+
getShape() {
|
|
279
|
+
const theme = getIonTheme(this);
|
|
280
|
+
const { shape } = this;
|
|
281
|
+
// TODO(ROU-11050): Update theme check when shapes are defined for all themes.
|
|
282
|
+
if (theme === 'ionic' && shape === undefined) {
|
|
283
|
+
return 'round';
|
|
284
|
+
}
|
|
285
|
+
return shape;
|
|
286
|
+
}
|
|
277
287
|
/**
|
|
278
288
|
* Renders the border container when fill="outline".
|
|
279
289
|
*/
|
|
@@ -335,8 +345,9 @@ export class Textarea {
|
|
|
335
345
|
return (h("div", { class: "textarea-bottom" }, this.renderHintText(), this.renderCounter()));
|
|
336
346
|
}
|
|
337
347
|
render() {
|
|
338
|
-
const { inputId, disabled, fill,
|
|
348
|
+
const { inputId, disabled, fill, size, labelPlacement, el, hasFocus } = this;
|
|
339
349
|
const theme = getIonTheme(this);
|
|
350
|
+
const shape = this.getShape();
|
|
340
351
|
const value = this.getValue();
|
|
341
352
|
const inItem = hostContext('ion-item', this.el);
|
|
342
353
|
const shouldRenderHighlight = theme === 'md' && fill !== 'outline' && !inItem;
|
|
@@ -360,16 +371,27 @@ export class Textarea {
|
|
|
360
371
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
361
372
|
*/
|
|
362
373
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || hasFocus || hasStartEndSlots));
|
|
363
|
-
return (h(Host, { key: '
|
|
374
|
+
return (h(Host, { key: '25f8192436c242c227cdcec236dc376a6ad4331d', class: createColorClasses(this.color, {
|
|
364
375
|
[theme]: true,
|
|
365
376
|
'has-value': hasValue,
|
|
366
377
|
'has-focus': hasFocus,
|
|
367
378
|
'label-floating': labelShouldFloat,
|
|
368
379
|
[`textarea-fill-${fill}`]: fill !== undefined,
|
|
369
380
|
[`textarea-shape-${shape}`]: shape !== undefined,
|
|
381
|
+
[`textarea-size-${size}`]: true,
|
|
370
382
|
[`textarea-label-placement-${labelPlacement}`]: true,
|
|
371
383
|
'textarea-disabled': disabled,
|
|
372
|
-
}) }, h("label", { key: '
|
|
384
|
+
}) }, h("label", { key: 'cd1a80101c9cc5c1123005e9e3bfe1ff06e9a5d8', class: "textarea-wrapper", htmlFor: inputId }, this.renderLabelContainer(), h("div", { key: '68dffe868cdf170f0eab38e912a97c2374c82aaa', class: "textarea-wrapper-inner" },
|
|
385
|
+
/**
|
|
386
|
+
* For the ionic theme, we render the outline container here
|
|
387
|
+
* instead of higher up, so it can be positioned relative to
|
|
388
|
+
* the native wrapper instead of the <label> element or the
|
|
389
|
+
* entire component. This allows the label text to be positioned
|
|
390
|
+
* above the outline, while staying within the bounds of the
|
|
391
|
+
* <label> element, ensuring that clicking the label text
|
|
392
|
+
* focuses the textarea.
|
|
393
|
+
*/
|
|
394
|
+
theme === 'ionic' && fill === 'outline' && h("div", { key: 'eafeed172c5deafd3e28e8dbc8339b9ab3d06298', class: "textarea-outline" }), h("div", { key: 'dae967e2619efd99e40db41dfde375d162a772a4', class: "start-slot-wrapper" }, h("slot", { key: '4d5d48dcd842bec3effbab43fdcbbca137f01237', name: "start" })), h("div", { key: 'd3b11f95a4b76dd13363ed67279bd09be8776b71', class: "native-wrapper", ref: (el) => (this.textareaWrapper = el) }, h("textarea", Object.assign({ key: 'e86bd3b607b29b67ebcdbfa0b2e73417df786e1d', class: "native-textarea", ref: (el) => (this.nativeInput = el), id: inputId, disabled: disabled, autoCapitalize: this.autocapitalize, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, minLength: this.minlength, maxLength: this.maxlength, name: this.name, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, cols: this.cols, rows: this.rows, wrap: this.wrap, onInput: this.onInput, onChange: this.onChange, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.onKeyDown }, this.inheritedAttributes), value)), h("div", { key: 'ac0788d419f7b74d6a4f35cbd8e7ae78412380a6', class: "end-slot-wrapper" }, h("slot", { key: 'b409e7f30418b2e70f4dcb43f184be9032591089', name: "end" }))), shouldRenderHighlight && h("div", { key: '35f5928604c3a35962d08e99d4eeeedebb53a470', class: "textarea-highlight" })), this.renderBottomContent()));
|
|
373
395
|
}
|
|
374
396
|
static get is() { return "ion-textarea"; }
|
|
375
397
|
static get encapsulation() { return "scoped"; }
|
|
@@ -377,14 +399,14 @@ export class Textarea {
|
|
|
377
399
|
return {
|
|
378
400
|
"ios": ["textarea.ios.scss"],
|
|
379
401
|
"md": ["textarea.md.scss"],
|
|
380
|
-
"ionic": ["textarea.
|
|
402
|
+
"ionic": ["textarea.ionic.scss"]
|
|
381
403
|
};
|
|
382
404
|
}
|
|
383
405
|
static get styleUrls() {
|
|
384
406
|
return {
|
|
385
407
|
"ios": ["textarea.ios.css"],
|
|
386
408
|
"md": ["textarea.md.css"],
|
|
387
|
-
"ionic": ["textarea.
|
|
409
|
+
"ionic": ["textarea.ionic.css"]
|
|
388
410
|
};
|
|
389
411
|
}
|
|
390
412
|
static get properties() {
|
|
@@ -868,18 +890,36 @@ export class Textarea {
|
|
|
868
890
|
"type": "string",
|
|
869
891
|
"mutable": false,
|
|
870
892
|
"complexType": {
|
|
871
|
-
"original": "'round'",
|
|
872
|
-
"resolved": "\"round\" | undefined",
|
|
893
|
+
"original": "'soft' | 'round' | 'rectangular'",
|
|
894
|
+
"resolved": "\"rectangular\" | \"round\" | \"soft\" | undefined",
|
|
873
895
|
"references": {}
|
|
874
896
|
},
|
|
875
897
|
"required": false,
|
|
876
898
|
"optional": true,
|
|
877
899
|
"docs": {
|
|
878
900
|
"tags": [],
|
|
879
|
-
"text": "
|
|
901
|
+
"text": "Set to `\"soft\"` for a textarea with slightly rounded corners,\n`\"round\"` for a textarea with fully rounded corners, or `\"rectangular\"`\nfor a textarea without rounded corners.\n\nDefaults to `\"round\"` for the `ionic` theme, undefined for all other themes."
|
|
880
902
|
},
|
|
881
903
|
"attribute": "shape",
|
|
882
904
|
"reflect": false
|
|
905
|
+
},
|
|
906
|
+
"size": {
|
|
907
|
+
"type": "string",
|
|
908
|
+
"mutable": false,
|
|
909
|
+
"complexType": {
|
|
910
|
+
"original": "'small' | 'medium' | 'large'",
|
|
911
|
+
"resolved": "\"large\" | \"medium\" | \"small\" | undefined",
|
|
912
|
+
"references": {}
|
|
913
|
+
},
|
|
914
|
+
"required": false,
|
|
915
|
+
"optional": true,
|
|
916
|
+
"docs": {
|
|
917
|
+
"tags": [],
|
|
918
|
+
"text": "The size of the textarea. If \"large\" it will increase the height of the textarea, while\n\"small\" and \"medium\" provide progressively smaller heights. The default size is \"medium\".\nThis property only applies to the `\"ionic\"` theme."
|
|
919
|
+
},
|
|
920
|
+
"attribute": "size",
|
|
921
|
+
"reflect": false,
|
|
922
|
+
"defaultValue": "'medium'"
|
|
883
923
|
}
|
|
884
924
|
};
|
|
885
925
|
}
|