@fluixi/web-components 0.0.0-stage → 1.0.0-alpha.100

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.
Files changed (59) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +31 -2
  3. package/dist/context.cjs +162 -0
  4. package/dist/context.d.ts +65 -0
  5. package/dist/context.d.ts.map +1 -0
  6. package/dist/context.js +192 -0
  7. package/dist/context.mjs +141 -0
  8. package/dist/element.cjs +847 -0
  9. package/dist/element.d.ts +213 -0
  10. package/dist/element.d.ts.map +1 -0
  11. package/dist/element.js +681 -0
  12. package/dist/element.mjs +835 -0
  13. package/dist/events.cjs +35 -0
  14. package/dist/events.d.ts +24 -0
  15. package/dist/events.d.ts.map +1 -0
  16. package/dist/events.js +20 -0
  17. package/dist/events.mjs +14 -0
  18. package/dist/focus.cjs +156 -0
  19. package/dist/focus.d.ts +34 -0
  20. package/dist/focus.d.ts.map +1 -0
  21. package/dist/focus.js +185 -0
  22. package/dist/focus.mjs +135 -0
  23. package/dist/form.cjs +145 -0
  24. package/dist/form.d.ts +33 -0
  25. package/dist/form.d.ts.map +1 -0
  26. package/dist/form.js +113 -0
  27. package/dist/form.mjs +125 -0
  28. package/dist/index.cjs +1202 -0
  29. package/dist/index.d.ts +41 -0
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.js +31 -0
  32. package/dist/index.mjs +1188 -0
  33. package/dist/props.cjs +114 -0
  34. package/dist/props.d.ts +93 -0
  35. package/dist/props.d.ts.map +1 -0
  36. package/dist/props.js +99 -0
  37. package/dist/props.mjs +93 -0
  38. package/dist/registry.cjs +77 -0
  39. package/dist/registry.d.ts +26 -0
  40. package/dist/registry.d.ts.map +1 -0
  41. package/dist/registry.js +91 -0
  42. package/dist/registry.mjs +56 -0
  43. package/dist/styles.cjs +59 -0
  44. package/dist/styles.d.ts +17 -0
  45. package/dist/styles.d.ts.map +1 -0
  46. package/dist/styles.js +53 -0
  47. package/dist/styles.mjs +38 -0
  48. package/dist/targets.cjs +42 -0
  49. package/dist/targets.d.ts +26 -0
  50. package/dist/targets.d.ts.map +1 -0
  51. package/dist/targets.js +35 -0
  52. package/dist/targets.mjs +21 -0
  53. package/dist/tsconfig.lib.tsbuildinfo +1 -0
  54. package/dist/types.cjs +18 -0
  55. package/dist/types.d.ts +78 -0
  56. package/dist/types.d.ts.map +1 -0
  57. package/dist/types.js +1 -0
  58. package/dist/types.mjs +0 -0
  59. package/package.json +53 -3
