@sparkle-learning/core 0.0.54 → 0.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{PrivateRoute-e2047db2.js → PrivateRoute-f97245ce.js} +2 -2
- package/dist/cjs/{appdata.service-d28cf2d6.js → appdata.service-c8d71e05.js} +1 -1
- package/dist/cjs/assignment.service-690fb59c.js +19 -0
- package/dist/cjs/{facilitator.service-0b9f6ac7.js → facilitator.service-ff0e1659.js} +1 -1
- package/dist/cjs/{feed.service-6df9382f.js → feed.service-8eca4de6.js} +1 -1
- package/dist/cjs/header-mobile-collapse_61.cjs.entry.js +9 -9
- package/dist/cjs/{httpService-d8a5b474.js → httpService-d2e7bf8f.js} +1 -1
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/{ion-action-sheet_4.cjs.entry.js → ion-action-sheet_7.cjs.entry.js} +728 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{media.service-2bc73d37.js → media.service-8a1b9bc5.js} +1 -1
- package/dist/cjs/{signalR.service-0d5da1d3.js → signalR.service-bd6b42f9.js} +1 -1
- package/dist/cjs/sparkle-assignment.cjs.entry.js +90 -5
- package/dist/cjs/sparkle-core.cjs.js +1 -1
- package/dist/cjs/sparkle-discussion-questions_2.cjs.entry.js +2 -2
- package/dist/cjs/sparkle-facilitator-notes-form.cjs.entry.js +3 -3
- package/dist/cjs/sparkle-feed-post.cjs.entry.js +116 -0
- package/dist/cjs/sparkle-feedback.cjs.entry.js +3 -3
- package/dist/cjs/sparkle-file-upload.cjs.entry.js +53 -0
- package/dist/cjs/sparkle-goal-form.cjs.entry.js +4 -4
- package/dist/cjs/sparkle-input.cjs.entry.js +56 -0
- package/dist/cjs/{student.service-d8ec2551.js → student.service-7e5385be.js} +1 -1
- package/dist/cjs/{token.service-bfb0089b.js → token.service-7a41953d.js} +11 -0
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/sparkle-assignment/sparkle-assignment.css +27 -0
- package/dist/collection/components/sparkle-assignment/sparkle-assignment.js +141 -7
- package/dist/collection/components/sparkle-feed-post/sparkle-feed-post.js +2 -10
- package/dist/collection/components/sparkle-file-upload/sparkle-file-upload.css +0 -0
- package/dist/collection/components/sparkle-file-upload/sparkle-file-upload.js +105 -0
- package/dist/collection/components/sparkle-input/sparkle-input.css +0 -0
- package/dist/collection/components/sparkle-input/sparkle-input.js +212 -0
- package/dist/collection/services/token.service.js +11 -0
- package/dist/esm/{PrivateRoute-c6e80d5d.js → PrivateRoute-90ac95b8.js} +2 -2
- package/dist/esm/{appdata.service-d1058e00.js → appdata.service-2e84e167.js} +1 -1
- package/dist/esm/assignment.service-8d31f141.js +17 -0
- package/dist/esm/{facilitator.service-53e05a01.js → facilitator.service-18c47bdf.js} +1 -1
- package/dist/esm/{feed.service-8385ad7a.js → feed.service-b4f3cae4.js} +1 -1
- package/dist/esm/header-mobile-collapse_61.entry.js +10 -10
- package/dist/esm/{httpService-db476835.js → httpService-7986aeed.js} +2 -2
- package/dist/esm/index.js +4 -4
- package/dist/esm/{ion-action-sheet_4.entry.js → ion-action-sheet_7.entry.js} +729 -4
- package/dist/esm/ion-loading.entry.js +1 -1
- package/dist/esm/ion-menu.entry.js +1 -1
- package/dist/esm/ion-modal.entry.js +1 -1
- package/dist/esm/ion-picker.entry.js +1 -1
- package/dist/esm/ion-toast.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{media.service-b68cbfff.js → media.service-6e90bc41.js} +1 -1
- package/dist/esm/{overlays-3b4dca92.js → overlays-4233a39d.js} +1 -1
- package/dist/esm/{signalR.service-4a2d5a92.js → signalR.service-c33fba50.js} +1 -1
- package/dist/esm/sparkle-assignment.entry.js +91 -6
- package/dist/esm/sparkle-core.js +1 -1
- package/dist/esm/sparkle-discussion-questions_2.entry.js +2 -2
- package/dist/esm/sparkle-facilitator-notes-form.entry.js +4 -4
- package/dist/esm/sparkle-feed-post.entry.js +112 -0
- package/dist/esm/sparkle-feedback.entry.js +4 -4
- package/dist/esm/sparkle-file-upload.entry.js +49 -0
- package/dist/esm/sparkle-goal-form.entry.js +5 -5
- package/dist/esm/sparkle-input.entry.js +52 -0
- package/dist/esm/{student.service-6457aaa0.js → student.service-08af124f.js} +1 -1
- package/dist/esm/{token.service-20f1a256.js → token.service-71a5d33f.js} +11 -0
- package/dist/sparkle-core/index.esm.js +1 -1
- package/dist/sparkle-core/p-08420531.entry.js +1 -0
- package/dist/sparkle-core/p-08cca80d.entry.js +1 -0
- package/dist/sparkle-core/p-0e8e539f.entry.js +1 -0
- package/dist/sparkle-core/{p-11ac00b0.js → p-1adc98f6.js} +1 -1
- package/dist/sparkle-core/{p-71720d6e.entry.js → p-38c842d5.entry.js} +1 -1
- package/dist/sparkle-core/{p-38f707fb.js → p-39a31e43.js} +1 -1
- package/dist/sparkle-core/{p-6a1fc0af.entry.js → p-3daf2915.entry.js} +1 -1
- package/dist/sparkle-core/{p-dcff298d.entry.js → p-42ed7d5f.entry.js} +1 -1
- package/dist/sparkle-core/{p-6fab3a4b.js → p-4b4a8703.js} +1 -1
- package/dist/sparkle-core/{p-98f7780c.entry.js → p-4d1cfcbe.entry.js} +1 -1
- package/dist/sparkle-core/p-4fba3e4c.js +1 -0
- package/dist/sparkle-core/{p-54dd894f.entry.js → p-6bde0192.entry.js} +1 -1
- package/dist/sparkle-core/{p-6faa194c.entry.js → p-6d2f4093.entry.js} +1 -1
- package/dist/sparkle-core/{p-ed9de327.js → p-7dae0f0e.js} +1 -1
- package/dist/sparkle-core/p-973fe404.entry.js +22 -0
- package/dist/sparkle-core/{p-967a2ed7.js → p-b06e2bef.js} +1 -1
- package/dist/sparkle-core/{p-e863bf1d.entry.js → p-b6fec622.entry.js} +1 -1
- package/dist/sparkle-core/{p-630a4fa0.js → p-b8d71ff4.js} +1 -1
- package/dist/sparkle-core/{p-17b6b07e.js → p-c9f753a4.js} +1 -1
- package/dist/sparkle-core/{p-d51f30ca.js → p-da391f3f.js} +1 -1
- package/dist/sparkle-core/{p-38fa5987.js → p-e0cad1bb.js} +1 -1
- package/dist/sparkle-core/{p-ce4b22f7.entry.js → p-f196c124.entry.js} +1 -1
- package/dist/sparkle-core/p-f47fe1fe.entry.js +1 -0
- package/dist/sparkle-core/{p-e50c8b04.entry.js → p-f714f77a.entry.js} +1 -1
- package/dist/sparkle-core/{p-377b04c2.entry.js → p-ff080f82.entry.js} +1 -1
- package/dist/sparkle-core/{p-2ff67662.js → p-ff7a8a71.js} +1 -1
- package/dist/sparkle-core/sparkle-core.esm.js +1 -1
- package/dist/types/components/sparkle-assignment/sparkle-assignment.d.ts +11 -1
- package/dist/types/components/sparkle-feed-post/sparkle-feed-post.d.ts +1 -1
- package/dist/types/components/sparkle-file-upload/sparkle-file-upload.d.ts +15 -0
- package/dist/types/components/sparkle-input/sparkle-input.d.ts +23 -0
- package/dist/types/components.d.ts +62 -0
- package/dist/types/services/token.service.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/ion-select_3.cjs.entry.js +0 -627
- package/dist/cjs/ion-textarea.cjs.entry.js +0 -248
- package/dist/esm/ion-select_3.entry.js +0 -621
- package/dist/esm/ion-textarea.entry.js +0 -244
- package/dist/sparkle-core/p-0f1c5899.entry.js +0 -18
- package/dist/sparkle-core/p-33a7151d.entry.js +0 -1
- package/dist/sparkle-core/p-641bfc92.entry.js +0 -1
- package/dist/sparkle-core/p-ca907214.entry.js +0 -4
@@ -1,248 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
-
|
5
|
-
const index = require('./index-51e8292e.js');
|
6
|
-
const ionicGlobal = require('./ionic-global-2cde9d3a.js');
|
7
|
-
const helpers = require('./helpers-c2496722.js');
|
8
|
-
const theme = require('./theme-b0b295c1.js');
|
9
|
-
|
10
|
-
const textareaIosCss = ".sc-ion-textarea-ios-h{--background:initial;--color:initial;--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:0.5;--padding-top:0;--padding-end:0;--padding-bottom:0;--padding-start:0;--border-radius:0;display:block;position:relative;flex:1;width:100%;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);white-space:pre-wrap;z-index:2;box-sizing:border-box}.ion-color.sc-ion-textarea-ios-h{background:initial}.ion-color.sc-ion-textarea-ios-h{color:var(--ion-color-base)}ion-item.sc-ion-textarea-ios-h,ion-item .sc-ion-textarea-ios-h{align-self:baseline}ion-item.sc-ion-textarea-ios-h:not(.item-label),ion-item:not(.item-label) .sc-ion-textarea-ios-h{--padding-start:0}.textarea-wrapper.sc-ion-textarea-ios{display:grid;min-width:inherit;max-width:inherit;min-height:inherit;max-height:inherit}.textarea-wrapper.sc-ion-textarea-ios::after{white-space:pre-wrap;content:attr(data-replicated-value) \" \";visibility:hidden}.native-textarea.sc-ion-textarea-ios,.textarea-wrapper.sc-ion-textarea-ios::after{padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;grid-area:1/1/2/2}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.native-textarea.sc-ion-textarea-ios,.textarea-wrapper.sc-ion-textarea-ios::after{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.native-textarea.sc-ion-textarea-ios{border-radius:var(--border-radius);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:100%;max-width:100%;max-height:100%;border:0;outline:none;background:transparent;box-sizing:border-box;resize:none;appearance:none;overflow:hidden}.native-textarea.sc-ion-textarea-ios::placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea[disabled].sc-ion-textarea-ios{opacity:0.4}.cloned-input.sc-ion-textarea-ios{left:0;top:0;position:absolute;pointer-events:none}[dir=rtl].sc-ion-textarea-ios .cloned-input.sc-ion-textarea-ios,[dir=rtl].sc-ion-textarea-ios-h .cloned-input.sc-ion-textarea-ios,[dir=rtl] .sc-ion-textarea-ios-h .cloned-input.sc-ion-textarea-ios{left:unset;right:unset;right:0}[auto-grow].sc-ion-textarea-ios-h .cloned-input.sc-ion-textarea-ios{height:100%}.item-label-floating.item-has-placeholder.sc-ion-textarea-ios-h:not(.item-has-value),.item-label-floating.item-has-placeholder:not(.item-has-value) .sc-ion-textarea-ios-h{opacity:0}.item-label-floating.item-has-placeholder.sc-ion-textarea-ios-h:not(.item-has-value).item-has-focus,.item-label-floating.item-has-placeholder:not(.item-has-value).item-has-focus .sc-ion-textarea-ios-h{transition:opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);opacity:1}.sc-ion-textarea-ios-h{--padding-top:10px;--padding-end:10px;--padding-bottom:10px;--padding-start:0;font-size:inherit}.item-label-stacked.sc-ion-textarea-ios-h,.item-label-stacked .sc-ion-textarea-ios-h,.item-label-floating.sc-ion-textarea-ios-h,.item-label-floating .sc-ion-textarea-ios-h{--padding-top:8px;--padding-bottom:8px;--padding-start:0px}";
|
11
|
-
|
12
|
-
const textareaMdCss = ".sc-ion-textarea-md-h{--background:initial;--color:initial;--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:0.5;--padding-top:0;--padding-end:0;--padding-bottom:0;--padding-start:0;--border-radius:0;display:block;position:relative;flex:1;width:100%;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);white-space:pre-wrap;z-index:2;box-sizing:border-box}.ion-color.sc-ion-textarea-md-h{background:initial}.ion-color.sc-ion-textarea-md-h{color:var(--ion-color-base)}ion-item.sc-ion-textarea-md-h,ion-item .sc-ion-textarea-md-h{align-self:baseline}ion-item.sc-ion-textarea-md-h:not(.item-label),ion-item:not(.item-label) .sc-ion-textarea-md-h{--padding-start:0}.textarea-wrapper.sc-ion-textarea-md{display:grid;min-width:inherit;max-width:inherit;min-height:inherit;max-height:inherit}.textarea-wrapper.sc-ion-textarea-md::after{white-space:pre-wrap;content:attr(data-replicated-value) \" \";visibility:hidden}.native-textarea.sc-ion-textarea-md,.textarea-wrapper.sc-ion-textarea-md::after{padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;grid-area:1/1/2/2}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.native-textarea.sc-ion-textarea-md,.textarea-wrapper.sc-ion-textarea-md::after{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.native-textarea.sc-ion-textarea-md{border-radius:var(--border-radius);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:100%;max-width:100%;max-height:100%;border:0;outline:none;background:transparent;box-sizing:border-box;resize:none;appearance:none;overflow:hidden}.native-textarea.sc-ion-textarea-md::placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea[disabled].sc-ion-textarea-md{opacity:0.4}.cloned-input.sc-ion-textarea-md{left:0;top:0;position:absolute;pointer-events:none}[dir=rtl].sc-ion-textarea-md .cloned-input.sc-ion-textarea-md,[dir=rtl].sc-ion-textarea-md-h .cloned-input.sc-ion-textarea-md,[dir=rtl] .sc-ion-textarea-md-h .cloned-input.sc-ion-textarea-md{left:unset;right:unset;right:0}[auto-grow].sc-ion-textarea-md-h .cloned-input.sc-ion-textarea-md{height:100%}.item-label-floating.item-has-placeholder.sc-ion-textarea-md-h:not(.item-has-value),.item-label-floating.item-has-placeholder:not(.item-has-value) .sc-ion-textarea-md-h{opacity:0}.item-label-floating.item-has-placeholder.sc-ion-textarea-md-h:not(.item-has-value).item-has-focus,.item-label-floating.item-has-placeholder:not(.item-has-value).item-has-focus .sc-ion-textarea-md-h{transition:opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);opacity:1}.sc-ion-textarea-md-h{--padding-top:10px;--padding-end:0;--padding-bottom:11px;--padding-start:8px;margin-left:0;margin-right:0;margin-top:8px;margin-bottom:0;font-size:inherit}.item-label-stacked.sc-ion-textarea-md-h,.item-label-stacked .sc-ion-textarea-md-h,.item-label-floating.sc-ion-textarea-md-h,.item-label-floating .sc-ion-textarea-md-h{--padding-top:8px;--padding-bottom:8px;--padding-start:0}";
|
13
|
-
|
14
|
-
const Textarea = class {
|
15
|
-
constructor(hostRef) {
|
16
|
-
index.registerInstance(this, hostRef);
|
17
|
-
this.ionChange = index.createEvent(this, "ionChange", 7);
|
18
|
-
this.ionInput = index.createEvent(this, "ionInput", 7);
|
19
|
-
this.ionStyle = index.createEvent(this, "ionStyle", 7);
|
20
|
-
this.ionBlur = index.createEvent(this, "ionBlur", 7);
|
21
|
-
this.ionFocus = index.createEvent(this, "ionFocus", 7);
|
22
|
-
this.inputId = `ion-textarea-${textareaIds++}`;
|
23
|
-
this.didBlurAfterEdit = false;
|
24
|
-
this.inheritedAttributes = {};
|
25
|
-
/**
|
26
|
-
* This is required for a WebKit bug which requires us to
|
27
|
-
* blur and focus an input to properly focus the input in
|
28
|
-
* an item with delegatesFocus. It will no longer be needed
|
29
|
-
* with iOS 14.
|
30
|
-
*
|
31
|
-
* @internal
|
32
|
-
*/
|
33
|
-
this.fireFocusEvents = true;
|
34
|
-
this.hasFocus = false;
|
35
|
-
/**
|
36
|
-
* Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.
|
37
|
-
* Available options: `"off"`, `"none"`, `"on"`, `"sentences"`, `"words"`, `"characters"`.
|
38
|
-
*/
|
39
|
-
this.autocapitalize = 'none';
|
40
|
-
/**
|
41
|
-
* This Boolean attribute lets you specify that a form control should have input focus when the page loads.
|
42
|
-
*/
|
43
|
-
this.autofocus = false;
|
44
|
-
/**
|
45
|
-
* If `true`, the value will be cleared after focus upon edit. Defaults to `true` when `type` is `"password"`, `false` for all other types.
|
46
|
-
*/
|
47
|
-
this.clearOnEdit = false;
|
48
|
-
/**
|
49
|
-
* Set the amount of time, in milliseconds, to wait to trigger the `ionChange` event after each keystroke. This also impacts form bindings such as `ngModel` or `v-model`.
|
50
|
-
*/
|
51
|
-
this.debounce = 0;
|
52
|
-
/**
|
53
|
-
* If `true`, the user cannot interact with the textarea.
|
54
|
-
*/
|
55
|
-
this.disabled = false;
|
56
|
-
/**
|
57
|
-
* The name of the control, which is submitted with the form data.
|
58
|
-
*/
|
59
|
-
this.name = this.inputId;
|
60
|
-
/**
|
61
|
-
* If `true`, the user cannot modify the value.
|
62
|
-
*/
|
63
|
-
this.readonly = false;
|
64
|
-
/**
|
65
|
-
* If `true`, the user must fill in a value before submitting a form.
|
66
|
-
*/
|
67
|
-
this.required = false;
|
68
|
-
/**
|
69
|
-
* If `true`, the element will have its spelling and grammar checked.
|
70
|
-
*/
|
71
|
-
this.spellcheck = false;
|
72
|
-
/**
|
73
|
-
* If `true`, the textarea container will grow and shrink based
|
74
|
-
* on the contents of the textarea.
|
75
|
-
*/
|
76
|
-
this.autoGrow = false;
|
77
|
-
/**
|
78
|
-
* The value of the textarea.
|
79
|
-
*/
|
80
|
-
this.value = '';
|
81
|
-
this.onInput = (ev) => {
|
82
|
-
if (this.nativeInput) {
|
83
|
-
this.value = this.nativeInput.value;
|
84
|
-
}
|
85
|
-
this.emitStyle();
|
86
|
-
this.ionInput.emit(ev);
|
87
|
-
};
|
88
|
-
this.onFocus = (ev) => {
|
89
|
-
this.hasFocus = true;
|
90
|
-
this.focusChange();
|
91
|
-
if (this.fireFocusEvents) {
|
92
|
-
this.ionFocus.emit(ev);
|
93
|
-
}
|
94
|
-
};
|
95
|
-
this.onBlur = (ev) => {
|
96
|
-
this.hasFocus = false;
|
97
|
-
this.focusChange();
|
98
|
-
if (this.fireFocusEvents) {
|
99
|
-
this.ionBlur.emit(ev);
|
100
|
-
}
|
101
|
-
};
|
102
|
-
this.onKeyDown = () => {
|
103
|
-
this.checkClearOnEdit();
|
104
|
-
};
|
105
|
-
}
|
106
|
-
debounceChanged() {
|
107
|
-
this.ionChange = helpers.debounceEvent(this.ionChange, this.debounce);
|
108
|
-
}
|
109
|
-
disabledChanged() {
|
110
|
-
this.emitStyle();
|
111
|
-
}
|
112
|
-
/**
|
113
|
-
* Update the native input element when the value changes
|
114
|
-
*/
|
115
|
-
valueChanged() {
|
116
|
-
const nativeInput = this.nativeInput;
|
117
|
-
const value = this.getValue();
|
118
|
-
if (nativeInput && nativeInput.value !== value) {
|
119
|
-
nativeInput.value = value;
|
120
|
-
}
|
121
|
-
this.runAutoGrow();
|
122
|
-
this.emitStyle();
|
123
|
-
this.ionChange.emit({ value });
|
124
|
-
}
|
125
|
-
connectedCallback() {
|
126
|
-
this.emitStyle();
|
127
|
-
this.debounceChanged();
|
128
|
-
{
|
129
|
-
document.dispatchEvent(new CustomEvent('ionInputDidLoad', {
|
130
|
-
detail: this.el,
|
131
|
-
}));
|
132
|
-
}
|
133
|
-
}
|
134
|
-
disconnectedCallback() {
|
135
|
-
{
|
136
|
-
document.dispatchEvent(new CustomEvent('ionInputDidUnload', {
|
137
|
-
detail: this.el,
|
138
|
-
}));
|
139
|
-
}
|
140
|
-
}
|
141
|
-
componentWillLoad() {
|
142
|
-
this.inheritedAttributes = Object.assign(Object.assign({}, helpers.inheritAriaAttributes(this.el)), helpers.inheritAttributes(this.el, ['title']));
|
143
|
-
}
|
144
|
-
componentDidLoad() {
|
145
|
-
this.runAutoGrow();
|
146
|
-
}
|
147
|
-
/**
|
148
|
-
* Sets focus on the native `textarea` in `ion-textarea`. Use this method instead of the global
|
149
|
-
* `textarea.focus()`.
|
150
|
-
*/
|
151
|
-
async setFocus() {
|
152
|
-
if (this.nativeInput) {
|
153
|
-
this.nativeInput.focus();
|
154
|
-
}
|
155
|
-
}
|
156
|
-
/**
|
157
|
-
* Sets blur on the native `textarea` in `ion-textarea`. Use this method instead of the global
|
158
|
-
* `textarea.blur()`.
|
159
|
-
* @internal
|
160
|
-
*/
|
161
|
-
async setBlur() {
|
162
|
-
if (this.nativeInput) {
|
163
|
-
this.nativeInput.blur();
|
164
|
-
}
|
165
|
-
}
|
166
|
-
/**
|
167
|
-
* Returns the native `<textarea>` element used under the hood.
|
168
|
-
*/
|
169
|
-
getInputElement() {
|
170
|
-
return Promise.resolve(this.nativeInput);
|
171
|
-
}
|
172
|
-
emitStyle() {
|
173
|
-
this.ionStyle.emit({
|
174
|
-
interactive: true,
|
175
|
-
textarea: true,
|
176
|
-
input: true,
|
177
|
-
'interactive-disabled': this.disabled,
|
178
|
-
'has-placeholder': this.placeholder !== undefined,
|
179
|
-
'has-value': this.hasValue(),
|
180
|
-
'has-focus': this.hasFocus,
|
181
|
-
});
|
182
|
-
}
|
183
|
-
runAutoGrow() {
|
184
|
-
if (this.nativeInput && this.autoGrow) {
|
185
|
-
index.writeTask(() => {
|
186
|
-
var _a;
|
187
|
-
if (this.textareaWrapper) {
|
188
|
-
// Replicated value is an attribute to be used in the stylesheet
|
189
|
-
// to set the inner contents of a pseudo element.
|
190
|
-
this.textareaWrapper.dataset.replicatedValue = (_a = this.value) !== null && _a !== void 0 ? _a : '';
|
191
|
-
}
|
192
|
-
});
|
193
|
-
}
|
194
|
-
}
|
195
|
-
/**
|
196
|
-
* Check if we need to clear the text input if clearOnEdit is enabled
|
197
|
-
*/
|
198
|
-
checkClearOnEdit() {
|
199
|
-
if (!this.clearOnEdit) {
|
200
|
-
return;
|
201
|
-
}
|
202
|
-
// Did the input value change after it was blurred and edited?
|
203
|
-
if (this.didBlurAfterEdit && this.hasValue()) {
|
204
|
-
// Clear the input
|
205
|
-
this.value = '';
|
206
|
-
}
|
207
|
-
// Reset the flag
|
208
|
-
this.didBlurAfterEdit = false;
|
209
|
-
}
|
210
|
-
focusChange() {
|
211
|
-
// If clearOnEdit is enabled and the input blurred but has a value, set a flag
|
212
|
-
if (this.clearOnEdit && !this.hasFocus && this.hasValue()) {
|
213
|
-
this.didBlurAfterEdit = true;
|
214
|
-
}
|
215
|
-
this.emitStyle();
|
216
|
-
}
|
217
|
-
hasValue() {
|
218
|
-
return this.getValue() !== '';
|
219
|
-
}
|
220
|
-
getValue() {
|
221
|
-
return this.value || '';
|
222
|
-
}
|
223
|
-
render() {
|
224
|
-
const mode = ionicGlobal.getIonMode(this);
|
225
|
-
const value = this.getValue();
|
226
|
-
const labelId = this.inputId + '-lbl';
|
227
|
-
const label = helpers.findItemLabel(this.el);
|
228
|
-
if (label) {
|
229
|
-
label.id = labelId;
|
230
|
-
}
|
231
|
-
return (index.h(index.Host, { "aria-disabled": this.disabled ? 'true' : null, class: theme.createColorClasses(this.color, {
|
232
|
-
[mode]: true,
|
233
|
-
}) }, index.h("div", { class: "textarea-wrapper", ref: (el) => (this.textareaWrapper = el) }, index.h("textarea", Object.assign({ class: "native-textarea", "aria-labelledby": label ? labelId : null, ref: (el) => (this.nativeInput = el), autoCapitalize: this.autocapitalize, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, disabled: this.disabled, maxLength: this.maxlength, minLength: this.minlength, 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, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.onKeyDown }, this.inheritedAttributes), value))));
|
234
|
-
}
|
235
|
-
get el() { return index.getElement(this); }
|
236
|
-
static get watchers() { return {
|
237
|
-
"debounce": ["debounceChanged"],
|
238
|
-
"disabled": ["disabledChanged"],
|
239
|
-
"value": ["valueChanged"]
|
240
|
-
}; }
|
241
|
-
};
|
242
|
-
let textareaIds = 0;
|
243
|
-
Textarea.style = {
|
244
|
-
ios: textareaIosCss,
|
245
|
-
md: textareaMdCss
|
246
|
-
};
|
247
|
-
|
248
|
-
exports.ion_textarea = Textarea;
|