Skip to content

Commit abbcab6

Browse files
committed
Build dist files
1 parent 99a8be0 commit abbcab6

File tree

3 files changed

+37
-27
lines changed

3 files changed

+37
-27
lines changed

src/Autocomplete/assets/dist/controller.js

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
import { Controller } from '@hotwired/stimulus';
22
import TomSelect from 'tom-select';
33

4-
/*! *****************************************************************************
5-
Copyright (c) Microsoft Corporation.
6-
7-
Permission to use, copy, modify, and/or distribute this software for any
8-
purpose with or without fee is hereby granted.
9-
10-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
15-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16-
PERFORMANCE OF THIS SOFTWARE.
17-
***************************************************************************** */
18-
19-
function __classPrivateFieldGet(receiver, state, kind, f) {
20-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
21-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
22-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
4+
/******************************************************************************
5+
Copyright (c) Microsoft Corporation.
6+
7+
Permission to use, copy, modify, and/or distribute this software for any
8+
purpose with or without fee is hereby granted.
9+
10+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
15+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16+
PERFORMANCE OF THIS SOFTWARE.
17+
***************************************************************************** */
18+
19+
function __classPrivateFieldGet(receiver, state, kind, f) {
20+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
21+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
22+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
2323
}
2424

2525
var _instances, _getCommonConfig, _createAutocomplete, _createAutocompleteWithHtmlContents, _createAutocompleteWithRemoteData, _stripTags, _mergeObjects, _createTomSelect, _dispatchEvent;
@@ -42,6 +42,9 @@ class default_1 extends Controller {
4242
}
4343
this.tomSelect = __classPrivateFieldGet(this, _instances, "m", _createAutocomplete).call(this);
4444
}
45+
disconnect() {
46+
this.tomSelect.destroy();
47+
}
4548
get selectElement() {
4649
if (!(this.element instanceof HTMLSelectElement)) {
4750
return null;

src/React/Resources/assets/dist/render_controller.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var createRoot;
77
var m = require$$0;
88
if (process.env.NODE_ENV === 'production') {
99
createRoot = m.createRoot;
10+
m.hydrateRoot;
1011
} else {
1112
var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
1213
createRoot = function(c, o) {
@@ -21,23 +22,29 @@ if (process.env.NODE_ENV === 'production') {
2122

2223
class default_1 extends Controller {
2324
connect() {
24-
this._dispatchEvent('react:connect', { component: this.componentValue, props: this.propsValue });
25+
const props = this.propsValue ? this.propsValue : null;
26+
this._dispatchEvent('react:connect', { component: this.componentValue, props: props });
2527
const component = window.resolveReactComponent(this.componentValue);
26-
this._renderReactElement(React.createElement(component, this.propsValue, null));
28+
this._renderReactElement(React.createElement(component, props, null));
2729
this._dispatchEvent('react:mount', {
2830
componentName: this.componentValue,
2931
component: component,
30-
props: this.propsValue,
32+
props: props,
3133
});
3234
}
3335
disconnect() {
3436
this.element.root.unmount();
35-
this._dispatchEvent('react:unmount', { component: this.componentValue, props: this.propsValue });
37+
this._dispatchEvent('react:unmount', {
38+
component: this.componentValue,
39+
props: this.propsValue ? this.propsValue : null,
40+
});
3641
}
3742
_renderReactElement(reactElement) {
38-
const root = createRoot(this.element);
39-
root.render(reactElement);
40-
this.element.root = root;
43+
const element = this.element;
44+
if (!element.root) {
45+
element.root = createRoot(this.element);
46+
}
47+
element.root.render(reactElement);
4148
}
4249
_dispatchEvent(name, payload) {
4350
this.element.dispatchEvent(new CustomEvent(name, { detail: payload, bubbles: true }));

src/React/Resources/assets/src/render_controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default class extends Controller {
4646
}
4747

4848
_renderReactElement(reactElement: ReactElement) {
49-
const element: any = (this.element as any);
49+
const element: any = this.element as any;
5050

5151
// If a root has already been created for this element, reuse it
5252
if (!element.root) {

0 commit comments

Comments
 (0)