package/dist/form.cjs ADDED
@@ -0,0 +1,145 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __typeError = (msg) => {
7
+ throw TypeError(msg);
8
+ };
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
23
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
24
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
25
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
26
+ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
27
+
28
+ // src/form.ts
29
+ var form_exports = {};
30
+ __export(form_exports, {
31
+ FormAssociated: () => FormAssociated
32
+ });
33
+ module.exports = __toCommonJS(form_exports);
34
+ var import_signal = require("@fluixi/reactive/signal");
35
+ function FormAssociated(Base) {
36
+ var _formDisabled, _flags, _message, _anchor, _custom, _FormAssociatedElement_instances, applyValidity_fn;
37
+ const _FormAssociatedElement = class _FormAssociatedElement extends Base {
38
+ constructor() {
39
+ super(...arguments);
40
+ __privateAdd(this, _FormAssociatedElement_instances);
41
+ __privateAdd(this, _formDisabled, (0, import_signal.signal)(false));
42
+ /** The last validity the subclass set, kept so a custom message can be laid over it and lifted. */
43
+ __privateAdd(this, _flags, {});
44
+ __privateAdd(this, _message, "");
45
+ __privateAdd(this, _anchor);
46
+ __privateAdd(this, _custom, "");
47
+ }
48
+ /** The form this control belongs to, like `input.form`. */
49
+ get form() {
50
+ return this.internals.form;
51
+ }
52
+ /** The `<label>`s that name this control. */
53
+ get labels() {
54
+ return this.internals.labels;
55
+ }
56
+ /** The key the value is submitted under: the `name` attribute, as on an input. */
57
+ get name() {
58
+ return this.getAttribute("name") ?? "";
59
+ }
60
+ set name(value) {
61
+ this.setAttribute("name", value);
62
+ }
63
+ get validity() {
64
+ return this.internals.validity;
65
+ }
66
+ get validationMessage() {
67
+ return this.internals.validationMessage;
68
+ }
69
+ get willValidate() {
70
+ return this.internals.willValidate;
71
+ }
72
+ checkValidity() {
73
+ return this.internals.checkValidity();
74
+ }
75
+ reportValidity() {
76
+ return this.internals.reportValidity();
77
+ }
78
+ /** As on an input: a non-empty message makes the control invalid until it is cleared. */
79
+ setCustomValidity(message) {
80
+ __privateSet(this, _custom, message);
81
+ __privateMethod(this, _FormAssociatedElement_instances, applyValidity_fn).call(this);
82
+ }
83
+ /**
84
+ * Whether a disabled `<fieldset>` or form covers this control. Reactive: read it in a
85
+ * binding and the control follows. A disabled control is also left out of `FormData`.
86
+ */
87
+ get formDisabled() {
88
+ return __privateGet(this, _formDisabled).call(this);
89
+ }
90
+ /** What the form submits for this control. `null` submits nothing. */
91
+ setFormValue(value, state) {
92
+ this.internals.setFormValue(value, state);
93
+ }
94
+ /**
95
+ * The control's own validity: `{ valueMissing: true }` and a message, or `{}` when valid.
96
+ * `anchor` is the inner element the browser points its bubble at.
97
+ */
98
+ setValidity(flags, message = "", anchor) {
99
+ __privateSet(this, _flags, flags);
100
+ __privateSet(this, _message, message);
101
+ __privateSet(this, _anchor, anchor);
102
+ __privateMethod(this, _FormAssociatedElement_instances, applyValidity_fn).call(this);
103
+ }
104
+ /** Put the value back to what the page wrote. Called when the form resets. */
105
+ resetValue() {
106
+ }
107
+ /** Take back a value the browser saved, on back/forward navigation or autofill. */
108
+ restoreValue(_state, _mode) {
109
+ }
110
+ formAssociatedCallback(form) {
111
+ up(_FormAssociatedElement).formAssociatedCallback?.call(this, form);
112
+ }
113
+ formDisabledCallback(disabled) {
114
+ up(_FormAssociatedElement).formDisabledCallback?.call(this, disabled);
115
+ __privateGet(this, _formDisabled).set(disabled);
116
+ }
117
+ formResetCallback() {
118
+ up(_FormAssociatedElement).formResetCallback?.call(this);
119
+ this.setCustomValidity("");
120
+ this.resetValue();
121
+ }
122
+ formStateRestoreCallback(state, mode) {
123
+ up(_FormAssociatedElement).formStateRestoreCallback?.call(this, state, mode);
124
+ this.restoreValue(state, mode);
125
+ }
126
+ };
127
+ _formDisabled = new WeakMap();
128
+ _flags = new WeakMap();
129
+ _message = new WeakMap();
130
+ _anchor = new WeakMap();
131
+ _custom = new WeakMap();
132
+ _FormAssociatedElement_instances = new WeakSet();
133
+ applyValidity_fn = function() {
134
+ if (typeof this.internals.setValidity !== "function") return;
135
+ if (__privateGet(this, _custom)) this.internals.setValidity({ ...__privateGet(this, _flags), customError: true }, __privateGet(this, _custom), __privateGet(this, _anchor));
136
+ else if (Object.values(__privateGet(this, _flags)).some(Boolean)) this.internals.setValidity(__privateGet(this, _flags), __privateGet(this, _message), __privateGet(this, _anchor));
137
+ else this.internals.setValidity({});
138
+ };
139
+ _FormAssociatedElement.formAssociated = true;
140
+ let FormAssociatedElement = _FormAssociatedElement;
141
+ return FormAssociatedElement;
142
+ }
143
+ function up(cls) {
144
+ return Object.getPrototypeOf(cls.prototype);
145
+ }
package/dist/form.d.ts ADDED
@@ -0,0 +1,33 @@
1
+ import type { ElementBase } from './element.js';
2
+ type Base = ElementBase;
3
+ /**
4
+ * What `FormAssociated` adds, public and protected. Declared apart from the class because a
5
+ * function returning a class with protected members cannot be written to a declaration file.
6
+ */
7
+ export declare abstract class FormAssociatedMembers {
8
+ static formAssociated: boolean;
9
+ get form(): HTMLFormElement | null;
10
+ get labels(): NodeList;
11
+ get name(): string;
12
+ set name(value: string);
13
+ get validity(): ValidityState;
14
+ get validationMessage(): string;
15
+ get willValidate(): boolean;
16
+ checkValidity(): boolean;
17
+ reportValidity(): boolean;
18
+ setCustomValidity(message: string): void;
19
+ protected get formDisabled(): boolean;
20
+ protected setFormValue(value: File | string | FormData | null, state?: File | string | FormData | null): void;
21
+ protected setValidity(flags: ValidityStateFlags, message?: string, anchor?: HTMLElement): void;
22
+ protected resetValue(): void;
23
+ protected restoreValue(state: string | File | FormData | null, mode: 'restore' | 'autocomplete'): void;
24
+ formAssociatedCallback(form: HTMLFormElement | null): void;
25
+ formDisabledCallback(disabled: boolean): void;
26
+ formResetCallback(): void;
27
+ formStateRestoreCallback(state: string | File | FormData | null, mode: 'restore' | 'autocomplete'): void;
28
+ }
29
+ export declare function FormAssociated<B extends Base>(Base: B): B & (abstract new (...args: any[]) => FormAssociatedMembers) & {
30
+ formAssociated: boolean;
31
+ };
32
+ export {};
33
+ //# sourceMappingURL=form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../src/form.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,KAAK,IAAI,GAAG,WAAW,CAAC;AASxB;;;GAGG;AACH,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,qBAAqB;IACjD,MAAM,CAAC,cAAc,EAAE,OAAO,CAAC;IAC/B,IAAI,IAAI,IAAI,eAAe,GAAG,IAAI,CAAC;IACnC,IAAI,MAAM,IAAI,QAAQ,CAAC;IACvB,IAAI,IAAI,IAAI,MAAM,CAAC;IACnB,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE;IACxB,IAAI,QAAQ,IAAI,aAAa,CAAC;IAC9B,IAAI,iBAAiB,IAAI,MAAM,CAAC;IAChC,IAAI,YAAY,IAAI,OAAO,CAAC;IAC5B,aAAa,IAAI,OAAO;IACxB,cAAc,IAAI,OAAO;IACzB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IACxC,SAAS,KAAK,YAAY,IAAI,OAAO,CAAC;IACtC,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,IAAI,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,IAAI,GAAG,IAAI;IAC7G,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI;IAC9F,SAAS,CAAC,UAAU,IAAI,IAAI;IAC5B,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,GAAG,IAAI,EAAE,IAAI,EAAE,SAAS,GAAG,cAAc,GAAG,IAAI;IACtG,sBAAsB,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,GAAG,IAAI;IAC1D,oBAAoB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI;IAC7C,iBAAiB,IAAI,IAAI;IACzB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,GAAG,IAAI,EAAE,IAAI,EAAE,SAAS,GAAG,cAAc,GAAG,IAAI;CACzG;AAED,wBAAgB,cAAc,CAAC,CAAC,SAAS,IAAI,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,qBAAqB,CAAC,GAAG;IAAE,cAAc,EAAE,OAAO,CAAA;CAAE,CAkHlJ"}
package/dist/form.js ADDED
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Form controls: an element that takes part in a `<form>` the way `<input>` does.
3
+ *
4
+ * `static formAssociated = true` is what the browser checks, and `ElementInternals` does the
5
+ * rest: the value submitted, validity, `:disabled` from a `<fieldset>`, reset and restore. This
6
+ * mixin puts the native control API on the element, so page code treats it like any input
7
+ * (`el.form`, `el.checkValidity()`, `new FormData(form)`), and gives subclasses the protected
8
+ * half: `setFormValue`, `setValidity`, and hooks for reset and restore.
9
+ */
10
+ import { signal } from '@fluixi/reactive/signal';
11
+ export function FormAssociated(Base) {
12
+ class FormAssociatedElement extends Base {
13
+ static formAssociated = true;
14
+ #formDisabled = signal(false);
15
+ /** The last validity the subclass set, kept so a custom message can be laid over it and lifted. */
16
+ #flags = {};
17
+ #message = '';
18
+ #anchor;
19
+ #custom = '';
20
+ /** The form this control belongs to, like `input.form`. */
21
+ get form() {
22
+ return this.internals.form;
23
+ }
24
+ /** The `<label>`s that name this control. */
25
+ get labels() {
26
+ return this.internals.labels;
27
+ }
28
+ /** The key the value is submitted under: the `name` attribute, as on an input. */
29
+ get name() {
30
+ return this.getAttribute('name') ?? '';
31
+ }
32
+ set name(value) {
33
+ this.setAttribute('name', value);
34
+ }
35
+ get validity() {
36
+ return this.internals.validity;
37
+ }
38
+ get validationMessage() {
39
+ return this.internals.validationMessage;
40
+ }
41
+ get willValidate() {
42
+ return this.internals.willValidate;
43
+ }
44
+ checkValidity() {
45
+ return this.internals.checkValidity();
46
+ }
47
+ reportValidity() {
48
+ return this.internals.reportValidity();
49
+ }
50
+ /** As on an input: a non-empty message makes the control invalid until it is cleared. */
51
+ setCustomValidity(message) {
52
+ this.#custom = message;
53
+ this.#applyValidity();
54
+ }
55
+ /**
56
+ * Whether a disabled `<fieldset>` or form covers this control. Reactive: read it in a
57
+ * binding and the control follows. A disabled control is also left out of `FormData`.
58
+ */
59
+ get formDisabled() {
60
+ return this.#formDisabled();
61
+ }
62
+ /** What the form submits for this control. `null` submits nothing. */
63
+ setFormValue(value, state) {
64
+ this.internals.setFormValue(value, state);
65
+ }
66
+ /**
67
+ * The control's own validity: `{ valueMissing: true }` and a message, or `{}` when valid.
68
+ * `anchor` is the inner element the browser points its bubble at.
69
+ */
70
+ setValidity(flags, message = '', anchor) {
71
+ this.#flags = flags;
72
+ this.#message = message;
73
+ this.#anchor = anchor;
74
+ this.#applyValidity();
75
+ }
76
+ /** Put the value back to what the page wrote. Called when the form resets. */
77
+ resetValue() { }
78
+ /** Take back a value the browser saved, on back/forward navigation or autofill. */
79
+ restoreValue(_state, _mode) { }
80
+ formAssociatedCallback(form) {
81
+ up(FormAssociatedElement).formAssociatedCallback?.call(this, form);
82
+ }
83
+ formDisabledCallback(disabled) {
84
+ up(FormAssociatedElement).formDisabledCallback?.call(this, disabled);
85
+ this.#formDisabled.set(disabled);
86
+ }
87
+ formResetCallback() {
88
+ up(FormAssociatedElement).formResetCallback?.call(this);
89
+ this.setCustomValidity('');
90
+ this.resetValue();
91
+ }
92
+ formStateRestoreCallback(state, mode) {
93
+ up(FormAssociatedElement).formStateRestoreCallback?.call(this, state, mode);
94
+ this.restoreValue(state, mode);
95
+ }
96
+ #applyValidity() {
97
+ // Not in every environment; the value still submits without it.
98
+ if (typeof this.internals.setValidity !== 'function')
99
+ return;
100
+ if (this.#custom)
101
+ this.internals.setValidity({ ...this.#flags, customError: true }, this.#custom, this.#anchor);
102
+ else if (Object.values(this.#flags).some(Boolean))
103
+ this.internals.setValidity(this.#flags, this.#message, this.#anchor);
104
+ else
105
+ this.internals.setValidity({});
106
+ }
107
+ }
108
+ return FormAssociatedElement;
109
+ }
110
+ /** The form callbacks of whatever sits above the mixin, so a mixin under it still runs. */
111
+ function up(cls) {
112
+ return Object.getPrototypeOf(cls.prototype);
113
+ }
package/dist/form.mjs ADDED
@@ -0,0 +1,125 @@
1
+ var __typeError = (msg) => {
2
+ throw TypeError(msg);
3
+ };
4
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
5
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
6
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
7
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
8
+ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
9
+
10
+ // src/form.ts
11
+ import { signal } from "@fluixi/reactive/signal";
12
+ function FormAssociated(Base) {
13
+ var _formDisabled, _flags, _message, _anchor, _custom, _FormAssociatedElement_instances, applyValidity_fn;
14
+ const _FormAssociatedElement = class _FormAssociatedElement extends Base {
15
+ constructor() {
16
+ super(...arguments);
17
+ __privateAdd(this, _FormAssociatedElement_instances);
18
+ __privateAdd(this, _formDisabled, signal(false));
19
+ /** The last validity the subclass set, kept so a custom message can be laid over it and lifted. */
20
+ __privateAdd(this, _flags, {});
21
+ __privateAdd(this, _message, "");
22
+ __privateAdd(this, _anchor);
23
+ __privateAdd(this, _custom, "");
24
+ }
25
+ /** The form this control belongs to, like `input.form`. */
26
+ get form() {
27
+ return this.internals.form;
28
+ }
29
+ /** The `<label>`s that name this control. */
30
+ get labels() {
31
+ return this.internals.labels;
32
+ }
33
+ /** The key the value is submitted under: the `name` attribute, as on an input. */
34
+ get name() {
35
+ return this.getAttribute("name") ?? "";
36
+ }
37
+ set name(value) {
38
+ this.setAttribute("name", value);
39
+ }
40
+ get validity() {
41
+ return this.internals.validity;
42
+ }
43
+ get validationMessage() {
44
+ return this.internals.validationMessage;
45
+ }
46
+ get willValidate() {
47
+ return this.internals.willValidate;
48
+ }
49
+ checkValidity() {
50
+ return this.internals.checkValidity();
51
+ }
52
+ reportValidity() {
53
+ return this.internals.reportValidity();
54
+ }
55
+ /** As on an input: a non-empty message makes the control invalid until it is cleared. */
56
+ setCustomValidity(message) {
57
+ __privateSet(this, _custom, message);
58
+ __privateMethod(this, _FormAssociatedElement_instances, applyValidity_fn).call(this);
59
+ }
60
+ /**
61
+ * Whether a disabled `<fieldset>` or form covers this control. Reactive: read it in a
62
+ * binding and the control follows. A disabled control is also left out of `FormData`.
63
+ */
64
+ get formDisabled() {
65
+ return __privateGet(this, _formDisabled).call(this);
66
+ }
67
+ /** What the form submits for this control. `null` submits nothing. */
68
+ setFormValue(value, state) {
69
+ this.internals.setFormValue(value, state);
70
+ }
71
+ /**
72
+ * The control's own validity: `{ valueMissing: true }` and a message, or `{}` when valid.
73
+ * `anchor` is the inner element the browser points its bubble at.
74
+ */
75
+ setValidity(flags, message = "", anchor) {
76
+ __privateSet(this, _flags, flags);
77
+ __privateSet(this, _message, message);
78
+ __privateSet(this, _anchor, anchor);
79
+ __privateMethod(this, _FormAssociatedElement_instances, applyValidity_fn).call(this);
80
+ }
81
+ /** Put the value back to what the page wrote. Called when the form resets. */
82
+ resetValue() {
83
+ }
84
+ /** Take back a value the browser saved, on back/forward navigation or autofill. */
85
+ restoreValue(_state, _mode) {
86
+ }
87
+ formAssociatedCallback(form) {
88
+ up(_FormAssociatedElement).formAssociatedCallback?.call(this, form);
89
+ }
90
+ formDisabledCallback(disabled) {
91
+ up(_FormAssociatedElement).formDisabledCallback?.call(this, disabled);
92
+ __privateGet(this, _formDisabled).set(disabled);
93
+ }
94
+ formResetCallback() {
95
+ up(_FormAssociatedElement).formResetCallback?.call(this);
96
+ this.setCustomValidity("");
97
+ this.resetValue();
98
+ }
99
+ formStateRestoreCallback(state, mode) {
100
+ up(_FormAssociatedElement).formStateRestoreCallback?.call(this, state, mode);
101
+ this.restoreValue(state, mode);
102
+ }
103
+ };
104
+ _formDisabled = new WeakMap();
105
+ _flags = new WeakMap();
106
+ _message = new WeakMap();
107
+ _anchor = new WeakMap();
108
+ _custom = new WeakMap();
109
+ _FormAssociatedElement_instances = new WeakSet();
110
+ applyValidity_fn = function() {
111
+ if (typeof this.internals.setValidity !== "function") return;
112
+ if (__privateGet(this, _custom)) this.internals.setValidity({ ...__privateGet(this, _flags), customError: true }, __privateGet(this, _custom), __privateGet(this, _anchor));
113
+ else if (Object.values(__privateGet(this, _flags)).some(Boolean)) this.internals.setValidity(__privateGet(this, _flags), __privateGet(this, _message), __privateGet(this, _anchor));
114
+ else this.internals.setValidity({});
115
+ };
116
+ _FormAssociatedElement.formAssociated = true;
117
+ let FormAssociatedElement = _FormAssociatedElement;
118
+ return FormAssociatedElement;
119
+ }
120
+ function up(cls) {
121
+ return Object.getPrototypeOf(cls.prototype);
122
+ }
123
+ export {
124
+ FormAssociated
125
+ };