sbs-editable-bs5 1.0.0
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/LICENSE +21 -0
- package/README.md +325 -0
- package/dist/editable.css +1 -0
- package/dist/editable.iife.js +3 -0
- package/dist/editable.iife.js.map +1 -0
- package/dist/editable.js +906 -0
- package/dist/editable.js.map +1 -0
- package/dist/editable.umd.cjs +3 -0
- package/dist/editable.umd.cjs.map +1 -0
- package/dist/src/Interfaces/BaseTypeButtons.d.ts +4 -0
- package/dist/src/Interfaces/Options.d.ts +36 -0
- package/dist/src/Modes/BaseMode.d.ts +14 -0
- package/dist/src/Modes/InlineMode.d.ts +11 -0
- package/dist/src/Modes/PopupMode.d.ts +12 -0
- package/dist/src/Types/BaseType.d.ts +35 -0
- package/dist/src/Types/DateTimeType.d.ts +5 -0
- package/dist/src/Types/DateType.d.ts +7 -0
- package/dist/src/Types/InputType.d.ts +4 -0
- package/dist/src/Types/SelectType.d.ts +7 -0
- package/dist/src/Types/TextAreaType.d.ts +4 -0
- package/dist/src/editable.d.ts +51 -0
- package/dist/tests/accessibility.test.d.ts +1 -0
- package/dist/tests/disabled.test.d.ts +1 -0
- package/dist/tests/errors.test.d.ts +1 -0
- package/dist/tests/events.test.d.ts +1 -0
- package/dist/tests/lifecycle.test.d.ts +1 -0
- package/dist/tests/public-api.test.d.ts +1 -0
- package/dist/tests/render.test.d.ts +1 -0
- package/dist/tests/request.test.d.ts +1 -0
- package/dist/tests/save-flow.test.d.ts +1 -0
- package/dist/tests/theme.test.d.ts +1 -0
- package/dist/tests/types/attributes.test.d.ts +1 -0
- package/dist/tests/types/date.test.d.ts +1 -0
- package/dist/tests/types/select.test.d.ts +1 -0
- package/package.json +57 -0
- package/src/Interfaces/BaseTypeButtons.ts +4 -0
- package/src/Interfaces/Options.ts +30 -0
- package/src/Modes/BaseMode.ts +57 -0
- package/src/Modes/InlineMode.ts +47 -0
- package/src/Modes/PopupMode.ts +107 -0
- package/src/Types/BaseType.ts +301 -0
- package/src/Types/DateTimeType.ts +18 -0
- package/src/Types/DateType.ts +43 -0
- package/src/Types/InputType.ts +12 -0
- package/src/Types/SelectType.ts +70 -0
- package/src/Types/TextAreaType.ts +9 -0
- package/src/editable.css +136 -0
- package/src/editable.ts +244 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Konstantin Litvinov
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
# sbs-editable-bs5
|
|
2
|
+
|
|
3
|
+
In-place ("click to edit") editing for HTML elements, built for **Bootstrap 5**. Written in plain TypeScript — no jQuery, no moment.js. Conceptually inspired by [x-editable](https://github.com/vitalets/x-editable), but not a drop-in replacement: option names and defaults differ (see [Options](#options)).
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- **Bootstrap 5.3+**, including its bundled Popper build (`bootstrap.bundle.min.js`)
|
|
8
|
+
|
|
9
|
+
Date formatting ([day.js](https://day.js.org/)) is bundled internally — you don't need to install it separately.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm i sbs-editable-bs5
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Or include the pre-built files directly:
|
|
18
|
+
|
|
19
|
+
```html
|
|
20
|
+
<link rel="stylesheet" href="bootstrap.min.css">
|
|
21
|
+
<script src="bootstrap.bundle.min.js"></script>
|
|
22
|
+
<script src="dist/editable.iife.js"></script>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
| Build | When to use |
|
|
26
|
+
|---|---|
|
|
27
|
+
| `dist/editable.js` | ESM, for bundlers (`import Editable from 'sbs-editable-bs5'`) |
|
|
28
|
+
| `dist/editable.iife.js` | Plain `<script>` tag, exposes a global `Editable` |
|
|
29
|
+
| `dist/editable.umd.cjs` | CommonJS (`require`) |
|
|
30
|
+
|
|
31
|
+
## Quick start
|
|
32
|
+
|
|
33
|
+
**1. Mark up an editable element** — usually an `<a>` with `data-*` attributes:
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<a id="username" data-type="text" data-url="/post" data-title="Enter username">superuser</a>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Key attributes:
|
|
40
|
+
- `type` — input type (`text`, `textarea`, `select`, `date`, ...)
|
|
41
|
+
- `url` — endpoint that receives the submitted value (e.g. `/post`)
|
|
42
|
+
- `value` — initial value; if omitted, taken from the element's text content
|
|
43
|
+
|
|
44
|
+
(`name` — the key the value is submitted under — defaults to the element's `id`; see [Options](#options) for the full fallback chain.)
|
|
45
|
+
|
|
46
|
+
**2. Initialize it:**
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
const el = document.getElementById('username');
|
|
50
|
+
const editable = new Editable(el);
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Or configure everything from JavaScript instead of `data-*` attributes:
|
|
54
|
+
|
|
55
|
+
```js
|
|
56
|
+
const editable = new Editable(el, {
|
|
57
|
+
type: 'text',
|
|
58
|
+
url: '/post',
|
|
59
|
+
title: 'Enter username',
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**3. Click the element, edit, submit.** The library sends a `POST` (by default) to `url` — the body is a single field keyed by `name` (see [Options](#options)):
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
username: 'superuser!'
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Backend contract
|
|
70
|
+
|
|
71
|
+
There are no restrictions on the server-side language/framework:
|
|
72
|
+
|
|
73
|
+
- **Valid value** → respond with HTTP `200`. The element updates automatically; no response body required.
|
|
74
|
+
- **Invalid value** → respond with a non-`200` status (e.g. `400`) and an error message in the body. The element keeps its old value and the form displays the error.
|
|
75
|
+
|
|
76
|
+
### JSON responses
|
|
77
|
+
|
|
78
|
+
If your server always returns `200` with an `error` flag in the JSON body instead of using HTTP status codes, handle it in `success`:
|
|
79
|
+
|
|
80
|
+
```js
|
|
81
|
+
const editable = new Editable(el, {
|
|
82
|
+
// ...
|
|
83
|
+
success: async function (response, newValue) {
|
|
84
|
+
const res = await response.json();
|
|
85
|
+
if (res.error) return res.msg; // shown as the form's error message
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
`response` is a standard [Fetch `Response`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch).
|
|
91
|
+
|
|
92
|
+
### Local-only mode (no server)
|
|
93
|
+
|
|
94
|
+
Omit `url` to skip the network request entirely and just update the element locally:
|
|
95
|
+
|
|
96
|
+
```js
|
|
97
|
+
const editable = new Editable(el, {
|
|
98
|
+
type: 'text',
|
|
99
|
+
title: 'Enter username',
|
|
100
|
+
});
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Per-record endpoints
|
|
104
|
+
|
|
105
|
+
There's no `pk` option — if you're editing a specific record, build its identifier into the URL instead, by passing a function:
|
|
106
|
+
|
|
107
|
+
```js
|
|
108
|
+
new Editable(el, {
|
|
109
|
+
type: 'text',
|
|
110
|
+
url: (ctx, newValue) => `/api/users/${ctx.element.dataset.userId}/username`,
|
|
111
|
+
});
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
`ctx` is the `Editable` instance (so you can read `ctx.element`, `ctx.getValue()`, etc.) and `newValue` is the value about to be submitted. The function is called fresh on every submit, so it always sees current data — for example, this reuses one config for many rows:
|
|
115
|
+
|
|
116
|
+
```js
|
|
117
|
+
function endpointFor(resource) {
|
|
118
|
+
return (ctx) => `/api/${resource}/${ctx.element.closest('[data-row-id]').dataset.rowId}`;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
document.querySelectorAll('[data-type]').forEach(el => {
|
|
122
|
+
new Editable(el, { url: endpointFor('products') });
|
|
123
|
+
});
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Custom request shape (`requestBuilder`)
|
|
127
|
+
|
|
128
|
+
By default, the library `POST`s a single `FormData` field, keyed by `name` (see above). If your backend expects JSON, a different HTTP method, extra headers, or anything else, take over the request entirely with `requestBuilder`:
|
|
129
|
+
|
|
130
|
+
```js
|
|
131
|
+
new Editable(el, {
|
|
132
|
+
url: '/api/users/42',
|
|
133
|
+
requestBuilder: (ctx, newValue, url) => ({
|
|
134
|
+
url,
|
|
135
|
+
init: {
|
|
136
|
+
method: 'PUT',
|
|
137
|
+
headers: { 'Content-Type': 'application/json' },
|
|
138
|
+
body: JSON.stringify({ [ctx.getOption('name')]: newValue }),
|
|
139
|
+
},
|
|
140
|
+
}),
|
|
141
|
+
});
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
`requestBuilder` receives the `Editable` instance, the new value, and the already-resolved `url` (so it works the same whether `url` is a string or a function). It can be `async`:
|
|
145
|
+
|
|
146
|
+
```js
|
|
147
|
+
new Editable(el, {
|
|
148
|
+
requestBuilder: async (ctx, newValue, url) => {
|
|
149
|
+
const token = await getCsrfToken();
|
|
150
|
+
return {
|
|
151
|
+
url,
|
|
152
|
+
init: {
|
|
153
|
+
method: 'POST',
|
|
154
|
+
headers: { 'X-CSRF-Token': token },
|
|
155
|
+
body: new URLSearchParams({ value: newValue }),
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
When `requestBuilder` is set, it fully replaces the default request — `ajaxOptions` and the `name`-based field key no longer apply; you're building the whole `RequestInit` yourself, GET query strings included.
|
|
163
|
+
|
|
164
|
+
### Number formatting
|
|
165
|
+
|
|
166
|
+
Native `<input type="number">` only accepts the plain HTML number syntax — no thousands separators, no spaces. Setting `value` to a pre-formatted string like `'30 000.00'` doesn't work: the browser silently empties the field instead of showing it. Keep `value` (and whatever the input holds while editing) as a plain parseable number, and use `render` to control what's shown once the form is closed:
|
|
167
|
+
|
|
168
|
+
```js
|
|
169
|
+
new Editable(el, {
|
|
170
|
+
type: 'number',
|
|
171
|
+
value: '30000.00',
|
|
172
|
+
render: (value) => {
|
|
173
|
+
const [integer, decimals] = parseFloat(value).toFixed(2).split('.');
|
|
174
|
+
const grouped = integer.replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
|
|
175
|
+
return `${grouped}.${decimals}`;
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Shows `30 000.00` on the element; the input still receives and sends the plain `30000.00`. The same technique works with `Intl.NumberFormat` for locale-aware formatting — just be aware that some locales (e.g. `ru-RU`, `fr-FR`) group with a non-breaking space rather than a regular one.
|
|
181
|
+
|
|
182
|
+
## Options
|
|
183
|
+
|
|
184
|
+
Options can be set via JavaScript or `data-*` attributes. For multi-word camelCase options, use kebab-case in the attribute — the browser converts it automatically (e.g. `showButtons` → `data-show-buttons`, `displayFormat` → `data-display-format`).
|
|
185
|
+
|
|
186
|
+
Object/function-valued options (`ajaxOptions`, `attributes`, `popoverOptions`, `requestBuilder`, `render`, `success`, `error`, a function `url`) can only be set from JavaScript — `data-*` attributes are always strings, so there's no way to express an object or a function through them. Change these through `new Editable(el, {...})`, not markup.
|
|
187
|
+
|
|
188
|
+
#### Core
|
|
189
|
+
|
|
190
|
+
| Name | Type | Default | Description |
|
|
191
|
+
|---|---|---|---|
|
|
192
|
+
| `type` | `string \| class` | `'text'` | Input type: `text`, `textarea`, `select`, `date`, `datetime`, a [simple input type](#simple-input-types), or a custom `BaseType` subclass. |
|
|
193
|
+
| `mode` | `string` | `'popup'` | `'popup'` (Bootstrap Popover) or `'inline'` (renders in place). |
|
|
194
|
+
| `value` | `mixed` | element's text | Initial value. Falls back to the element's text content. |
|
|
195
|
+
| `name` | `string` | element's `id`, or `'value'` | Key the new value is submitted under (see [Backend contract](#backend-contract)). |
|
|
196
|
+
| `title` | `string` | `''` | Popover/form title. |
|
|
197
|
+
|
|
198
|
+
#### Networking
|
|
199
|
+
|
|
200
|
+
| Name | Type | Default | Description |
|
|
201
|
+
|---|---|---|---|
|
|
202
|
+
| `url` | `string \| ((context, newValue) => string) \| null` | `null` | Endpoint the new value is submitted to. A function is resolved on every submit with the current instance and the new value — useful for per-record REST endpoints now that there's no `pk`. Only a plain string works via `data-url`; a function must be set from JavaScript. |
|
|
203
|
+
| `requestBuilder` | `(context, newValue, resolvedUrl) => { url, init }` | `null` | Fully overrides how the request is built (method, headers, body). Set from JavaScript only. See [Custom request shape](#custom-request-shape-requestbuilder). |
|
|
204
|
+
| `send` | `boolean` | `true` | When `true`, the value is sent to `url` if it's set; otherwise it's only stored locally on the element. |
|
|
205
|
+
| `ajaxOptions` | `object` | `{ method: 'POST' }` | Extra [`RequestInit`](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit) options merged into the `fetch()` call. `method` must be a body-carrying verb (`POST`/`PUT`/`PATCH`/`DELETE`) — `GET` isn't supported here since saving an edit is a mutation; use `requestBuilder` if you need a bodyless request. JS only. |
|
|
206
|
+
|
|
207
|
+
#### Display
|
|
208
|
+
|
|
209
|
+
| Name | Type | Default | Description |
|
|
210
|
+
|---|---|---|---|
|
|
211
|
+
| `emptyText` | `string` | `'Empty'` | Text shown when the value is empty. |
|
|
212
|
+
| `showButtons` | `boolean` | `true` | When `false`, the form has no save/cancel buttons and auto-submits on `change`. |
|
|
213
|
+
| `popoverOptions` | `object` | `{}` | Passed through to the underlying [Bootstrap Popover](https://getbootstrap.com/docs/5.3/components/popovers/#options). Only applies in `popup` mode. JS only. |
|
|
214
|
+
| `render` | `(text, context) => string` | `null` | Final pass over the text shown on the closed element — receives whatever the type would otherwise display (the raw value for `text`/`number`/`textarea`, the matched option's label for `select`, the string already formatted via `displayFormat` for `date`/`datetime`). Never affects the value sent to the server or the input while editing — see [Number formatting](#number-formatting). JS only. |
|
|
215
|
+
|
|
216
|
+
#### State
|
|
217
|
+
|
|
218
|
+
| Name | Type | Default | Description |
|
|
219
|
+
|---|---|---|---|
|
|
220
|
+
| `required` | `boolean` | `false` | Marks the input as required (native HTML5 validation). Equivalent to `attributes.required` — either works, no need to set both. |
|
|
221
|
+
| `attributes` | `object` | `{}` | Map of native HTML attributes applied to the generated element — works for every type (`text`, `textarea`, `select`, `date`, etc.), not just [simple input types](#simple-input-types). JS only. `attributes.disabled` disables the *input inside an already-open form* (the popover/inline trigger still opens normally) — see [Methods](#methods) for blocking the trigger itself; this is a different thing from the top-level `disabled` state. `attributes.required` is equivalent to the top-level `required` option above. |
|
|
222
|
+
|
|
223
|
+
#### Callbacks
|
|
224
|
+
|
|
225
|
+
| Name | Type | Default | Description |
|
|
226
|
+
|---|---|---|---|
|
|
227
|
+
| `success` | `(response, newValue) => Promise<string \| undefined>` | `null` | Called after a `2xx` response. Return a truthy string to show it as an error instead of accepting the value. |
|
|
228
|
+
| `error` | `(response, newValue) => Promise<string \| undefined>` | `null` | Called after a non-`2xx` response. Return a string to override the default error message. |
|
|
229
|
+
|
|
230
|
+
## Methods
|
|
231
|
+
|
|
232
|
+
| Method | Parameters | Description |
|
|
233
|
+
|---|---|---|
|
|
234
|
+
| `enable()` | — | Enables the editable (blocks nothing — the trigger opens normally). New instances start enabled; there's no init-time option for this, call `.disable()` right after construction if you need to start disabled. |
|
|
235
|
+
| `disable()` | — | Disables the editable — blocks the popover/inline trigger from opening at all. Different from `attributes.disabled` (see [Options](#options)). |
|
|
236
|
+
| `getValue()` | — | Returns the current value. |
|
|
237
|
+
| `setValue(value)` | `value: Mixed` | Sets a new value and re-renders the display text. |
|
|
238
|
+
| `getOption(name)` | `name: string` | Returns the current value of an option. |
|
|
239
|
+
| `destroy()` | — | Tears down all listeners/Popover instances created for this element. Call this before removing the element from the DOM, or before re-initializing it. |
|
|
240
|
+
|
|
241
|
+
## Extensibility
|
|
242
|
+
|
|
243
|
+
Custom input types and modes are registered on `Editable` and referenced by name via the `type`/`mode` options — no need to fork the library to add one:
|
|
244
|
+
|
|
245
|
+
```js
|
|
246
|
+
import Editable from 'sbs-editable-bs5';
|
|
247
|
+
|
|
248
|
+
class RatingType extends Editable.BaseType {
|
|
249
|
+
create() {
|
|
250
|
+
// build and return your custom input element/container
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
Editable.registerType('rating', RatingType);
|
|
255
|
+
|
|
256
|
+
new Editable(el, { type: 'rating' });
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
The same pattern applies to modes via `Editable.registerMode(name, ModeClass)`, extending `Editable.BaseMode`. You can also pass a class directly as `type` without registering it first.
|
|
260
|
+
|
|
261
|
+
## Events
|
|
262
|
+
|
|
263
|
+
```js
|
|
264
|
+
document.getElementById('username').addEventListener('save', function (e) {
|
|
265
|
+
console.log('Saved', e.detail.Editable.getValue());
|
|
266
|
+
});
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
| Event | Description |
|
|
270
|
+
|---|---|
|
|
271
|
+
| `init` | Fired once the editable is fully initialized. Attach this listener *before* calling `new Editable(...)`. |
|
|
272
|
+
| `show` | Fired when the container starts showing and the form is rendered. |
|
|
273
|
+
| `shown` | Fired once the container has finished showing. |
|
|
274
|
+
| `hide` | Fired when the container starts hiding (on both save and cancel). |
|
|
275
|
+
| `hidden` | Fired once the container has finished hiding. |
|
|
276
|
+
| `save` | Fired after a new value has been submitted/accepted. |
|
|
277
|
+
|
|
278
|
+
All events dispatch with `event.detail.Editable` set to the instance.
|
|
279
|
+
|
|
280
|
+
## Input types
|
|
281
|
+
|
|
282
|
+
### Simple input types
|
|
283
|
+
|
|
284
|
+
`type`: `text` (default), `textarea`, `password`, `email`, `url`, `tel`, `number`, `range`, `time`
|
|
285
|
+
|
|
286
|
+
None of these have type-specific top-level options — everything goes through the generic `attributes` option (see [Options](#options)), applied as native HTML attributes on the generated element. Allowed keys: `placeholder`, `min`, `max`, `step`, `pattern`, `minlength`, `maxlength`, `readonly`, `autocomplete`, `autofocus`, `required`, `disabled`.
|
|
287
|
+
|
|
288
|
+
```js
|
|
289
|
+
const editable = new Editable(el, {
|
|
290
|
+
type: 'number',
|
|
291
|
+
attributes: {
|
|
292
|
+
placeholder: 'Enter age',
|
|
293
|
+
min: 0,
|
|
294
|
+
max: 120,
|
|
295
|
+
step: 1,
|
|
296
|
+
required: true,
|
|
297
|
+
},
|
|
298
|
+
});
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### Select
|
|
302
|
+
|
|
303
|
+
`type: 'select'`
|
|
304
|
+
|
|
305
|
+
| Name | Type | Default | Description |
|
|
306
|
+
|---|---|---|---|
|
|
307
|
+
| `source` | `array` | `[]` | `[{ value: 1, text: 'text1' }, { value: 2, text: 'text2' }, ...]` |
|
|
308
|
+
|
|
309
|
+
### Date
|
|
310
|
+
|
|
311
|
+
`type: 'date'`
|
|
312
|
+
|
|
313
|
+
| Name | Type | Default | Description |
|
|
314
|
+
|---|---|---|---|
|
|
315
|
+
| `format` | `string` | `YYYY-MM-DD` | Format used when submitting the value to the server, and when reading it from the `data-value` attribute. Uses [day.js tokens](https://day.js.org/docs/en/parse/string-format). |
|
|
316
|
+
| `displayFormat` | `string` | `YYYY-MM-DD` | Format used when displaying the value on the element. |
|
|
317
|
+
|
|
318
|
+
### Datetime
|
|
319
|
+
|
|
320
|
+
`type: 'datetime'`
|
|
321
|
+
|
|
322
|
+
| Name | Type | Default | Description |
|
|
323
|
+
|---|---|---|---|
|
|
324
|
+
| `format` | `string` | `YYYY-MM-DDTHH:mm` | Format used when submitting the value to the server, and when reading it from the `data-value` attribute. Uses [day.js tokens](https://day.js.org/docs/en/parse/string-format). |
|
|
325
|
+
| `displayFormat` | `string` | `YYYY-MM-DDTHH:mm` | Format used when displaying the value on the element. |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.editable-element{border-bottom:dashed 1px var(--bs-primary,#08c);cursor:pointer;text-decoration:none}.editable-element-disabled{cursor:default;border-bottom:none}.editable-element-empty{color:var(--bs-danger,#d14);font-style:italic}.editable{max-width:none}.editable-form{gap:20px}.editable-load-overlay{background:var(--bs-body-bg,#fff);justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.editable-loader{--editable-loader-color:var(--bs-body-color,#000);text-indent:-9999em;border-radius:50%;width:1em;height:1em;font-size:5px;animation:1.1s infinite load5;position:relative;transform:translateZ(0)}@keyframes load5{0%,to{box-shadow:0em -2.6em 0em 0em var(--editable-loader-color), 1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 2.5em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 1.75em 1.75em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 0em 2.5em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -1.8em 1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -2.6em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 50%, transparent), -1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 70%, transparent)}12.5%{box-shadow:0em -2.6em 0em 0em color-mix(in srgb, var(--editable-loader-color) 70%, transparent), 1.8em -1.8em 0 0em var(--editable-loader-color), 2.5em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 1.75em 1.75em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 0em 2.5em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -1.8em 1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -2.6em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 50%, transparent)}25%{box-shadow:0em -2.6em 0em 0em color-mix(in srgb, var(--editable-loader-color) 50%, transparent), 1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 70%, transparent), 2.5em 0em 0 0em var(--editable-loader-color), 1.75em 1.75em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 0em 2.5em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -1.8em 1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -2.6em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent)}37.5%{box-shadow:0em -2.6em 0em 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 50%, transparent), 2.5em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 70%, transparent), 1.75em 1.75em 0 0em var(--editable-loader-color), 0em 2.5em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -1.8em 1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -2.6em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent)}50%{box-shadow:0em -2.6em 0em 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 2.5em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 50%, transparent), 1.75em 1.75em 0 0em color-mix(in srgb, var(--editable-loader-color) 70%, transparent), 0em 2.5em 0 0em var(--editable-loader-color), -1.8em 1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -2.6em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent)}62.5%{box-shadow:0em -2.6em 0em 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 2.5em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 1.75em 1.75em 0 0em color-mix(in srgb, var(--editable-loader-color) 50%, transparent), 0em 2.5em 0 0em color-mix(in srgb, var(--editable-loader-color) 70%, transparent), -1.8em 1.8em 0 0em var(--editable-loader-color), -2.6em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent)}75%{box-shadow:0em -2.6em 0em 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 2.5em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 1.75em 1.75em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 0em 2.5em 0 0em color-mix(in srgb, var(--editable-loader-color) 50%, transparent), -1.8em 1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 70%, transparent), -2.6em 0em 0 0em var(--editable-loader-color), -1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent)}87.5%{box-shadow:0em -2.6em 0em 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 2.5em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 1.75em 1.75em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 0em 2.5em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -1.8em 1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 50%, transparent), -2.6em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 70%, transparent), -1.8em -1.8em 0 0em var(--editable-loader-color)}}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var Editable=(function(e){var t=document.createElement(`style`);t.textContent=`.editable-element{border-bottom:dashed 1px var(--bs-primary,#08c);cursor:pointer;text-decoration:none}.editable-element-disabled{cursor:default;border-bottom:none}.editable-element-empty{color:var(--bs-danger,#d14);font-style:italic}.editable{max-width:none}.editable-form{gap:20px}.editable-load-overlay{background:var(--bs-body-bg,#fff);justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.editable-loader{--editable-loader-color:var(--bs-body-color,#000);text-indent:-9999em;border-radius:50%;width:1em;height:1em;font-size:5px;animation:1.1s infinite load5;position:relative;transform:translateZ(0)}@keyframes load5{0%,to{box-shadow:0em -2.6em 0em 0em var(--editable-loader-color), 1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 2.5em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 1.75em 1.75em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 0em 2.5em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -1.8em 1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -2.6em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 50%, transparent), -1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 70%, transparent)}12.5%{box-shadow:0em -2.6em 0em 0em color-mix(in srgb, var(--editable-loader-color) 70%, transparent), 1.8em -1.8em 0 0em var(--editable-loader-color), 2.5em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 1.75em 1.75em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 0em 2.5em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -1.8em 1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -2.6em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 50%, transparent)}25%{box-shadow:0em -2.6em 0em 0em color-mix(in srgb, var(--editable-loader-color) 50%, transparent), 1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 70%, transparent), 2.5em 0em 0 0em var(--editable-loader-color), 1.75em 1.75em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 0em 2.5em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -1.8em 1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -2.6em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent)}37.5%{box-shadow:0em -2.6em 0em 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 50%, transparent), 2.5em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 70%, transparent), 1.75em 1.75em 0 0em var(--editable-loader-color), 0em 2.5em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -1.8em 1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -2.6em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent)}50%{box-shadow:0em -2.6em 0em 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 2.5em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 50%, transparent), 1.75em 1.75em 0 0em color-mix(in srgb, var(--editable-loader-color) 70%, transparent), 0em 2.5em 0 0em var(--editable-loader-color), -1.8em 1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -2.6em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent)}62.5%{box-shadow:0em -2.6em 0em 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 2.5em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 1.75em 1.75em 0 0em color-mix(in srgb, var(--editable-loader-color) 50%, transparent), 0em 2.5em 0 0em color-mix(in srgb, var(--editable-loader-color) 70%, transparent), -1.8em 1.8em 0 0em var(--editable-loader-color), -2.6em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent)}75%{box-shadow:0em -2.6em 0em 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 2.5em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 1.75em 1.75em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 0em 2.5em 0 0em color-mix(in srgb, var(--editable-loader-color) 50%, transparent), -1.8em 1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 70%, transparent), -2.6em 0em 0 0em var(--editable-loader-color), -1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent)}87.5%{box-shadow:0em -2.6em 0em 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 1.8em -1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 2.5em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 1.75em 1.75em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), 0em 2.5em 0 0em color-mix(in srgb, var(--editable-loader-color) 20%, transparent), -1.8em 1.8em 0 0em color-mix(in srgb, var(--editable-loader-color) 50%, transparent), -2.6em 0em 0 0em color-mix(in srgb, var(--editable-loader-color) 70%, transparent), -1.8em -1.8em 0 0em var(--editable-loader-color)}}
|
|
2
|
+
/*$vite$:1*/`,document.head.appendChild(t);var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),l=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=a(t),l=0,u=c.length,d;l<u;l++)d=c[l],!s.call(e,d)&&d!==n&&r(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(o=i(t,d))||o.enumerable});return e},u=(e,t,i)=>(i=e==null?{}:n(o(e)),l(t||!e||!e.__esModule||!s.call(e,`default`)?r(i,`default`,{value:e,enumerable:!0}):i,e)),d=class e{context;constructor(t){if(this.constructor===e)throw Error(`BaseMode is abstract and cannot be instantiated directly — create a subclass that implements init()/enable()/disable()/hide()/destroy() (see PopupMode, InlineMode).`);this.context=t}event_show(){if(this.context.typeElement.hideError(),!this.context.typeElement.element)throw Error(`${this.context.typeElement.constructor.name}.create() did not call createContainer() — the input element was never set.`);this.context.typeElement.element.value=this.context.getValue(),this.context.element.dispatchEvent(new CustomEvent(`show`,{detail:{Editable:this.context}}))}event_shown(){this.context.element.dispatchEvent(new CustomEvent(`shown`,{detail:{Editable:this.context}}))}event_hide(){this.context.element.dispatchEvent(new CustomEvent(`hide`,{detail:{Editable:this.context}}))}event_hidden(){this.context.element.dispatchEvent(new CustomEvent(`hidden`,{detail:{Editable:this.context}}))}init(){throw Error(`${this.constructor.name} must implement init().`)}enable(){throw Error(`${this.constructor.name} must implement enable().`)}disable(){throw Error(`${this.constructor.name} must implement disable().`)}hide(){throw Error(`${this.constructor.name} must implement hide().`)}destroy(){throw Error(`${this.constructor.name} must implement destroy().`)}},f=class extends d{openHandler=null;disabled=!1;init(){this.openHandler=()=>{if(!this.disabled){let e=this.context.typeElement.create();this.event_show(),this.removeOpenHandler(),this.context.element.replaceChildren(e),this.event_shown()}},this.context.element.addEventListener(`click`,this.openHandler)}removeOpenHandler(){this.openHandler&&=(this.context.element.removeEventListener(`click`,this.openHandler),null)}enable(){this.disabled=!1}disable(){this.disabled=!0}hide(){this.event_hide(),this.context.element.textContent=this.context.getValue(),setTimeout(()=>{this.init(),this.event_hidden()},100)}destroy(){this.removeOpenHandler()}},p=class extends d{popover=null;abortController=new AbortController;init(){let t={container:`body`,content:this.context.typeElement.create(),html:!0,customClass:`editable`,title:this.context.options.title};this.popover=new e.Popover(this.context.element,Object.assign(t,this.context.options.popoverOptions));let{signal:n}=this.abortController;this.context.element.addEventListener(`show.bs.popover`,()=>{this.event_show()},{signal:n}),this.context.element.addEventListener(`inserted.bs.popover`,()=>{this.syncTheme()},{signal:n}),this.context.element.addEventListener(`shown.bs.popover`,()=>{this.event_shown()},{signal:n}),this.context.element.addEventListener(`hide.bs.popover`,()=>{this.event_hide()},{signal:n}),this.context.element.addEventListener(`hidden.bs.popover`,()=>{this.event_hidden()},{signal:n}),document.addEventListener(`click`,e=>{let t=e.target,n=this.popover?.tip;if(this.popover&&t===n||t===this.context.element)return;let r=t.parentNode;for(;r;){if(r===n)return;r=r.parentNode}this.hide()},{signal:n})}syncTheme(){let e=this.context.element.closest(`[data-bs-theme]`),t=this.popover?.tip;t&&e&&t.setAttribute(`data-bs-theme`,e.getAttribute(`data-bs-theme`)??``)}enable(){this.popover&&this.popover.enable()}disable(){this.popover&&this.popover.disable()}hide(){this.popover&&this.popover.hide()}destroy(){this.abortController.abort(),this.popover?.dispose(),this.popover=null}},m=class e{context;element=null;error=null;form=null;load=null;buttons={success:null,cancel:null};constructor(t){if(this.constructor===e)throw Error(`BaseType is abstract and cannot be instantiated directly — create a subclass that implements create() (see InputType, SelectType, etc.).`);this.context=t}create(){throw Error(`${this.constructor.name} must implement create().`)}checkUnsupportedOptions(){this.context.options.format!==void 0&&console.error(`${this.constructor.name} does not support the "format" option — it only applies to type: 'date'/'datetime'. It will be ignored.`),this.context.options.displayFormat!==void 0&&console.error(`${this.constructor.name} does not support the "displayFormat" option — it only applies to type: 'date'/'datetime'. It will be ignored.`),this.context.options.source!==void 0&&console.error(`${this.constructor.name} does not support the "source" option — it only applies to type: 'select'. It will be ignored.`)}createContainer(e){let t=document.createElement(`div`);return this.element=e,this.error=this.createContainerError(),this.form=this.createContainerForm(),this.load=this.createContainerLoad(),this.form.append(e,this.load),this.buttons.success=null,this.buttons.cancel=null,this.context.options.showButtons&&(this.buttons.success=this.createButtonSuccess(),this.buttons.cancel=this.createButtonCancel(),this.form.append(this.buttons.success,this.buttons.cancel)),t.append(this.error,this.form),t}createContainerError(){let e=document.createElement(`div`);return e.classList.add(`editable-error`,`text-danger`,`fst-italic`,`mb-2`,`fw-bold`),e.setAttribute(`role`,`alert`),e.hidden=!0,e}closeAndFocus(){this.context.modeElement.hide(),this.context.element.focus()}createContainerForm(){let e=document.createElement(`form`);return e.classList.add(`editable-form`,`d-flex`,`align-items-start`),e.addEventListener(`keydown`,e=>{e.key===`Escape`&&(e.preventDefault(),this.closeAndFocus())}),e.addEventListener(`submit`,async e=>{e.preventDefault();let t=this.getValue();if(this.context.options.send&&this.context.options.url&&this.context.getValue()!==t){this.showLoad();let e;try{let n=await this.ajax(t);e=n.ok?await this.context.success(n,t):await this.context.error(n,t)||`${n.status} ${n.statusText}`}catch(t){if(console.error(t),!(t instanceof TypeError))throw t;e=t.message}e?(this.showError(),this.setError(e)):(this.setError(``),this.hideError(),this.context.setValue(this.getValue()),this.closeAndFocus(),this.initText()),this.hideLoad()}else this.context.setValue(this.getValue()),this.closeAndFocus(),this.initText();this.context.element.dispatchEvent(new CustomEvent(`save`,{detail:{Editable:this.context}}))}),e}createContainerLoad(){let e=document.createElement(`div`);e.classList.add(`editable-load-overlay`),e.hidden=!0;let t=document.createElement(`div`);return t.classList.add(`editable-loader`),e.append(t),e}createButton(){let e=document.createElement(`button`);return e.type=`button`,e.classList.add(`btn`,`btn-sm`),e}createButtonSuccess(){let e=this.createButton();return e.type=`submit`,e.classList.add(`btn-success`),e.setAttribute(`aria-label`,`Save`),e.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M13.485 1.929a1 1 0 0 1 .057 1.414l-7.5 8a1 1 0 0 1-1.45.036l-3.5-3.5a1 1 0 1 1 1.414-1.415L5.5 9.379l6.571-7.007a1 1 0 0 1 1.414-.043z"/></svg>`,e}createButtonCancel(){let e=this.createButton();return e.classList.add(`btn-danger`),e.setAttribute(`aria-label`,`Cancel`),e.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854z"/></svg>`,e.addEventListener(`click`,()=>{this.closeAndFocus()}),e}hideLoad(){this.load&&(this.load.hidden=!0)}showLoad(){this.load&&(this.load.hidden=!1)}async ajax(e){let t=this.context.options.url;if(!t){let e=Error("ajax() was called without a `url` option configured. Set `url` (string or function) before calling save.");throw console.error(e),e}let n=typeof t==`function`?t(this.context,e):t;if(this.context.options.requestBuilder){let t=await this.context.options.requestBuilder(this.context,e,n);return fetch(t.url,t.init)}let r=new FormData;r.append(this.context.options.name??`value`,e);let i={...this.context.options.ajaxOptions};return i.body=r,fetch(n,i)}async successResponse(e,t){}async errorResponse(e,t){}setError(e){this.error&&(this.error.textContent=e)}showError(){this.error&&(this.error.hidden=!1)}hideError(){this.error&&(this.error.hidden=!0)}createElement(e){let t=document.createElement(e);return t.classList.add(`form-control`),this.context.options.required&&(t.required=this.context.options.required),this.applyAttributes(t),this.context.options.showButtons||t.addEventListener(`change`,()=>{this.form&&this.form.dispatchEvent(new Event(`submit`))}),this.add_focus(t),t}applyAttributes(e){let t=this.context.options.attributes||{},n=[`step`,`min`,`max`,`minlength`,`maxlength`,`pattern`,`placeholder`,`required`,`readonly`,`disabled`,`autocomplete`,`autofocus`];for(let[r,i]of Object.entries(t))n.includes(r)&&i!==void 0&&e.setAttribute(r,String(i))}add_focus(e){this.context.element.addEventListener(`shown`,()=>{e.focus()},{once:!0})}initText(){if(this.context.getValue()===``)return this.context.element.textContent=this.context.options.emptyText||``,!0;{let e=this.context.getValue();return this.context.element.textContent=this.context.options.render?this.context.options.render(e,this.context):e,!1}}initOptions(){}getValue(){return this.element?this.element.value:``}},h=c(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){"use strict";var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),g=c(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_customParseFormat=r()})(e,(function(){"use strict";var e={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},c=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||={}).offset=function(e){if(!e||e===`Z`)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return n===0?0:t[0]===`+`?-n:n}(e)}],u=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?`pm`:`PM`);return n},f={A:[a,function(e){this.afternoon=d(e,!1)}],a:[a,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*e}],SS:[r,function(e){this.milliseconds=10*e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,c(`seconds`)],ss:[i,c(`seconds`)],m:[i,c(`minutes`)],mm:[i,c(`minutes`)],H:[i,c(`hours`)],h:[i,c(`hours`)],HH:[i,c(`hours`)],hh:[i,c(`hours`)],D:[i,c(`day`)],DD:[r,c(`day`)],Do:[a,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,``)===e&&(this.day=r)}],w:[i,c(`week`)],ww:[r,c(`week`)],M:[i,c(`month`)],MM:[r,c(`month`)],MMM:[a,function(e){var t=u(`months`),n=(u(`monthsShort`)||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw Error();this.month=n%12||n}],MMMM:[a,function(e){var t=u(`months`).indexOf(e)+1;if(t<1)throw Error();this.month=t%12||t}],Y:[/[+-]?\d+/,c(`year`)],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,c(`year`)],Z:l,ZZ:l};function p(n){for(var r=n,i=o&&o.formats,a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,c=0;c<s;c+=1){var l=a[c],u=f[l],d=u&&u[0],p=u&&u[1];a[c]=p?{regex:d,parser:p}:l.replace(/^\[|\]$/g,``)}return function(e){for(var t={},n=0,r=0;n<s;n+=1){var i=a[n];if(typeof i==`string`)r+=i.length;else{var o=i.regex,c=i.parser,l=e.slice(r),u=o.exec(l)[0];c.call(t,u),e=e.replace(u,``)}}return function(e){var t=e.afternoon;if(t!==void 0){var n=e.hours;t?n<12&&(e.hours+=12):n===12&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,a=e.args;this.$u=r;var s=a[1];if(typeof s==`string`){var c=!0===a[2],l=!0===a[3],u=c||l,d=a[2];l&&(d=a[2]),o=this.$locale(),!c&&d&&(o=n.Ls[d]),this.$d=function(e,t,n,r){try{if([`x`,`X`].indexOf(t)>-1)return new Date((t===`X`?1e3:1)*e);var i=p(t)(e),a=i.year,o=i.month,s=i.day,c=i.hours,l=i.minutes,u=i.seconds,d=i.milliseconds,f=i.zone,m=i.week,h=new Date,g=s||(a||o?1:h.getDate()),_=a||h.getFullYear(),v=0;a&&!o||(v=o>0?o-1:h.getMonth());var y,b=c||0,x=l||0,S=u||0,C=d||0;return f?new Date(Date.UTC(_,v,g,b,x,S,C+60*f.offset*1e3)):n?new Date(Date.UTC(_,v,g,b,x,S,C)):(y=new Date(_,v,g,b,x,S,C),m&&(y=r(y).week(m).toDate()),y)}catch{return new Date(``)}}(t,s,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(s)&&(this.$d=new Date(``)),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){a[1]=s[m-1];var h=n.apply(this,a);if(h.isValid()){this.$d=h.$d,this.$L=h.$L,this.init();break}m===f&&(this.$d=new Date(``))}else i.call(this,e)}}}))})),_=u(h(),1),v=u(g(),1);_.default.extend(v.default);var y=class extends m{checkUnsupportedOptions(){this.context.options.source!==void 0&&console.error(`${this.constructor.name} does not support the "source" option — it only applies to type: 'select'. It will be ignored.`)}create(){let e=this.createElement(`input`);return e.type=`date`,this.createContainer(e)}initText(){let e=this.context.getValue();if(e===``)return this.context.element.textContent=this.context.options.emptyText||``,!0;{let t=(0,_.default)(e,this.context.options.format).format(this.context.options.displayFormat);return this.context.element.textContent=this.context.options.render?this.context.options.render(t,this.context):t,!1}}initOptions(){let e=`YYYY-MM-DD`,t=this.context.get_opt(`format`,e),n=this.context.get_opt(`displayFormat`,e);this.context.setValue((0,_.default)(this.context.getValue(),n).format(t))}},b=class extends y{create(){let e=this.createElement(`input`);return e.type=`datetime-local`,this.createContainer(e)}initOptions(){let e=`YYYY-MM-DDTHH:mm`,t=this.context.get_opt(`format`,e),n=this.context.get_opt(`displayFormat`,e);this.context.setValue((0,_.default)(this.context.getValue(),n).format(t))}},x=class extends m{create(){let e=this.createElement(`input`),{options:t={}}=this.context;return e.type=typeof t.type==`string`?t.type:`text`,this.createContainer(e)}},S=class extends m{checkUnsupportedOptions(){this.context.options.format!==void 0&&console.error(`${this.constructor.name} does not support the "format" option — it only applies to type: 'date'/'datetime'. It will be ignored.`),this.context.options.displayFormat!==void 0&&console.error(`${this.constructor.name} does not support the "displayFormat" option — it only applies to type: 'date'/'datetime'. It will be ignored.`)}create(){let e=this.createElement(`select`);return this.context.options.source&&Array.isArray(this.context.options.source)&&this.context.options.source.forEach(t=>{let n=document.createElement(`option`);n.value=String(t.value),n.textContent=t.text,e.append(n)}),this.createContainer(e)}initText(){if(this.context.element.textContent=this.context.options.emptyText||``,this.context.getValue()!==``&&this.context.options.source&&Array.isArray(this.context.options.source)&&this.context.options.source.length>0)for(let e=0;e<this.context.options.source.length;e++){let t=this.context.options.source[e];if(String(t.value)===this.context.getValue())return this.context.element.textContent=this.context.options.render?this.context.options.render(t.text,this.context):t.text,!1}return!0}initOptions(){if(this.context.get_opt(`source`,[]),this.context.options&&typeof this.context.options.source==`string`&&this.context.options.source!==``)try{this.context.options.source=JSON.parse(this.context.options.source)}catch(e){let t=this.context.element,n=t.id?`#${t.id}`:`<${t.tagName.toLowerCase()}>`;throw Error(`Invalid JSON in "source" option/data-source attribute on ${n}: ${e.message}`)}}},C=class extends m{create(){let e=this.createElement(`textarea`);return this.createContainer(e)}};return class e{static BaseType=m;static BaseMode=d;static InputType=x;static TextAreaType=C;static SelectType=S;static DateType=y;static DateTimeType=b;static PopupMode=p;static InlineMode=f;static types=new Map([[`text`,x],[`password`,x],[`email`,x],[`url`,x],[`tel`,x],[`number`,x],[`range`,x],[`time`,x],[`textarea`,C],[`select`,S],[`date`,y],[`datetime`,b]]);static modes=new Map([[`popup`,p],[`inline`,f]]);static registerType(t,n){e.types.set(t,n)}static registerMode(t,n){e.modes.set(t,n)}element;options;typeElement;modeElement;accessibilityAbortController=new AbortController;constructor(e,t={}){this.element=e,this.options={...t},this.init_options(),this.typeElement=this.route_type(),this.typeElement.checkUnsupportedOptions(),this.typeElement.initOptions(),this.modeElement=this.route_mode(),this.modeElement.init(),this.init_text(),this.init_style(),this.init_accessibility(),this.element.dispatchEvent(new CustomEvent(`init`,{detail:{Editable:this}}))}readOption(e){return this.options[e]}writeOption(e,t){this.options[e]=t}get_opt(e,t){let n=this.element.dataset?.[e]??this.readOption(e)??t;return this.writeOption(e,n),n}get_opt_object(e,t){this.writeOption(e,this.readOption(e)??t)}get_opt_bool(e,t){if(this.get_opt(e,t),typeof this.readOption(e)!=`boolean`){if(this.readOption(e)===`true`){this.writeOption(e,!0);return}if(this.readOption(e)===`false`){this.writeOption(e,!1);return}this.writeOption(e,t)}}init_options(){this.get_opt(`value`,this.element.textContent??``),this.get_opt(`name`,this.element.id||`value`),this.get_opt(`title`,``),this.get_opt(`type`,`text`),this.get_opt(`emptyText`,`Empty`),this.get_opt(`mode`,`popup`),this.get_opt(`url`,null),this.get_opt_object(`ajaxOptions`,{}),this.options.ajaxOptions=Object.assign({method:`POST`},this.options.ajaxOptions),this.get_opt_bool(`send`,!0),this.get_opt_bool(`required`,!1),this.get_opt_bool(`showButtons`,!0),this.options?.success&&typeof this.options?.success==`function`&&(this.success=this.options.success),this.options?.error&&typeof this.options?.error==`function`&&(this.error=this.options.error),this.get_opt_object(`attributes`,{}),this.get_opt_object(`popoverOptions`,{})}init_text(){let e=`editable-element-empty`;this.element.classList.remove(e),this.typeElement.initText()&&this.element.classList.add(e)}init_style(){this.element.classList.add(`editable-element`)}init_accessibility(){let e=this.element;e.tagName===`BUTTON`||e.tagName===`INPUT`||e.tagName===`SELECT`||e.tagName===`TEXTAREA`||e.tagName===`A`&&e.hasAttribute(`href`)||(e.hasAttribute(`tabindex`)||(e.tabIndex=0),e.hasAttribute(`role`)||e.setAttribute(`role`,`button`),e.addEventListener(`keydown`,t=>{t.target===e&&(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e.click())},{signal:this.accessibilityAbortController.signal}))}route_mode(){let t=e.modes.get(this.options.mode);if(!t)throw Error(`Mode "${this.options.mode}" is not registered. Available modes: ${[...e.modes.keys()].join(`, `)}. Register custom modes via Editable.registerMode(name, ModeClass).`);return new t(this)}route_type(){if(this.options.type&&typeof this.options.type!=`string`)return new this.options.type(this);let t=e.types.get(this.options.type);if(!t)throw Error(`Type "${this.options.type}" is not registered. Available types: ${[...e.types.keys()].join(`, `)}. Register custom types via Editable.registerType(name, TypeClass).`);return new t(this)}async success(e,t){return await this.typeElement.successResponse(e,t)}async error(e,t){return await this.typeElement.errorResponse(e,t)}enable(){this.element.classList.remove(`editable-element-disabled`),this.modeElement.enable()}disable(){this.element.classList.add(`editable-element-disabled`),this.modeElement.disable()}setValue(e){this.options.value=e,this.init_text()}getValue(){return this.options.value??``}getOption(e){return this.readOption(e)??null}destroy(){this.accessibilityAbortController.abort(),this.modeElement.destroy(),this.element.classList.remove(`editable-element`,`editable-element-disabled`,`editable-element-empty`)}}})(bootstrap);
|
|
3
|
+
//# sourceMappingURL=editable.iife.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editable.iife.js","names":[],"sources":["../src/Modes/BaseMode.ts","../src/Modes/InlineMode.ts","../src/Modes/PopupMode.ts","../src/Types/BaseType.ts","../node_modules/dayjs/dayjs.min.js","../node_modules/dayjs/plugin/customParseFormat.js","../src/Types/DateType.ts","../src/Types/DateTimeType.ts","../src/Types/InputType.ts","../src/Types/SelectType.ts","../src/Types/TextAreaType.ts","../src/editable.ts"],"sourcesContent":["import type Editable from '../editable.ts';\n\nexport default class BaseMode {\n context: Editable;\n\n constructor(context: Editable) {\n if (this.constructor === BaseMode) {\n throw new Error(\n 'BaseMode is abstract and cannot be instantiated directly — create a subclass that implements init()/enable()/disable()/hide()/destroy() (see PopupMode, InlineMode).',\n );\n }\n this.context = context;\n }\n\n event_show() {\n this.context.typeElement.hideError();\n if (!this.context.typeElement.element) {\n throw new Error(\n `${this.context.typeElement.constructor.name}.create() did not call createContainer() — the input element was never set.`,\n );\n }\n this.context.typeElement.element.value = this.context.getValue();\n this.context.element.dispatchEvent(new CustomEvent('show', { detail: { Editable: this.context } }));\n }\n\n event_shown() {\n this.context.element.dispatchEvent(new CustomEvent('shown', { detail: { Editable: this.context } }));\n }\n\n event_hide() {\n this.context.element.dispatchEvent(new CustomEvent('hide', { detail: { Editable: this.context } }));\n }\n\n event_hidden() {\n this.context.element.dispatchEvent(new CustomEvent('hidden', { detail: { Editable: this.context } }));\n }\n\n init() {\n throw new Error(`${this.constructor.name} must implement init().`);\n }\n\n enable() {\n throw new Error(`${this.constructor.name} must implement enable().`);\n }\n\n disable() {\n throw new Error(`${this.constructor.name} must implement disable().`);\n }\n\n hide() {\n throw new Error(`${this.constructor.name} must implement hide().`);\n }\n\n destroy() {\n throw new Error(`${this.constructor.name} must implement destroy().`);\n }\n}\n","import BaseMode from './BaseMode.js';\n\nexport default class InlineMode extends BaseMode {\n private openHandler: (() => void) | null = null;\n private disabled = false;\n\n init() {\n this.openHandler = () => {\n if (!this.disabled) {\n const item = this.context.typeElement.create();\n this.event_show();\n this.removeOpenHandler();\n this.context.element.replaceChildren(item);\n this.event_shown();\n }\n };\n this.context.element.addEventListener('click', this.openHandler);\n }\n\n private removeOpenHandler(): void {\n if (this.openHandler) {\n this.context.element.removeEventListener('click', this.openHandler);\n this.openHandler = null;\n }\n }\n\n enable() {\n this.disabled = false;\n }\n\n disable() {\n this.disabled = true;\n }\n\n hide() {\n this.event_hide();\n this.context.element.textContent = this.context.getValue();\n setTimeout(() => {\n this.init();\n this.event_hidden();\n }, 100);\n }\n\n destroy(): void {\n this.removeOpenHandler();\n }\n}\n","import { Popover } from 'bootstrap';\nimport BaseMode from './BaseMode.js';\n\nexport default class PopupMode extends BaseMode {\n popover: Popover | null = null;\n private abortController: AbortController = new AbortController();\n\n init() {\n const options = {\n container: 'body',\n content: this.context.typeElement.create(),\n html: true,\n customClass: 'editable',\n title: this.context.options.title,\n };\n this.popover = new Popover(this.context.element, Object.assign(options, this.context.options.popoverOptions));\n const { signal } = this.abortController;\n this.context.element.addEventListener(\n 'show.bs.popover',\n () => {\n this.event_show();\n },\n { signal },\n );\n this.context.element.addEventListener(\n 'inserted.bs.popover',\n () => {\n this.syncTheme();\n },\n { signal },\n );\n this.context.element.addEventListener(\n 'shown.bs.popover',\n () => {\n this.event_shown();\n },\n { signal },\n );\n this.context.element.addEventListener(\n 'hide.bs.popover',\n () => {\n this.event_hide();\n },\n { signal },\n );\n this.context.element.addEventListener(\n 'hidden.bs.popover',\n () => {\n this.event_hidden();\n },\n { signal },\n );\n\n document.addEventListener(\n 'click',\n (e) => {\n const target = <HTMLElement>e.target;\n // @ts-expect-error — Popover.tip is an undocumented internal property\n const tip = this.popover?.tip;\n if ((this.popover && target === tip) || target === this.context.element) return;\n let current = target.parentNode;\n while (current) {\n if (current === tip) return;\n current = current.parentNode;\n }\n this.hide();\n },\n { signal },\n );\n }\n\n // The tip is appended to <body> by default, outside any scoped data-bs-theme\n // wrapper around the trigger — copy the nearest theme onto it explicitly so\n // Bootstrap's CSS variables still resolve to the trigger's theme, not the page default.\n private syncTheme(): void {\n const themedAncestor = this.context.element.closest('[data-bs-theme]');\n // @ts-expect-error — Popover.tip is an undocumented internal property\n const tip = this.popover?.tip as HTMLElement | undefined;\n if (tip && themedAncestor) {\n tip.setAttribute('data-bs-theme', themedAncestor.getAttribute('data-bs-theme') ?? '');\n }\n }\n\n enable(): void {\n if (this.popover) {\n this.popover.enable();\n }\n }\n\n disable(): void {\n if (this.popover) {\n this.popover.disable();\n }\n }\n\n hide(): void {\n if (this.popover) {\n this.popover.hide();\n }\n }\n\n destroy(): void {\n this.abortController.abort();\n this.popover?.dispose();\n this.popover = null;\n }\n}\n","import type Editable from '../editable.ts';\nimport type BaseTypeButtons from '../Interfaces/BaseTypeButtons.ts';\n\nexport default class BaseType {\n context: Editable;\n element: HTMLInputElement | null = null;\n error: HTMLElement | null = null;\n form: HTMLElement | null = null;\n load: HTMLElement | null = null;\n buttons: BaseTypeButtons = { success: null, cancel: null };\n\n constructor(context: Editable) {\n if (this.constructor === BaseType) {\n throw new Error(\n 'BaseType is abstract and cannot be instantiated directly — create a subclass that implements create() (see InputType, SelectType, etc.).',\n );\n }\n this.context = context;\n }\n\n create(): HTMLElement {\n throw new Error(`${this.constructor.name} must implement create().`);\n }\n\n // Flags options that only make sense for a different type (e.g. `format` on a `text` field) —\n // they're silently ignored otherwise, which is easy to miss. Override per-type as needed.\n checkUnsupportedOptions(): void {\n if (this.context.options.format !== undefined) {\n console.error(\n `${this.constructor.name} does not support the \"format\" option — it only applies to type: 'date'/'datetime'. It will be ignored.`,\n );\n }\n if (this.context.options.displayFormat !== undefined) {\n console.error(\n `${this.constructor.name} does not support the \"displayFormat\" option — it only applies to type: 'date'/'datetime'. It will be ignored.`,\n );\n }\n if (this.context.options.source !== undefined) {\n console.error(\n `${this.constructor.name} does not support the \"source\" option — it only applies to type: 'select'. It will be ignored.`,\n );\n }\n }\n\n createContainer(element: HTMLInputElement): HTMLDivElement {\n const div = document.createElement(`div`);\n this.element = element;\n this.error = this.createContainerError();\n this.form = this.createContainerForm();\n this.load = this.createContainerLoad();\n this.form.append(element, this.load);\n this.buttons.success = null;\n this.buttons.cancel = null;\n if (this.context.options.showButtons) {\n this.buttons.success = this.createButtonSuccess();\n this.buttons.cancel = this.createButtonCancel();\n this.form.append(this.buttons.success, this.buttons.cancel);\n }\n\n div.append(this.error, this.form);\n return div;\n }\n\n createContainerError(): HTMLDivElement {\n const div = document.createElement(`div`);\n div.classList.add('editable-error', 'text-danger', 'fst-italic', 'mb-2', 'fw-bold');\n div.setAttribute('role', 'alert');\n div.hidden = true;\n return div;\n }\n\n // Closes the widget and returns keyboard focus to the trigger — used for every\n // explicit exit (cancel, Escape, successful save), but not for an outside-click\n // dismissal, where focus should stay wherever the user actually clicked.\n private closeAndFocus(): void {\n this.context.modeElement.hide();\n this.context.element.focus();\n }\n\n createContainerForm(): HTMLFormElement {\n const form = document.createElement(`form`);\n form.classList.add('editable-form', 'd-flex', 'align-items-start');\n form.addEventListener('keydown', (e) => {\n if (e.key === 'Escape') {\n e.preventDefault();\n this.closeAndFocus();\n }\n });\n form.addEventListener('submit', async (e) => {\n e.preventDefault();\n const newValue = this.getValue();\n if (this.context.options.send && this.context.options.url && this.context.getValue() !== newValue) {\n this.showLoad();\n let msg: string | undefined;\n try {\n const response = await this.ajax(newValue);\n if (response.ok) {\n msg = await this.context.success(response, newValue);\n } else {\n msg =\n (await this.context.error(response, newValue)) ||\n `${response.status} ${response.statusText}`;\n }\n } catch (error) {\n console.error(error);\n if (!(error instanceof TypeError)) {\n throw error;\n }\n msg = error.message;\n }\n\n if (msg) {\n this.showError();\n this.setError(msg);\n } else {\n this.setError('');\n this.hideError();\n this.context.setValue(this.getValue());\n this.closeAndFocus();\n this.initText();\n }\n this.hideLoad();\n } else {\n this.context.setValue(this.getValue());\n this.closeAndFocus();\n this.initText();\n }\n this.context.element.dispatchEvent(new CustomEvent('save', { detail: { Editable: this.context } }));\n });\n return form;\n }\n\n createContainerLoad(): HTMLDivElement {\n const div = document.createElement(`div`);\n div.classList.add('editable-load-overlay');\n div.hidden = true;\n const loader = document.createElement(`div`);\n loader.classList.add('editable-loader');\n div.append(loader);\n return div;\n }\n\n createButton(): HTMLButtonElement {\n const button = document.createElement('button');\n button.type = 'button';\n button.classList.add('btn', 'btn-sm');\n return button;\n }\n\n createButtonSuccess(): HTMLButtonElement {\n const btn_success = this.createButton();\n btn_success.type = 'submit';\n btn_success.classList.add('btn-success');\n btn_success.setAttribute('aria-label', 'Save');\n btn_success.innerHTML = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M13.485 1.929a1 1 0 0 1 .057 1.414l-7.5 8a1 1 0 0 1-1.45.036l-3.5-3.5a1 1 0 1 1 1.414-1.415L5.5 9.379l6.571-7.007a1 1 0 0 1 1.414-.043z\"/></svg>`;\n return btn_success;\n }\n\n createButtonCancel(): HTMLButtonElement {\n const btn_cancel = this.createButton();\n btn_cancel.classList.add('btn-danger');\n btn_cancel.setAttribute('aria-label', 'Cancel');\n btn_cancel.innerHTML = `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854z\"/></svg>`;\n btn_cancel.addEventListener('click', () => {\n this.closeAndFocus();\n });\n return btn_cancel;\n }\n\n hideLoad(): void {\n if (this.load) {\n this.load.hidden = true;\n }\n }\n\n showLoad(): void {\n if (this.load) {\n this.load.hidden = false;\n }\n }\n\n async ajax(new_value: string): Promise<Response> {\n const urlOption = this.context.options.url;\n if (!urlOption) {\n const err = new Error(\n 'ajax() was called without a `url` option configured. Set `url` (string or function) before calling save.',\n );\n console.error(err);\n throw err;\n }\n const url = typeof urlOption === 'function' ? urlOption(this.context, new_value) : urlOption;\n\n if (this.context.options.requestBuilder) {\n const built = await this.context.options.requestBuilder(this.context, new_value, url);\n return fetch(built.url, built.init);\n }\n\n const form = new FormData();\n form.append(this.context.options.name ?? 'value', new_value);\n\n const ajaxOptions = { ...this.context.options.ajaxOptions };\n ajaxOptions.body = form;\n return fetch(url, ajaxOptions);\n }\n\n async successResponse(_response: Response, _newValue: string): Promise<string | undefined> {\n return undefined;\n }\n\n async errorResponse(_response: Response, _newValue: string): Promise<string | undefined> {\n return undefined;\n }\n\n setError(errorMsg: string): void {\n if (this.error) {\n this.error.textContent = errorMsg;\n }\n }\n\n showError(): void {\n if (this.error) {\n this.error.hidden = false;\n }\n }\n\n hideError(): void {\n if (this.error) {\n this.error.hidden = true;\n }\n }\n\n createElement(name: string): HTMLInputElement {\n const element = <HTMLInputElement>document.createElement(name);\n element.classList.add('form-control');\n if (this.context.options.required) {\n element.required = this.context.options.required;\n }\n this.applyAttributes(element);\n if (!this.context.options.showButtons) {\n element.addEventListener('change', () => {\n if (this.form) {\n this.form.dispatchEvent(new Event('submit'));\n }\n });\n }\n this.add_focus(element);\n return element;\n }\n\n private applyAttributes(element: HTMLInputElement): void {\n const attrs = this.context.options.attributes || {};\n const allowedAttributes = [\n 'step',\n 'min',\n 'max',\n 'minlength',\n 'maxlength',\n 'pattern',\n 'placeholder',\n 'required',\n 'readonly',\n 'disabled',\n 'autocomplete',\n 'autofocus',\n ];\n for (const [key, value] of Object.entries(attrs)) {\n if (allowedAttributes.includes(key) && value !== undefined) {\n element.setAttribute(key, String(value));\n }\n }\n }\n\n add_focus(element: HTMLInputElement): void {\n this.context.element.addEventListener(\n 'shown',\n () => {\n element.focus();\n },\n { once: true },\n );\n }\n\n initText(): boolean {\n if (this.context.getValue() === '') {\n this.context.element.textContent = this.context.options.emptyText || '';\n return true;\n } else {\n const text = this.context.getValue();\n this.context.element.textContent = this.context.options.render\n ? this.context.options.render(text, this.context)\n : text;\n return false;\n }\n }\n\n initOptions(): void {}\n\n getValue(): string {\n return this.element ? this.element.value : '';\n }\n}\n","!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){\"use strict\";var t=1e3,e=6e4,n=36e5,r=\"millisecond\",i=\"second\",s=\"minute\",u=\"hour\",a=\"day\",o=\"week\",c=\"month\",f=\"quarter\",h=\"year\",d=\"date\",l=\"Invalid Date\",$=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,y=/\\[([^\\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),ordinal:function(t){var e=[\"th\",\"st\",\"nd\",\"rd\"],n=t%100;return\"[\"+t+(e[(n-20)%10]||e[n]||e[0])+\"]\"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},g=\"en\",D={};D[g]=M;var p=\"$isDayjsObject\",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if(\"string\"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split(\"-\");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate(\"s\"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v=\"set\"+(this.$u?\"UTC\":\"\");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+\"Hours\",0);case u:return $(v+\"Minutes\",1);case s:return $(v+\"Seconds\",2);case i:return $(v+\"Milliseconds\",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f=\"set\"+(this.$u?\"UTC\":\"\"),l=(n={},n[a]=f+\"Date\",n[d]=f+\"Date\",n[c]=f+\"Month\",n[h]=f+\"FullYear\",n[u]=f+\"Hours\",n[s]=f+\"Minutes\",n[i]=f+\"Seconds\",n[r]=f+\"Milliseconds\",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||\"YYYY-MM-DDTHH:mm:ssZ\",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,\"0\")},$=f||function(t,e,n){var r=t<12?\"AM\":\"PM\";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case\"YY\":return String(e.$y).slice(-2);case\"YYYY\":return b.s(e.$y,4,\"0\");case\"M\":return a+1;case\"MM\":return b.s(a+1,2,\"0\");case\"MMM\":return h(n.monthsShort,a,c,3);case\"MMMM\":return h(c,a);case\"D\":return e.$D;case\"DD\":return b.s(e.$D,2,\"0\");case\"d\":return String(e.$W);case\"dd\":return h(n.weekdaysMin,e.$W,o,2);case\"ddd\":return h(n.weekdaysShort,e.$W,o,3);case\"dddd\":return o[e.$W];case\"H\":return String(s);case\"HH\":return b.s(s,2,\"0\");case\"h\":return d(1);case\"hh\":return d(2);case\"a\":return $(s,u,!0);case\"A\":return $(s,u,!1);case\"m\":return String(u);case\"mm\":return b.s(u,2,\"0\");case\"s\":return String(e.$s);case\"ss\":return b.s(e.$s,2,\"0\");case\"SSS\":return b.s(e.$ms,3,\"0\");case\"Z\":return i}return null}(t)||i.replace(\":\",\"\")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),Y=_.prototype;return O.prototype=Y,[[\"$ms\",r],[\"$s\",i],[\"$m\",s],[\"$H\",u],[\"$W\",a],[\"$M\",c],[\"$y\",h],[\"$D\",d]].forEach((function(t){Y[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));","!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):(e=\"undefined\"!=typeof globalThis?globalThis:e||self).dayjs_plugin_customParseFormat=t()}(this,(function(){\"use strict\";var e={LTS:\"h:mm:ss A\",LT:\"h:mm A\",L:\"MM/DD/YYYY\",LL:\"MMMM D, YYYY\",LLL:\"MMMM D, YYYY h:mm A\",LLLL:\"dddd, MMMM D, YYYY h:mm A\"},t=/(\\[[^[]*\\])|([-_:/.,()\\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\\d/,r=/\\d\\d/,i=/\\d\\d?/,o=/\\d*[^-_:/,()\\s\\d]+/,s={},a=function(e){return(e=+e)+(e>68?1900:2e3)};var f=function(e){return function(t){this[e]=+t}},h=[/[+-]\\d\\d:?(\\d\\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if(\"Z\"===e)return 0;var t=e.match(/([+-]|\\d\\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:\"+\"===t[0]?-n:n}(e)}],u=function(e){var t=s[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=s.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?\"pm\":\"PM\");return n},c={A:[o,function(e){this.afternoon=d(e,!1)}],a:[o,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*+e}],SS:[r,function(e){this.milliseconds=10*+e}],SSS:[/\\d{3}/,function(e){this.milliseconds=+e}],s:[i,f(\"seconds\")],ss:[i,f(\"seconds\")],m:[i,f(\"minutes\")],mm:[i,f(\"minutes\")],H:[i,f(\"hours\")],h:[i,f(\"hours\")],HH:[i,f(\"hours\")],hh:[i,f(\"hours\")],D:[i,f(\"day\")],DD:[r,f(\"day\")],Do:[o,function(e){var t=s.ordinal,n=e.match(/\\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\\[|\\]/g,\"\")===e&&(this.day=r)}],w:[i,f(\"week\")],ww:[r,f(\"week\")],M:[i,f(\"month\")],MM:[r,f(\"month\")],MMM:[o,function(e){var t=u(\"months\"),n=(u(\"monthsShort\")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[o,function(e){var t=u(\"months\").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\\d+/,f(\"year\")],YY:[r,function(e){this.year=a(e)}],YYYY:[/\\d{4}/,f(\"year\")],Z:h,ZZ:h};function l(n){var r,i;r=n,i=s&&s.formats;for(var o=(n=r.replace(/(\\[[^\\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var o=r&&r.toUpperCase();return n||i[r]||e[r]||i[o].replace(/(\\[[^\\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),a=o.length,f=0;f<a;f+=1){var h=o[f],u=c[h],d=u&&u[0],l=u&&u[1];o[f]=l?{regex:d,parser:l}:h.replace(/^\\[|\\]$/g,\"\")}return function(e){for(var t={},n=0,r=0;n<a;n+=1){var i=o[n];if(\"string\"==typeof i)r+=i.length;else{var s=i.regex,f=i.parser,h=e.slice(r),u=s.exec(h)[0];f.call(t,u),e=e.replace(u,\"\")}}return function(e){var t=e.afternoon;if(void 0!==t){var n=e.hours;t?n<12&&(e.hours+=12):12===n&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(a=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,o=e.args;this.$u=r;var a=o[1];if(\"string\"==typeof a){var f=!0===o[2],h=!0===o[3],u=f||h,d=o[2];h&&(d=o[2]),s=this.$locale(),!f&&d&&(s=n.Ls[d]),this.$d=function(e,t,n,r){try{if([\"x\",\"X\"].indexOf(t)>-1)return new Date((\"X\"===t?1e3:1)*e);var i=l(t)(e),o=i.year,s=i.month,a=i.day,f=i.hours,h=i.minutes,u=i.seconds,d=i.milliseconds,c=i.zone,m=i.week,M=new Date,Y=a||(o||s?1:M.getDate()),p=o||M.getFullYear(),v=0;o&&!s||(v=s>0?s-1:M.getMonth());var D,w=f||0,g=h||0,y=u||0,L=d||0;return c?new Date(Date.UTC(p,v,Y,w,g,y,L+60*c.offset*1e3)):n?new Date(Date.UTC(p,v,Y,w,g,y,L)):(D=new Date(p,v,Y,w,g,y,L),m&&(D=r(D).week(m).toDate()),D)}catch(e){return new Date(\"\")}}(t,a,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(a)&&(this.$d=new Date(\"\")),s={}}else if(a instanceof Array)for(var c=a.length,m=1;m<=c;m+=1){o[1]=a[m-1];var M=n.apply(this,o);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}m===c&&(this.$d=new Date(\"\"))}else i.call(this,e)}}}));","import dayjs from 'dayjs';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\nimport BaseType from './BaseType.js';\n\ndayjs.extend(customParseFormat);\n\nexport default class DateType extends BaseType {\n checkUnsupportedOptions(): void {\n if (this.context.options.source !== undefined) {\n console.error(\n `${this.constructor.name} does not support the \"source\" option — it only applies to type: 'select'. It will be ignored.`,\n );\n }\n }\n\n create() {\n const input = this.createElement(`input`);\n input.type = 'date';\n\n return this.createContainer(input);\n }\n\n initText(): boolean {\n const value = this.context.getValue();\n if (value === '') {\n this.context.element.textContent = this.context.options.emptyText || '';\n return true;\n } else {\n const text = dayjs(value, this.context.options.format).format(this.context.options.displayFormat);\n this.context.element.textContent = this.context.options.render\n ? this.context.options.render(text, this.context)\n : text;\n return false;\n }\n }\n\n initOptions(): void {\n const default_format = 'YYYY-MM-DD';\n const format = this.context.get_opt('format', default_format) as string;\n const displayFormat = this.context.get_opt('displayFormat', default_format) as string;\n this.context.setValue(dayjs(this.context.getValue(), displayFormat).format(format));\n }\n}\n","import dayjs from 'dayjs';\nimport DateType from './DateType.js';\n\nexport default class DateTimeType extends DateType {\n create() {\n const input = this.createElement(`input`);\n input.type = 'datetime-local';\n\n return this.createContainer(input);\n }\n\n initOptions(): void {\n const default_format = 'YYYY-MM-DDTHH:mm';\n const format = this.context.get_opt('format', default_format) as string;\n const displayFormat = this.context.get_opt('displayFormat', default_format) as string;\n this.context.setValue(dayjs(this.context.getValue(), displayFormat).format(format));\n }\n}\n","import BaseType from './BaseType.js';\n\nexport default class InputType extends BaseType {\n create() {\n const input = this.createElement(`input`);\n const { options = {} } = this.context;\n\n input.type = typeof options.type === 'string' ? options.type : 'text';\n\n return this.createContainer(input);\n }\n}\n","import BaseType from './BaseType.js';\n\nexport default class SelectType extends BaseType {\n checkUnsupportedOptions(): void {\n if (this.context.options.format !== undefined) {\n console.error(\n `${this.constructor.name} does not support the \"format\" option — it only applies to type: 'date'/'datetime'. It will be ignored.`,\n );\n }\n if (this.context.options.displayFormat !== undefined) {\n console.error(\n `${this.constructor.name} does not support the \"displayFormat\" option — it only applies to type: 'date'/'datetime'. It will be ignored.`,\n );\n }\n }\n\n create() {\n const select = this.createElement(`select`);\n if (this.context.options.source && Array.isArray(this.context.options.source)) {\n this.context.options.source.forEach((item) => {\n const opt = document.createElement(`option`);\n opt.value = String(item.value);\n opt.textContent = item.text;\n select.append(opt);\n });\n }\n\n return this.createContainer(select);\n }\n\n initText() {\n this.context.element.textContent = this.context.options.emptyText || '';\n if (\n this.context.getValue() !== '' &&\n this.context.options.source &&\n Array.isArray(this.context.options.source) &&\n this.context.options.source.length > 0\n ) {\n for (let i = 0; i < this.context.options.source.length; i++) {\n const item = this.context.options.source[i];\n if (String(item.value) === this.context.getValue()) {\n this.context.element.textContent = this.context.options.render\n ? this.context.options.render(item.text, this.context)\n : item.text;\n return false;\n }\n }\n }\n return true;\n }\n\n initOptions() {\n this.context.get_opt('source', []);\n if (\n this.context.options &&\n typeof this.context.options.source === 'string' &&\n this.context.options.source !== ''\n ) {\n try {\n this.context.options.source = JSON.parse(this.context.options.source);\n } catch (e) {\n const el = this.context.element;\n const identifier = el.id ? `#${el.id}` : `<${el.tagName.toLowerCase()}>`;\n throw new Error(\n `Invalid JSON in \"source\" option/data-source attribute on ${identifier}: ${(e as Error).message}`,\n );\n }\n }\n }\n}\n","import BaseType from './BaseType.js';\n\nexport default class TextAreaType extends BaseType {\n create() {\n const textarea = this.createElement(`textarea`);\n\n return this.createContainer(textarea);\n }\n}\n","import './editable.css';\nimport type Options from './Interfaces/Options.ts';\nimport BaseMode from './Modes/BaseMode.ts';\nimport InlineMode from './Modes/InlineMode.ts';\nimport PopupMode from './Modes/PopupMode.ts';\nimport BaseType from './Types/BaseType.ts';\nimport DateTimeType from './Types/DateTimeType.ts';\nimport DateType from './Types/DateType.ts';\nimport InputType from './Types/InputType.ts';\nimport SelectType from './Types/SelectType.ts';\nimport TextAreaType from './Types/TextAreaType.ts';\n\nexport type { Options };\n\nexport default class Editable {\n static BaseType = BaseType;\n static BaseMode = BaseMode;\n static InputType = InputType;\n static TextAreaType = TextAreaType;\n static SelectType = SelectType;\n static DateType = DateType;\n static DateTimeType = DateTimeType;\n static PopupMode = PopupMode;\n static InlineMode = InlineMode;\n\n static types: Map<string, typeof BaseType> = new Map<string, typeof BaseType>([\n ['text', InputType],\n ['password', InputType],\n ['email', InputType],\n ['url', InputType],\n ['tel', InputType],\n ['number', InputType],\n ['range', InputType],\n ['time', InputType],\n ['textarea', TextAreaType],\n ['select', SelectType],\n ['date', DateType],\n ['datetime', DateTimeType],\n ]);\n\n static modes: Map<string, typeof BaseMode> = new Map<string, typeof BaseMode>([\n ['popup', PopupMode],\n ['inline', InlineMode],\n ]);\n\n static registerType(name: string, type: typeof BaseType): void {\n Editable.types.set(name, type);\n }\n\n static registerMode(name: string, mode: typeof BaseMode): void {\n Editable.modes.set(name, mode);\n }\n\n element: HTMLElement;\n options: Options;\n\n typeElement: BaseType;\n modeElement: BaseMode;\n\n private accessibilityAbortController = new AbortController();\n\n constructor(element: HTMLElement, options: Options = {}) {\n this.element = element;\n this.options = { ...options };\n this.init_options();\n this.typeElement = this.route_type();\n this.typeElement.checkUnsupportedOptions();\n this.typeElement.initOptions();\n this.modeElement = this.route_mode();\n this.modeElement.init();\n this.init_text();\n this.init_style();\n this.init_accessibility();\n this.element.dispatchEvent(new CustomEvent('init', { detail: { Editable: this } }));\n }\n\n // Options has no index signature by design (keeps the public shape autocomplete-friendly),\n // so these two helpers are the only place that reads/writes it dynamically by name.\n private readOption(name: string): unknown {\n // @ts-expect-error\n return this.options[name];\n }\n\n private writeOption(name: string, value: unknown): void {\n // @ts-expect-error\n this.options[name] = value;\n }\n\n get_opt(name: string, default_value: unknown): unknown {\n const value = this.element.dataset?.[name] ?? this.readOption(name) ?? default_value;\n this.writeOption(name, value);\n return value;\n }\n\n get_opt_object(name: string, default_value: unknown): void {\n // Object-valued options are JS-only — dataset is deliberately not read here\n this.writeOption(name, this.readOption(name) ?? default_value);\n }\n\n get_opt_bool(name: string, default_value: boolean): void {\n this.get_opt(name, default_value);\n if (typeof this.readOption(name) !== 'boolean') {\n if (this.readOption(name) === 'true') {\n this.writeOption(name, true);\n return;\n }\n if (this.readOption(name) === 'false') {\n this.writeOption(name, false);\n return;\n }\n this.writeOption(name, default_value);\n }\n }\n\n init_options(): void {\n //priority date elements\n this.get_opt('value', this.element.textContent ?? '');\n this.get_opt('name', this.element.id || 'value');\n this.get_opt('title', '');\n this.get_opt('type', 'text');\n this.get_opt('emptyText', 'Empty');\n this.get_opt('mode', 'popup');\n this.get_opt('url', null);\n this.get_opt_object('ajaxOptions', {});\n this.options.ajaxOptions = Object.assign({ method: 'POST' }, this.options.ajaxOptions);\n this.get_opt_bool('send', true);\n this.get_opt_bool('required', false);\n this.get_opt_bool('showButtons', true);\n if (this.options?.success && typeof this.options?.success === 'function') {\n this.success = this.options.success;\n }\n if (this.options?.error && typeof this.options?.error === 'function') {\n this.error = this.options.error;\n }\n this.get_opt_object('attributes', {});\n this.get_opt_object('popoverOptions', {});\n }\n\n init_text() {\n const empty_class = 'editable-element-empty';\n this.element.classList.remove(empty_class);\n if (this.typeElement.initText()) {\n this.element.classList.add(empty_class);\n }\n }\n\n init_style() {\n this.element.classList.add('editable-element');\n }\n\n // The trigger has no native keyboard semantics unless the host already made it one\n // (a real <button> or <a href>) — give it button-like tabbing and Enter/Space activation\n // otherwise. Guarded to the element itself so keys typed into an open inline-mode input,\n // which lives inside this same element, don't re-trigger it.\n init_accessibility(): void {\n const el = this.element;\n const isNativelyInteractive =\n el.tagName === 'BUTTON' ||\n el.tagName === 'INPUT' ||\n el.tagName === 'SELECT' ||\n el.tagName === 'TEXTAREA' ||\n (el.tagName === 'A' && el.hasAttribute('href'));\n if (isNativelyInteractive) return;\n\n if (!el.hasAttribute('tabindex')) {\n el.tabIndex = 0;\n }\n if (!el.hasAttribute('role')) {\n el.setAttribute('role', 'button');\n }\n el.addEventListener(\n 'keydown',\n (e) => {\n if (e.target !== el) return;\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n el.click();\n }\n },\n { signal: this.accessibilityAbortController.signal },\n );\n }\n\n route_mode(): BaseMode {\n const ModeClass = Editable.modes.get(this.options.mode as string);\n if (!ModeClass) {\n throw new Error(\n `Mode \"${this.options.mode}\" is not registered. Available modes: ${[...Editable.modes.keys()].join(', ')}. Register custom modes via Editable.registerMode(name, ModeClass).`,\n );\n }\n return new ModeClass(this);\n }\n\n route_type(): BaseType {\n if (this.options.type && typeof this.options.type !== 'string') {\n // @ts-expect-error\n return new this.options.type(this);\n }\n const TypeClass = Editable.types.get(this.options.type as string);\n if (!TypeClass) {\n throw new Error(\n `Type \"${this.options.type}\" is not registered. Available types: ${[...Editable.types.keys()].join(', ')}. Register custom types via Editable.registerType(name, TypeClass).`,\n );\n }\n return new TypeClass(this);\n }\n\n async success(response: Response, newValue: string): Promise<string | undefined> {\n return await this.typeElement.successResponse(response, newValue);\n }\n\n async error(response: Response, newValue: string): Promise<string | undefined> {\n return await this.typeElement.errorResponse(response, newValue);\n }\n\n enable(): void {\n this.element.classList.remove('editable-element-disabled');\n this.modeElement.enable();\n }\n\n disable(): void {\n this.element.classList.add('editable-element-disabled');\n this.modeElement.disable();\n }\n\n setValue(value: string): void {\n this.options.value = value;\n this.init_text();\n }\n\n getValue(): string {\n return this.options.value ?? '';\n }\n\n getOption(name: string): unknown {\n return this.readOption(name) ?? null;\n }\n\n destroy(): void {\n this.accessibilityAbortController.abort();\n this.modeElement.destroy();\n this.element.classList.remove('editable-element', 'editable-element-disabled', 'editable-element-empty');\n }\n}\n"],"x_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