@optionfactory/ful 0.37.0 → 0.38.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/dist/ful.iife.js +54 -36
- package/dist/ful.iife.js.map +1 -1
- package/dist/ful.iife.min.js +1 -1
- package/dist/ful.iife.min.js.map +1 -1
- package/dist/ful.min.mjs +1 -1
- package/dist/ful.min.mjs.map +1 -1
- package/dist/ful.mjs +54 -36
- package/dist/ful.mjs.map +1 -1
- package/package.json +1 -1
package/dist/ful.min.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ful.min.mjs","sources":["../src/encodings.mjs","../src/http-client.mjs","../src/storage.mjs","../src/oauth-authorization-code.mjs","../src/timing.mjs","../src/elements/elements.mjs","../src/elements/form.mjs","../src/elements/input.mjs","../src/elements/select.mjs","../src/elements/radio.mjs","../src/elements/spinner.mjs","../src/elements/wizard.mjs"],"sourcesContent":["\n\nclass Base64 {\n static encode(arrayBuffer, dialect) {\n const d = dialect || Base64.URL_SAFE;\n const len = arrayBuffer.byteLength;\n const view = new Uint8Array(arrayBuffer);\n let res = '';\n for (let i = 0; i < len; i += 3) {\n const v1 = d[view[i] >> 2];\n const v2 = d[((view[i] & 3) << 4) | (view[i + 1] >> 4)];\n const v3 = d[((view[i + 1] & 15) << 2) | (view[i + 2] >> 6)];\n const v4 = d[view[i + 2] & 63];\n res += v1 + v2 + v3 + v4;\n }\n if (len % 3 === 2) {\n res = res.substring(0, res.length - 1);\n } else if (len % 3 === 1) {\n res = res.substring(0, res.length - 2);\n }\n return res;\n }\n static decode(str, dialect) {\n const d = dialect || Base64.URL_SAFE;\n let nbytes = Math.floor(str.length * 0.75);\n for (let i = 0; i !== str.length; ++i) {\n if (str[str.length - i - 1] !== '=') {\n break;\n }\n --nbytes;\n }\n const view = new Uint8Array(nbytes);\n\n let vi = 0;\n let si = 0;\n while (vi < str.length * 0.75) {\n const v1 = d.indexOf(str.charAt(si++));\n const v2 = d.indexOf(str.charAt(si++));\n const v3 = d.indexOf(str.charAt(si++));\n const v4 = d.indexOf(str.charAt(si++));\n view[vi++] = (v1 << 2) | (v2 >> 4);\n view[vi++] = ((v2 & 15) << 4) | (v3 >> 2);\n view[vi++] = ((v3 & 3) << 6) | v4;\n }\n\n return view.buffer;\n }\n}\n\nBase64.STANDARD = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nBase64.URL_SAFE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';\n\n\nclass Hex {\n static decode(hex) {\n if (hex.length % 2 !== 0) {\n throw new Error(\"invalid length\");\n }\n const lenInBytes = hex.length / 2;\n return new Uint8Array(lenInBytes).map((e, i) => {\n const offset = i * 2;\n const octet = hex.substring(offset, offset + 2);\n return parseInt(octet, 16);\n });\n }\n static encode(bytes, upper) {\n return Array.from(bytes)\n .map(b => b.toString(16))\n .map(b => upper ? b.toUpperCase() : b)\n .map(o => o.padStart(2, 0))\n .join('');\n }\n}\n\nexport { Base64, Hex };","class ContextInterceptor {\n constructor() {\n const context = document.querySelector(\"meta[name='context']\").getAttribute(\"content\");\n this.context = context.endsWith(\"/\") ? context.substring(0, context.length - 1) : context;\n }\n async intercept(request, chain){\n const separator = request.resource.startsWith(\"/\") ? \"\" : \"/\";\n request.resource = this.context + separator + request.resource;\n return await chain.proceed(request);\n }\n}\n\nclass CsrfTokenInterceptor {\n constructor() {\n this.k = document.querySelector(\"meta[name='_csrf_header']\").getAttribute(\"content\");\n this.v = document.querySelector(\"meta[name='_csrf']\").getAttribute(\"content\");\n }\n async intercept(request, chain){\n const headers = new Headers(request.options.headers);\n headers.set(this.k, this.v);\n request.options.headers = headers;\n return await chain.proceed(request);\n }\n}\n\nclass RedirectOnUnauthorizedInterceptor {\n constructor(redirectUri) {\n this.redirectUri = redirectUri;\n }\n async intercept(request, chain){\n const response = await chain.proceed(request);\n if (response.status !== 401) {\n return response;\n }\n window.location.href = this.redirectUri;\n }\n}\n\nclass Failure extends Error {\n static parseProblems(status, text) {\n const def = [{\n type: \"GENERIC_PROBLEM\",\n context: null,\n reason: `${status}: ${text}`,\n details: null\n }];\n try {\n return text ? JSON.parse(text) : def;\n } catch (e) {\n return def;\n }\n }\n static fromResponse(status, text) {\n return new Failure(status, Failure.parseProblems(status, text));\n }\n constructor(status, problems) {\n super(JSON.stringify(problems));\n this.name = `Failure:${status}`;\n this.status = status;\n this.problems = problems;\n }\n}\n\nclass HttpClientBuilder {\n constructor() {\n this.interceptors = [];\n }\n withContext() {\n this.interceptors.push(new ContextInterceptor());\n return this;\n }\n withCsrfToken() {\n this.interceptors.push(new CsrfTokenInterceptor());\n return this;\n }\n withRedirectOnUnauthorized(redirectUri) {\n this.interceptors.push(new RedirectOnUnauthorizedInterceptor(redirectUri));\n return this;\n }\n withInterceptors(...interceptors) {\n this.interceptors.push(...interceptors);\n return this;\n }\n build() {\n const interceptors = this.interceptors;\n return new HttpClient({interceptors});\n }\n}\n\nclass HttpCall {\n async intercept(request, chain){\n return await fetch(request.resource, request.options);\n } \n}\n\nclass HttpInterceptorChain {\n constructor(interceptors, current){\n this.interceptors = interceptors;\n this.current = current;\n }\n async proceed(request){\n const interceptor = this.interceptors[this.current];\n return await interceptor.intercept(request, new HttpInterceptorChain(this.interceptors, this.current + 1));\n }\n}\n\n\nclass HttpClient {\n static builder() {\n return new HttpClientBuilder();\n }\n constructor({interceptors}){\n this.interceptors = interceptors || [];\n }\n async exchange(resource, options) {\n const opts = options || {};\n const interceptors = [...this.interceptors, ...opts.interceptors || [], new HttpCall()];\n const chain = new HttpInterceptorChain(interceptors, 0);\n return await chain.proceed({resource, options: opts});\n }\n async fetch(resource, options) {\n const response = await this.exchange(resource, options);\n if (!response.ok) {\n const message = await response.text();\n throw Failure.fromResponse(response.status, message);\n } \n return response;\n }\n async json(resource, options) {\n try {\n const response = await this.fetch(resource, options);\n const text = await response.text();\n return text ? JSON.parse(text) : undefined;\n } catch (e) {\n if (e instanceof Failure) {\n throw e;\n }\n throw new Failure(0, [{\n type: \"CONNECTION_PROBLEM\",\n context: null,\n reason: e.message,\n details: null\n }]);\n }\n }\n}\n\nfunction jsonRequest(method, body, headers){\n return {\n headers: {\n \"Content-Type\": \"application/json\",\n ...headers\n },\n method: method,\n body: JSON.stringify(body) \n }\n}\nfunction jsonPost(body, headers){\n return jsonRequest('POST', body, headers);\n}\nfunction jsonPut(body, headers){\n return jsonRequest('PUT', body, headers);\n}\nfunction jsonPatch(body, headers){\n return jsonRequest('PATCH', body, headers);\n}\n\n\nexport { HttpClient, Failure, jsonRequest, jsonPost, jsonPut, jsonPatch };\n","\nclass Storage {\n constructor(prefix, storage) {\n this.prefix = prefix;\n this.storage = storage;\n }\n save(k, v) {\n this.storage.setItem(`${this.prefix}-${k}`, JSON.stringify(v));\n }\n load(k) {\n const got = this.storage.getItem(`${this.prefix}-${k}`);\n return got === undefined ? undefined : JSON.parse(got);\n }\n remove(k) {\n this.storage.removeItem(`${this.prefix}-${k}`);\n }\n pop(k) {\n const decoded = this.load(k);\n this.remove(k);\n return decoded;\n }\n}\n\nclass LocalStorage extends Storage {\n constructor(prefix) {\n super(prefix, localStorage);\n }\n}\n\nclass SessionStorage extends Storage {\n constructor(prefix) {\n super(prefix, sessionStorage);\n }\n}\n\nclass VersionedStorage {\n constructor(storage, key, dataSupplier){\n this.storage = storage;\n this.key = key;\n this.dataSupplier = dataSupplier;\n this.cache = null;\n \n }\n async load(revision){\n const saved = this.storage.load(this.key);\n if (!!saved && saved.revision === revision) {\n this.cache = saved.value;\n return;\n }\n const freshData = await this.dataSupplier(revision, this.key);\n this.storage.save(this.key, {\n revision: revision,\n value: freshData\n });\n this.cache = freshData;\n }\n data(){\n return this.cache;\n }\n}\n\n\n\nexport {LocalStorage, SessionStorage, VersionedStorage};","import { Base64 } from \"./encodings.mjs\";\nimport { SessionStorage } from \"./storage.mjs\";\n\n\nclass AuthorizationCodeFlow {\n static forKeycloak(clientId, realmBaseUrl, redirectUri){\n const scope = \"openid profile\";\n return new AuthorizationCodeFlow(clientId, scope, {\n auth: new URL(\"protocol/openid-connect/auth\", realmBaseUrl),\n token: new URL(\"protocol/openid-connect/token\", realmBaseUrl),\n logout: new URL(\"protocol/openid-connect/logout\", realmBaseUrl),\n registration: new URL(\"protocol/openid-connect/registrations\", realmBaseUrl),\n redirect: redirectUri\n }); \n }\n constructor(clientId, scope, {auth, token, registration, logout, redirect}) {\n this.storage = new SessionStorage(clientId);\n this.clientId = clientId;\n this.scope = scope;\n this.uri = {auth, token, registration, logout, redirect};\n }\n async action(uri, additionalParams){\n const pkceVerifier = Base64.encode(crypto.getRandomValues(new Uint8Array(32)).buffer);\n const pkceChallenge = Base64.encode(await crypto.subtle.digest(\"SHA-256\", new TextEncoder().encode(pkceVerifier)));\n const state = this.clientId + Base64.encode(crypto.getRandomValues(new Uint8Array(16)).buffer);\n this.storage.save(AuthorizationCodeFlow.PKCE_AND_STATE_KEY, {\n state: state,\n verifier: pkceVerifier\n });\n const url = new URL(uri);\n url.searchParams.set(\"client_id\", this.clientId);\n url.searchParams.set(\"redirect_uri\", this.uri.redirect);\n url.searchParams.set(\"response_type\", 'code');\n url.searchParams.set(\"scope\", this.scope);\n url.searchParams.set(\"state\", state);\n url.searchParams.set(\"code_challenge\", pkceChallenge);\n url.searchParams.set(\"code_challenge_method\", 'S256');\n Object.entries(additionalParams || {}).forEach(kv => {\n url.searchParams.set(kv[0], kv[1]);\n });\n window.location = url;\n }\n async registration(additionalParams){\n await this.action(this.uri.registration, additionalParams);\n }\n async applicationInitiatedAction(kcAction){\n await this.action(this.uri.auth, {\n kc_action: kcAction\n });\n }\n async _tokenExchange(code, state) {\n window.history.replaceState('', \"\", this.uri.redirect);\n const stateAndVerifier = this.storage.pop(AuthorizationCodeFlow.PKCE_AND_STATE_KEY);\n if (stateAndVerifier.state !== state) {\n throw new Error(\"State mismatch\");\n }\n const response = await fetch(this.uri.token, {\n method: \"POST\",\n headers: {\n \"Content-Type\": 'application/x-www-form-urlencoded'\n },\n body: new URLSearchParams([\n [\"client_id\", this.clientId],\n [\"code\", code],\n [\"grant_type\", \"authorization_code\"],\n [\"code_verifier\", stateAndVerifier.verifier],\n [\"state\", stateAndVerifier.state],\n [\"redirect_uri\", this.uri.redirect]\n ])\n });\n if (!response.ok) {\n const text = await response.text();\n throw new Error(\"Error:\" + response.status + \": \" + text);\n }\n const token = await response.json();\n return new AuthorizationCodeFlowSession(this.clientId, token, this.uri);\n }\n async ensureLoggedIn() {\n const url = new URL(window.location.href);\n const code = url.searchParams.get(\"code\");\n if (code && this.storage.load(AuthorizationCodeFlow.PKCE_AND_STATE_KEY)) {\n //if callback from keycloak and we have our state still stored\n const state = url.searchParams.get(\"state\");\n return await this._tokenExchange(code, state);\n }\n //if not authorized\n await this.action(this.uri.auth, {});\n return null;\n }\n}\nAuthorizationCodeFlow.PKCE_AND_STATE_KEY = \"state-and-verifier\";\n\nclass AuthorizationCodeFlowSession {\n static parseToken(token) {\n const [rawHeader, rawPayload, signature] = token.split(\".\");\n const ut8decoder = new TextDecoder(\"utf-8\");\n return {\n header: JSON.parse(ut8decoder.decode(Base64.decode(rawHeader, Base64.STANDARD))),\n payload: JSON.parse(ut8decoder.decode(Base64.decode(rawPayload, Base64.STANDARD))),\n signature: signature\n };\n } \n constructor(clientId, t, {token, logout, redirect}) {\n this.clientId = clientId;\n this.token = t;\n this.accessToken = AuthorizationCodeFlowSession.parseToken(t.access_token);\n this.refreshToken = AuthorizationCodeFlowSession.parseToken(t.refresh_token);\n this.uri = { token, logout, redirect }\n this.refreshCallback = null;\n }\n onRefresh(callback) {\n this.refreshCallback = callback;\n }\n async refresh() {\n const response = await fetch(this.uri.token, {\n method: \"POST\",\n headers: {\n \"Content-Type\": 'application/x-www-form-urlencoded'\n },\n body: new URLSearchParams([\n [\"client_id\", this.clientId],\n [\"grant_type\", \"refresh_token\"],\n [\"refresh_token\", this.token.refresh_token]\n ])\n });\n if (!response.ok) {\n throw new Error(\"Error:\" + response.status + \": \" + response.text());\n }\n const token = await response.json();\n this.token = token;\n this.accessToken = AuthorizationCodeFlowSession.parseToken(token.access_token);\n this.refreshToken = AuthorizationCodeFlowSession.parseToken(token.refresh_token);\n if (this.refreshCallback) {\n this.refreshCallback(this.token, this.accessToken, this.refreshToken);\n }\n }\n shouldBeRefreshed(gracePeriod) {\n const now = new Date().getTime();\n const refreshTokenExpiresAt = this.refreshToken.payload.exp * 1000;\n const expired = now > refreshTokenExpiresAt;\n const shouldRefresh = now - gracePeriod > refreshTokenExpiresAt;\n return !expired && shouldRefresh;\n }\n async refreshIf(gracePeriod) {\n if (!this.shouldBeRefreshed(gracePeriod)) {\n return;\n }\n await this.refresh();\n }\n logout() {\n const url = new URL(this.uri.logout);\n url.searchParams.set(\"post_logout_redirect_uri\", this.uri.redirect);\n url.searchParams.set(\"id_token_hint\", this.token.id_token);\n window.location = url;\n }\n\n bearerToken() {\n return `Bearer ${this.token.access_token}`;\n }\n \n interceptor(gracePeriodBefore, gracePeriodAfter){\n return new AuthorizationCodeFlowInterceptor(this, gracePeriodBefore, gracePeriodAfter); \n }\n}\n\nclass AuthorizationCodeFlowInterceptor {\n constructor(session, gracePeriodBefore, gracePeriodAfter) {\n this.session = session;\n this.gracePeriodBefore = gracePeriodBefore || 2000;\n this.gracePeriodAfter = gracePeriodAfter || 30000;\n }\n async intercept(request, chain) {\n await this.session.refreshIf(this.gracePeriodBefore);\n const headers = new Headers(request.options.headers);\n headers.set(\"Authorization\", this.session.bearerToken());\n request.options.headers = headers;\n const response = await chain.proceed(request);\n await this.session.refreshIf(this.gracePeriodAfter);\n return response;\n }\n}\n\n\nexport {AuthorizationCodeFlow, AuthorizationCodeFlowSession, AuthorizationCodeFlowInterceptor };","\nconst timing = {\n sleep(ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n },\n DEBOUNCE_DEFAULT: 0,\n DEBOUNCE_IMMEDIATE: 1,\n debounce(timeoutMs, func, options) {\n let tid = null;\n let args = [];\n let previousTimestamp = 0;\n let opts = options || timing.DEBOUNCE_DEFAULT;\n\n const later = () => {\n const elapsed = new Date().getTime() - previousTimestamp;\n if (timeoutMs > elapsed) {\n tid = setTimeout(later, timeoutMs - elapsed);\n return;\n }\n tid = null;\n if (opts !== timing.DEBOUNCE_IMMEDIATE) {\n func(...args);\n }\n // This check is needed because `func` can recursively invoke `debounced`.\n if (tid === null) {\n args = [];\n }\n };\n\n return function () {\n args = arguments;\n previousTimestamp = new Date().getTime();\n if (tid === null) {\n tid = setTimeout(later, timeoutMs);\n if (opts === timing.DEBOUNCE_IMMEDIATE) {\n func(...args);\n }\n }\n };\n },\n THROTTLE_DEFAULT: 0,\n THROTTLE_NO_LEADING: 1,\n THROTTLE_NO_TRAILING: 2,\n throttle(timeoutMs, func, options) {\n let tid = null;\n let args = [];\n let previousTimestamp = 0;\n let opts = options || timing.THROTTLE_DEFAULT;\n\n const later = () => {\n previousTimestamp = (opts & timing.THROTTLE_NO_LEADING) ? 0 : new Date().getTime();\n tid = null;\n func(...args);\n if (tid === null) {\n args = [];\n }\n };\n\n return function () {\n const now = new Date().getTime();\n if (!previousTimestamp && (opts & timing.THROTTLE_NO_LEADING)) {\n previousTimestamp = now;\n }\n const remaining = timeoutMs - (now - previousTimestamp);\n args = arguments;\n if (remaining <= 0 || remaining > timeoutMs) {\n if (tid !== null) {\n clearTimeout(tid);\n tid = null;\n }\n previousTimestamp = now;\n func(...args);\n if (tid === null) {\n args = [];\n }\n } else if (tid === null && !(opts & timing.THROTTLE_NO_TRAILING)) {\n tid = setTimeout(later, remaining);\n }\n };\n\n }\n};\n\n\nexport { timing };","class Fragments {\n static fromHtml(...html) {\n const el = document.createElement('div');\n el.innerHTML = html.join(\"\");\n const fragment = new DocumentFragment();\n Array.from(el.childNodes).forEach(node => {\n fragment.appendChild(node);\n });\n return fragment;\n } \n static toHtml(fragment) {\n var r = document.createElement(\"root\");\n r.appendChild(fragment);\n return r.innerHTML;\n }\n static from(...nodes) {\n const fragment = new DocumentFragment();\n for (let i = 0; i !== nodes.length; ++i) {\n fragment.appendChild(nodes[i]);\n }\n return fragment;\n }\n static fromChildNodes(el) {\n const nodes = Array.from(el.childNodes);\n const fragment = new DocumentFragment();\n for (let i = 0; i !== nodes.length; ++i) {\n fragment.appendChild(nodes[i]);\n }\n return fragment;\n }\n}\n\nclass Attributes {\n static id = 0;\n static uid(prefix) {\n return `${prefix}-${++Attributes.id}`;\n }\n static asBoolean(value) {\n return value !== null && value !== undefined && value !== false;\n }\n static defaultValue(el, k, v) {\n if (!el.hasAttribute(k)) {\n el.setAttribute(k, v);\n }\n return el.getAttribute(k);\n }\n static forward(prefix, from, to) {\n from.getAttributeNames()\n .filter(a => a.startsWith(prefix))\n .forEach(a => {\n const target = a.substring(prefix.length);\n if (target === 'class') {\n to.classList.add(...from.getAttribute(prefix + \"class\").split(\" \").filter(a => a.length));\n return;\n }\n to.setAttribute(target, from.getAttribute(a))\n });\n }\n}\n\nclass Slots {\n static from(el) {\n const namedSlots = Array.from(el.childNodes)\n .filter(el => el.matches && el.matches('[slot]'))\n .map(el => {\n el.remove();\n const slot = el.getAttribute(\"slot\");\n el.removeAttribute(\"slot\");\n return [slot, el];\n });\n const slotted = Object.fromEntries(namedSlots);\n slotted.default = new DocumentFragment();\n slotted.default.append(...el.childNodes);\n return slotted;\n }\n}\n\nconst Templated = (SuperClass, template) => {\n return class extends SuperClass {\n rendered_;\n get rendered() {\n return this.rendered_;\n }\n async connectedCallback() {\n if (this.rendered_) {\n return;\n }\n const slotted = Slots.from(this);\n const fragment = await Promise.resolve(this.render(slotted, template));\n this.innerHTML = '';\n if (fragment) {\n this.appendChild(fragment);\n }\n this.rendered_ = true;\n }\n };\n}\n\nconst Stateful = (SuperClass, flags, others) => {\n\n const all = [].concat(flags).concat(others || []);\n\n return class extends SuperClass {\n static get observedAttributes() {\n return all;\n }\n constructor(...args) {\n super(...args);\n this.internals_ = this.internals_ || this.attachInternals();\n for (const flag of flags) {\n Object.defineProperty(this, flag, {\n get() {\n return this.hasAttribute(flag);\n },\n set(value) {\n //see https://developer.mozilla.org/en-US/docs/Web/API/CustomStateSet#using_double_dash_prefixed_idents\n if (Attributes.asBoolean(value)) {\n this.internals_.states.add(`--${flag}`);\n this.setAttribute(flag, '');\n return;\n }\n this.internals_.states.delete(`--${flag}`);\n this.removeAttribute(flag);\n }\n });\n }\n }\n attributeChangedCallback(name, oldValue, newValue) {\n if (oldValue === newValue) {\n return;\n }\n this[name] = newValue;\n const method = this[`on${name.charAt(0).toUpperCase()}${name.substr(1).toLowerCase()}Changed`];\n method?.call(this, newValue, oldValue);\n }\n };\n}\n\nexport { Fragments, Attributes, Slots, Templated, Stateful };\n","/* global Infinity, CSS */\n\nimport { Failure } from \"../http-client.mjs\";\nimport { Templated } from \"./elements.mjs\"\n\nclass Form extends Templated(HTMLElement) {\n static MUTATORS = {};\n static EXTRACTORS = {};\n static VALUE_HOLDERS_SELECTOR = '[name]';\n static IGNORED_CHILDREN_SELECTOR = '.d-none, [hidden]';\n\n render(slotted, template) {\n const form = document.createElement('form');\n form.append(slotted.default);\n form.addEventListener('submit', async (e) => {\n e.preventDefault();\n this.spinner(true);\n try {\n if (this.submitter) {\n await this.submitter(this.getValues(), this);\n }\n } catch (e) {\n if (e instanceof Failure) {\n this.setErrors(e.problems);\n return;\n }\n throw e;\n } finally {\n this.spinner(false)\n }\n })\n return form;\n }\n spinner(spin) {\n this.querySelectorAll('ful-spinner').forEach(el => {\n el.hidden = !spin;\n })\n this.querySelectorAll('[type=submit],[type=reset]').forEach(el => {\n el.disabled = spin;\n })\n }\n setValues(values) {\n for (let k in values) {\n if (!values.hasOwnProperty(k)) {\n continue;\n }\n Array.from(this.querySelectorAll(`[name='${CSS.escape(k)}']`)).forEach((el) => {\n Form.mutate(Form.MUTATORS, el, values[k], k, values);\n });\n }\n }\n getValues() {\n return Array.from(this.querySelectorAll(Form.VALUE_HOLDERS_SELECTOR))\n .filter((el) => {\n if (el.dataset['fulBindInclude'] === 'never') {\n return false;\n }\n return el.dataset['fulBindInclude'] === 'always' || el.closest(Form.IGNORED_CHILDREN_SELECTOR) === null;\n })\n .reduce((result, el) => {\n return Form.providePath(result, el.getAttribute('name'), Form.extract(Form.EXTRACTORS, el));\n }, {});\n }\n setErrors(errors, scroll) {\n this.clearErrors();\n errors\n .filter((e) => e.type === 'FIELD_ERROR' || e.type === 'INVALID_FORMAT')\n .forEach((e) => {\n const name = e.context.replace(\"[\", \".\").replace(\"].\", \".\");\n //TODO: match [name=] ful-validation-target and [name=]:not(:has(ful-validation-target))\n //\n this.querySelectorAll(`[name='${CSS.escape(name)}']`)\n .forEach(input => input.classList.add('is-invalid'));\n this.querySelectorAll(`ful-field-error[field='${CSS.escape(name)}']`)\n .forEach(el => el.innerText = e.reason);\n });\n this.querySelectorAll(\"ful-errors\")\n .forEach(el => {\n const globalErrors = errors.filter((e) => e.type !== 'FIELD_ERROR' && e.type !== 'INVALID_FORMAT');\n el.innerHTML = globalErrors.map(e => e.reason).join(\"\\n\");\n if (globalErrors.length !== 0) {\n el.removeAttribute('hidden');\n }\n })\n\n if (!scroll) {\n return;\n }\n const ys = Array.from(this.querySelectorAll('ful-field-error'))\n .map(el => el.getBoundingClientRect().y + window.scrollY)\n const miny = Math.min(...ys);\n if (miny !== Infinity) {\n window.scroll(window.scrollX, miny > 100 ? miny - 100 : 0);\n }\n }\n clearErrors() {\n this.querySelectorAll('.is-invalid')\n .forEach(el => el.classList.remove('is-invalid'));\n this.querySelectorAll(\"ful-errors\")\n .forEach(el => {\n el.innerHTML = '';\n el.setAttribute('hidden', '');\n });\n }\n static extract(extractors, el) {\n const maybeExtractor = extractors[el.dataset['fulBindExtractor']] || extractors[el.dataset['fulBindProvide']];\n if (maybeExtractor) {\n return maybeExtractor(el);\n }\n if (el.getAttribute('type') === 'radio') {\n if (!el.checked) {\n return undefined;\n }\n return el.dataset['fulBindType'] === 'boolean' ? el.value === 'true' : el.value;\n }\n if (el.getAttribute('type') === 'checkbox') {\n return el.checked;\n }\n if (el.dataset['fulBindType'] === 'boolean') {\n return !el.value ? null : el.value === 'true';\n }\n if (el.getValue) {\n return el.getValue();\n }\n return el.value || null;\n }\n static mutate(mutators, el, raw, key, values) {\n const maybeMutator = mutators[el.dataset['fulBindMutator']] || mutators[el.dataset['fulBindProvide']];\n if (maybeMutator) {\n maybeMutator(el, raw, key, values);\n return;\n }\n if (el.getAttribute('type') === 'radio') {\n el.checked = el.getAttribute('value') === raw;\n return;\n }\n if (el.getAttribute('type') === 'checkbox') {\n el.checked = raw;\n return;\n }\n if (el.setValue) {\n el.setValue(raw);\n return;\n }\n el.value = raw;\n }\n\n static providePath(result, path, value) {\n const keys = path.split(\".\").map((k) => k.match(/^[0-9]+$/) ? +k : k);\n let current = result;\n let previous = null;\n for (let i = 0; ; ++i) {\n const ckey = keys[i];\n const pkey = keys[i - 1];\n if (Number.isInteger(ckey) && !Array.isArray(current)) {\n if (previous !== null) {\n previous[pkey] = current = [];\n } else {\n result = current = [];\n }\n }\n if (i === keys.length - 1) {\n //when value is undefined we only want to define the property if it's not defined \n current[ckey] = value !== undefined ? value : (ckey in current ? current[ckey] : null);\n return result;\n }\n if (current[ckey] === undefined) {\n current[ckey] = {};\n }\n previous = current;\n current = current[ckey];\n }\n }\n static custom(tagName, configuration) {\n customElements.define(tagName, class extends Form {\n constructor() {\n super(configuration);\n }\n });\n }\n}\n\nexport { Form };\n","import { Attributes, Templated } from \"./elements.mjs\"\n\nconst ful_input_ec = globalThis.ec || ftl.EvaluationContext.configure({\n\n});\n\nconst ful_input_template_ = globalThis.ful_input_template || ftl.Template.fromHtml(`\n <label data-tpl-for=\"id\" class=\"form-label\">{{{{ slotted.default }}}}</label>\n <div class=\"input-group\">\n <span data-tpl-if=\"slotted.ibefore\" class=\"input-group-text\">{{{{ slotted.ibefore }}}}</span>\n <div data-tpl-if=\"slotted.before\" data-tpl-remove=\"tag\">{{{{ slotted.before }}}}</div>\n {{{{ slotted.input }}}} \n <div data-tpl-if=\"slotted.after\" data-tpl-remove=\"tag\">{{{{ slotted.after }}}}</div>\n <span data-tpl-if=\"slotted.iafter\" class=\"input-group-text\">{{{{ slotted.iafter }}}}</span>\n </div>\n <ful-field-error data-tpl-if=\"name\" data-tpl-field=\"name\"></ful-field-error>\n`, ful_input_ec);\n\nclass Input extends Templated(HTMLElement, ful_input_template_) {\n render(slotted, template) {\n const input = slotted.input = slotted.input || (() => {\n const el = document.createElement(\"input\")\n el.classList.add(\"form-control\");\n return el;\n })();\n const id = input.getAttribute('id') || this.getAttribute('input-id') || Attributes.uid('ful-input');\n Attributes.forward('input-', this, slotted.input)\n Attributes.defaultValue(slotted.input, \"id\", id);\n Attributes.defaultValue(slotted.input, \"type\", \"text\");\n Attributes.defaultValue(slotted.input, \"placeholder\", \" \");\n const name = input.getAttribute('name');\n return template.render({ id, name, slotted });\n }\n static configure() {\n customElements.define('ful-input', Input);\n }\n}\n\nexport { Input };\n","import { Fragments, Attributes, Templated } from \"./elements.mjs\"\n/**\n * <script src=\"tom-select.complete.js\"></script>\n * <link href=\"tom-select.bootstrap5.css\" rel=\"stylesheet\" />\n */\nconst ful_select_ec = globalThis.ec || ftl.EvaluationContext.configure({\n\n});\n\nconst ful_select_template_ = globalThis.ful_select_template || ftl.Template.fromHtml(`\n <label data-tpl-for=\"tsId\" class=\"form-label\">{{{{ slotted.default }}}}</label>\n {{{{ input }}}}\n <div class=\"input-group\">\n <span data-tpl-if=\"slotted.ibefore\" class=\"input-group-text\">{{{{ slotted.ibefore }}}}</span>\n <div data-tpl-if=\"slotted.before\" data-tpl-remove=\"tag\">{{{{ slotted.before }}}}</div>\n {{{{ slotted.input }}}} \n <div data-tpl-if=\"slotted.after\" data-tpl-remove=\"tag\">{{{{ slotted.after }}}}</div>\n <span data-tpl-if=\"slotted.iafter\" class=\"input-group-text\">{{{{ slotted.iafter }}}}</span>\n </div>\n <ful-field-error data-tpl-if=\"name\" data-tpl-field=\"name\"></ful-field-error> \n`, ful_select_ec);\n\n\nclass Select extends Templated(HTMLElement, ful_select_template_) {\n constructor(tsConfig) {\n super();\n this.tsConfig = tsConfig;\n }\n render(slotted, template) {\n const type = this.getAttribute(\"type\") || 'local';\n const remote = type != 'local';\n const loadOnce = this.getAttribute('load') != 'always';\n\n const input = slotted.input = slotted.input || (() => {\n return document.createElement(\"select\");\n })();\n const id = input.getAttribute('id') || this.getAttribute('input-id') || Attributes.uid('ful-select');\n const tsId = `${id}-ts-control`;\n Attributes.forward('input-', this, input)\n Attributes.defaultValue(input, \"id\", id);\n Attributes.defaultValue(input, \"placeholder\", \" \");\n const name = input.getAttribute('name');\n input.setValue = this.setValue.bind(this);\n input.getValue = this.getValue.bind(this);\n\n //tomselect needs the input to have a parent.\n //se we move the input to a fragment\n slotted.input = Fragments.from(input);\n\n this.loaded = !remote;\n\n const tsDefaultConfig = {\n render: {\n loading: () => '<ful-spinner class=\"centered p-2\"></ful-spinner>'\n }\n }\n\n\n this._remote = remote;\n // we need to await this load in setValue when remote is configured and the option\n // is not loaded yet.\n // tomselect settings.load does not retun a promise as it wraps the configured load function\n // with a debouncer\n this._unwrappedRemoteLoad = async (query, callback) => {\n\n if (!remote || remote && loadOnce && this.loaded) {\n callback();\n return;\n }\n const type = query && query.hasOwnProperty('byId') ? 'id' : 'query';\n const qvalue = type === 'id' ? query.byId : query;\n const data = await (this.loader ? this.loader(qvalue, type) : []);\n if(type !== 'id'){\n this.loaded = true;\n }\n callback(data);\n };\n\n\n this.ts = new TomSelect(input, Object.assign(remote ? {\n preload: 'focus',\n load: this._unwrappedRemoteLoad,\n shouldLoad: (query) => this.shouldLoad ? this.shouldLoad(query) : true\n } : {}, tsDefaultConfig, this.tsConfig));\n console.log(\"ts created\");\n //we remove the input to move it\n input.remove();\n\n return template.render({ id, tsId, name, input, slotted });\n }\n async setValue(v) {\n if(this._remote){\n await this._unwrappedRemoteLoad({byId: v}, this.ts.loadCallback.bind(this.ts));\n }\n this.ts.setValue(v);\n }\n getValue() {\n const v = this.ts.getValue();\n return v === '' ? null : v;\n }\n static custom(tagName, configuration) {\n customElements.define(tagName, class extends Select {\n constructor() {\n super(configuration);\n }\n });\n }\n static configure() {\n return Select.custom('ful-select');\n }\n\n}\n\nexport { Select };\n","import { Attributes, Fragments, Stateful, Templated } from \"./elements.mjs\"\n\n\n\n\n\nconst ful_radiogroup_ec = globalThis.ec || ftl.EvaluationContext.configure({\n\n});\n\nconst ful_radiougroup_template_ = globalThis.ful_radiogroup_template || ftl.Template.fromHtml(`\n <fieldset>\n <legend class=\"form-label\">\n {{{{ slotted.default }}}}\n </legend>\n <header data-tpl-if=\"slotted.header\">\n {{{{ slotted.header }}}}\n </header>\n <section>\n <label data-tpl-each=\"inputsAndLabels\" data-tpl-var=\"ial\">\n {{{{ ial[0] }}}}\n {{{{ ial[1] }}}}\n </label>\n </section>\n <ful-field-error data-tpl-if=\"name\" data-tpl-field=\"name\"></ful-field-error>\n </fieldset>\n`, ful_radiogroup_ec);\n\n\nclass RadioGroup extends Stateful(Templated(HTMLElement, ful_radiougroup_template_), ['disabled']) {\n render(slotted, template) { \n const name = this.getAttribute('input-name') || Attributes.uid('ful-radiogroup');\n const radioEls = Array.from(slotted.default.querySelectorAll('ful-radio'));\n const inputsAndLabels = radioEls.map(el => {\n const input = document.createElement('input');\n input.setAttribute('type', 'radio');\n Attributes.forward('input-', this, input);\n Attributes.forward('', el, input);\n Attributes.defaultValue(input, 'name', name);\n const label = Fragments.fromChildNodes(el);\n return [input, label];\n });\n radioEls.forEach(el => el.remove());\n \n const fragment = template.render({\n name: name,\n slotted: slotted,\n inputsAndLabels: inputsAndLabels\n });\n return fragment;\n }\n static configure() {\n customElements.define('ful-radio-group', RadioGroup);\n } \n}\n\n\nexport { RadioGroup };","import { Attributes, Fragments, Templated } from \"./elements.mjs\"\n\n\n\nconst ful_spinner_ec = globalThis.ec || ftl.EvaluationContext.configure({\n\n});\n\nconst ful_spinner_template_ = globalThis.ful_spinner_template || ftl.Template.fromHtml(`\n <div class=\"ful-spinner-wrapper\">\n <div class=\"ful-spinner-text\">{{{{ slotted.default }}}}</div>\n <div class=\"ful-spinner-icon\"></div>\n </div>\n`, ful_spinner_ec);\n\n\nclass Spinner extends Templated(HTMLElement, ful_spinner_template_) {\n render(slotted, template) {\n return template.render({ slotted });\n }\n static configure() {\n customElements.define('ful-spinner', Spinner);\n }\n}\n\nexport { Spinner };","class Wizard extends HTMLElement {\n constructor() {\n super();\n this.progress = [...this.children].filter(e => e.matches(\"header,ol,ul\"));\n\n this.progress.forEach(p => {\n const children = [...p.children];\n const current = children.filter(e => e.matches(\".active\"))[0];\n if (current === undefined && children.length > 0) {\n children[0].classList.add('active');\n }\n });\n if (this.querySelector('section.current') === null) {\n const firstSection = this.querySelector('section:first-of-type');\n if (firstSection !== null) {\n firstSection.classList.add('current');\n }\n }\n }\n next() {\n this.progress.forEach(p => {\n const children = [...p.children];\n const current = children.filter(e => e.matches(\".active\"))[0];\n current?.classList.remove('active');\n current?.nextElementSibling?.classList.add('active');\n });\n const currentSection = this.querySelector('section.current');\n currentSection.classList.remove(\"current\");\n currentSection.nextElementSibling.classList.add('current');\n\n this.dispatchEvent(new CustomEvent('wizard:activate', {\n bubbles: true,\n cancelable: true\n }));\n\n }\n prev() {\n this.progress.forEach(p => {\n const children = [...p.children];\n const current = children.filter(e => e.matches(\".active\"))[0];\n current?.classList.remove('active');\n current?.previousElementSibling?.classList.add('active');\n });\n const currentSection = this.querySelector('section.current');\n currentSection.classList.remove(\"current\");\n currentSection.previousElementSibling.classList.add('current');\n this.dispatchEvent(new CustomEvent('wizard:activate', {\n bubbles: true,\n cancelable: true\n }));\n }\n moveTo = function (n) {\n this.progress.forEach(p => {\n const children = [...p.children];\n const current = children.filter(e => e.matches(\".active\"))[0];\n current?.classList.remove('active');\n p.children[+n]?.classList.add('active');\n });\n const currentSection = this.querySelector('section.current');\n currentSection?.classList.remove(\"current\");\n const nthSection = this.querySelector(`section:nth-child(${+n})`);\n nthSection.classList.add('current');\n this.dispatchEvent(new CustomEvent('wizard:activate', {\n bubbles: true,\n cancelable: true\n }));\n }\n static custom(tagName, configuration) {\n customElements.define(tagName, class extends Wizard {\n constructor() {\n super(configuration);\n }\n });\n }\n static configure() {\n return Wizard.custom('ful-wizard');\n }\n}\n\n\n\n\nexport { Wizard };\n"],"names":["Base64","encode","arrayBuffer","dialect","d","URL_SAFE","len","byteLength","view","Uint8Array","res","i","substring","length","decode","str","nbytes","Math","floor","vi","si","v1","indexOf","charAt","v2","v3","v4","buffer","STANDARD","Hex","hex","Error","lenInBytes","map","e","offset","octet","parseInt","bytes","upper","Array","from","b","toString","toUpperCase","o","padStart","join","ContextInterceptor","constructor","context","document","querySelector","getAttribute","this","endsWith","intercept","request","chain","separator","resource","startsWith","proceed","CsrfTokenInterceptor","k","v","headers","Headers","options","set","RedirectOnUnauthorizedInterceptor","redirectUri","response","status","window","location","href","Failure","parseProblems","text","def","type","reason","details","JSON","parse","fromResponse","problems","super","stringify","name","HttpClientBuilder","interceptors","withContext","push","withCsrfToken","withRedirectOnUnauthorized","withInterceptors","build","HttpClient","HttpCall","fetch","HttpInterceptorChain","current","interceptor","builder","exchange","opts","ok","message","json","undefined","jsonRequest","method","body","jsonPost","jsonPut","jsonPatch","Storage","prefix","storage","save","setItem","load","got","getItem","remove","removeItem","pop","decoded","LocalStorage","localStorage","SessionStorage","sessionStorage","VersionedStorage","key","dataSupplier","cache","revision","saved","value","freshData","data","AuthorizationCodeFlow","forKeycloak","clientId","realmBaseUrl","auth","URL","token","logout","registration","redirect","scope","uri","action","additionalParams","pkceVerifier","crypto","getRandomValues","pkceChallenge","subtle","digest","TextEncoder","state","PKCE_AND_STATE_KEY","verifier","url","searchParams","Object","entries","forEach","kv","applicationInitiatedAction","kcAction","kc_action","_tokenExchange","code","history","replaceState","stateAndVerifier","URLSearchParams","AuthorizationCodeFlowSession","ensureLoggedIn","get","parseToken","rawHeader","rawPayload","signature","split","ut8decoder","TextDecoder","header","payload","t","accessToken","access_token","refreshToken","refresh_token","refreshCallback","onRefresh","callback","refresh","shouldBeRefreshed","gracePeriod","now","Date","getTime","refreshTokenExpiresAt","exp","refreshIf","id_token","bearerToken","gracePeriodBefore","gracePeriodAfter","AuthorizationCodeFlowInterceptor","session","timing","sleep","ms","Promise","resolve","setTimeout","DEBOUNCE_DEFAULT","DEBOUNCE_IMMEDIATE","debounce","timeoutMs","func","tid","args","previousTimestamp","later","elapsed","arguments","THROTTLE_DEFAULT","THROTTLE_NO_LEADING","THROTTLE_NO_TRAILING","throttle","remaining","clearTimeout","Fragments","fromHtml","html","el","createElement","innerHTML","fragment","DocumentFragment","childNodes","node","appendChild","toHtml","r","nodes","fromChildNodes","Attributes","static","uid","id","asBoolean","defaultValue","hasAttribute","setAttribute","forward","to","getAttributeNames","filter","a","target","classList","add","Slots","namedSlots","matches","slot","removeAttribute","slotted","fromEntries","default","append","Templated","SuperClass","template","rendered_","rendered","connectedCallback","render","Stateful","flags","others","all","concat","observedAttributes","internals_","attachInternals","flag","defineProperty","states","delete","attributeChangedCallback","oldValue","newValue","substr","toLowerCase","call","Form","HTMLElement","form","addEventListener","async","preventDefault","spinner","submitter","getValues","setErrors","spin","querySelectorAll","hidden","disabled","setValues","values","hasOwnProperty","CSS","escape","mutate","MUTATORS","VALUE_HOLDERS_SELECTOR","dataset","closest","IGNORED_CHILDREN_SELECTOR","reduce","result","providePath","extract","EXTRACTORS","errors","scroll","clearErrors","replace","input","innerText","globalErrors","ys","getBoundingClientRect","y","scrollY","miny","min","Infinity","scrollX","extractors","maybeExtractor","checked","getValue","mutators","raw","maybeMutator","setValue","path","keys","match","previous","ckey","pkey","Number","isInteger","isArray","custom","tagName","configuration","customElements","define","ful_input_ec","globalThis","ec","ftl","EvaluationContext","configure","ful_input_template_","ful_input_template","Template","Input","ful_select_ec","ful_select_template_","ful_select_template","Select","tsConfig","remote","loadOnce","tsId","bind","loaded","_remote","_unwrappedRemoteLoad","query","qvalue","byId","loader","ts","TomSelect","assign","preload","shouldLoad","loading","console","log","loadCallback","ful_radiogroup_ec","ful_radiougroup_template_","ful_radiogroup_template","RadioGroup","radioEls","inputsAndLabels","ful_spinner_ec","ful_spinner_template_","ful_spinner_template","Spinner","Wizard","progress","children","p","firstSection","next","nextElementSibling","currentSection","dispatchEvent","CustomEvent","bubbles","cancelable","prev","previousElementSibling","moveTo","n"],"mappings":"AAEA,MAAMA,EACF,aAAOC,CAAOC,EAAaC,GACvB,MAAMC,EAAID,GAAWH,EAAOK,SACtBC,EAAMJ,EAAYK,WAClBC,EAAO,IAAIC,WAAWP,GAC5B,IAAIQ,EAAM,GACV,IAAK,IAAIC,EAAI,EAAGA,EAAIL,EAAKK,GAAK,EAAG,CAK7BD,GAJWN,EAAEI,EAAKG,IAAM,GACbP,GAAc,EAAVI,EAAKG,KAAW,EAAMH,EAAKG,EAAI,IAAM,GACzCP,GAAkB,GAAdI,EAAKG,EAAI,KAAY,EAAMH,EAAKG,EAAI,IAAM,GAC9CP,EAAgB,GAAdI,EAAKG,EAAI,GAEzB,CAMD,OALIL,EAAM,GAAM,EACZI,EAAMA,EAAIE,UAAU,EAAGF,EAAIG,OAAS,GAC7BP,EAAM,GAAM,IACnBI,EAAMA,EAAIE,UAAU,EAAGF,EAAIG,OAAS,IAEjCH,CACV,CACD,aAAOI,CAAOC,EAAKZ,GACf,MAAMC,EAAID,GAAWH,EAAOK,SAC5B,IAAIW,EAASC,KAAKC,MAAmB,IAAbH,EAAIF,QAC5B,IAAK,IAAIF,EAAI,EAAGA,IAAMI,EAAIF,QACU,MAA5BE,EAAIA,EAAIF,OAASF,EAAI,KADOA,IAI9BK,EAEN,MAAMR,EAAO,IAAIC,WAAWO,GAE5B,IAAIG,EAAK,EACLC,EAAK,EACT,KAAOD,EAAkB,IAAbJ,EAAIF,QAAe,CAC3B,MAAMQ,EAAKjB,EAAEkB,QAAQP,EAAIQ,OAAOH,MAC1BI,EAAKpB,EAAEkB,QAAQP,EAAIQ,OAAOH,MAC1BK,EAAKrB,EAAEk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BAAmB,CAClDC,SAAS,EACTC,YAAY,IAEnB,EACD,aAAO7D,CAAOC,EAASC,GACnBC,eAAeC,OAAOH,EAAS,cAAciD,EACzC,WAAAhX,GACIuC,MAAMyR,EACT,GAER,CACD,gBAAOQ,GACH,OAAOwC,EAAOlD,OAAO,aACxB"}
|
|
1
|
+
{"version":3,"file":"ful.min.mjs","sources":["../src/encodings.mjs","../src/http-client.mjs","../src/storage.mjs","../src/oauth-authorization-code.mjs","../src/timing.mjs","../src/elements/elements.mjs","../src/elements/form.mjs","../src/elements/input.mjs","../src/elements/select.mjs","../src/elements/radio.mjs","../src/elements/spinner.mjs","../src/elements/wizard.mjs"],"sourcesContent":["\n\nclass Base64 {\n static encode(arrayBuffer, dialect) {\n const d = dialect || Base64.URL_SAFE;\n const len = arrayBuffer.byteLength;\n const view = new Uint8Array(arrayBuffer);\n let res = '';\n for (let i = 0; i < len; i += 3) {\n const v1 = d[view[i] >> 2];\n const v2 = d[((view[i] & 3) << 4) | (view[i + 1] >> 4)];\n const v3 = d[((view[i + 1] & 15) << 2) | (view[i + 2] >> 6)];\n const v4 = d[view[i + 2] & 63];\n res += v1 + v2 + v3 + v4;\n }\n if (len % 3 === 2) {\n res = res.substring(0, res.length - 1);\n } else if (len % 3 === 1) {\n res = res.substring(0, res.length - 2);\n }\n return res;\n }\n static decode(str, dialect) {\n const d = dialect || Base64.URL_SAFE;\n let nbytes = Math.floor(str.length * 0.75);\n for (let i = 0; i !== str.length; ++i) {\n if (str[str.length - i - 1] !== '=') {\n break;\n }\n --nbytes;\n }\n const view = new Uint8Array(nbytes);\n\n let vi = 0;\n let si = 0;\n while (vi < str.length * 0.75) {\n const v1 = d.indexOf(str.charAt(si++));\n const v2 = d.indexOf(str.charAt(si++));\n const v3 = d.indexOf(str.charAt(si++));\n const v4 = d.indexOf(str.charAt(si++));\n view[vi++] = (v1 << 2) | (v2 >> 4);\n view[vi++] = ((v2 & 15) << 4) | (v3 >> 2);\n view[vi++] = ((v3 & 3) << 6) | v4;\n }\n\n return view.buffer;\n }\n}\n\nBase64.STANDARD = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nBase64.URL_SAFE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';\n\n\nclass Hex {\n static decode(hex) {\n if (hex.length % 2 !== 0) {\n throw new Error(\"invalid length\");\n }\n const lenInBytes = hex.length / 2;\n return new Uint8Array(lenInBytes).map((e, i) => {\n const offset = i * 2;\n const octet = hex.substring(offset, offset + 2);\n return parseInt(octet, 16);\n });\n }\n static encode(bytes, upper) {\n return Array.from(bytes)\n .map(b => b.toString(16))\n .map(b => upper ? b.toUpperCase() : b)\n .map(o => o.padStart(2, 0))\n .join('');\n }\n}\n\nexport { Base64, Hex };","class ContextInterceptor {\n constructor() {\n const context = document.querySelector(\"meta[name='context']\").getAttribute(\"content\");\n this.context = context.endsWith(\"/\") ? context.substring(0, context.length - 1) : context;\n }\n async intercept(request, chain){\n const separator = request.resource.startsWith(\"/\") ? \"\" : \"/\";\n request.resource = this.context + separator + request.resource;\n return await chain.proceed(request);\n }\n}\n\nclass CsrfTokenInterceptor {\n constructor() {\n this.k = document.querySelector(\"meta[name='_csrf_header']\").getAttribute(\"content\");\n this.v = document.querySelector(\"meta[name='_csrf']\").getAttribute(\"content\");\n }\n async intercept(request, chain){\n const headers = new Headers(request.options.headers);\n headers.set(this.k, this.v);\n request.options.headers = headers;\n return await chain.proceed(request);\n }\n}\n\nclass RedirectOnUnauthorizedInterceptor {\n constructor(redirectUri) {\n this.redirectUri = redirectUri;\n }\n async intercept(request, chain){\n const response = await chain.proceed(request);\n if (response.status !== 401) {\n return response;\n }\n window.location.href = this.redirectUri;\n }\n}\n\nclass Failure extends Error {\n static parseProblems(status, text) {\n const def = [{\n type: \"GENERIC_PROBLEM\",\n context: null,\n reason: `${status}: ${text}`,\n details: null\n }];\n try {\n return text ? JSON.parse(text) : def;\n } catch (e) {\n return def;\n }\n }\n static fromResponse(status, text) {\n return new Failure(status, Failure.parseProblems(status, text));\n }\n constructor(status, problems) {\n super(JSON.stringify(problems));\n this.name = `Failure:${status}`;\n this.status = status;\n this.problems = problems;\n }\n}\n\nclass HttpClientBuilder {\n constructor() {\n this.interceptors = [];\n }\n withContext() {\n this.interceptors.push(new ContextInterceptor());\n return this;\n }\n withCsrfToken() {\n this.interceptors.push(new CsrfTokenInterceptor());\n return this;\n }\n withRedirectOnUnauthorized(redirectUri) {\n this.interceptors.push(new RedirectOnUnauthorizedInterceptor(redirectUri));\n return this;\n }\n withInterceptors(...interceptors) {\n this.interceptors.push(...interceptors);\n return this;\n }\n build() {\n const interceptors = this.interceptors;\n return new HttpClient({interceptors});\n }\n}\n\nclass HttpCall {\n async intercept(request, chain){\n return await fetch(request.resource, request.options);\n } \n}\n\nclass HttpInterceptorChain {\n constructor(interceptors, current){\n this.interceptors = interceptors;\n this.current = current;\n }\n async proceed(request){\n const interceptor = this.interceptors[this.current];\n return await interceptor.intercept(request, new HttpInterceptorChain(this.interceptors, this.current + 1));\n }\n}\n\n\nclass HttpClient {\n static builder() {\n return new HttpClientBuilder();\n }\n constructor({interceptors}){\n this.interceptors = interceptors || [];\n }\n async exchange(resource, options) {\n const opts = options || {};\n const interceptors = [...this.interceptors, ...opts.interceptors || [], new HttpCall()];\n const chain = new HttpInterceptorChain(interceptors, 0);\n return await chain.proceed({resource, options: opts});\n }\n async fetch(resource, options) {\n const response = await this.exchange(resource, options);\n if (!response.ok) {\n const message = await response.text();\n throw Failure.fromResponse(response.status, message);\n } \n return response;\n }\n async json(resource, options) {\n try {\n const response = await this.fetch(resource, options);\n const text = await response.text();\n return text ? JSON.parse(text) : undefined;\n } catch (e) {\n if (e instanceof Failure) {\n throw e;\n }\n throw new Failure(0, [{\n type: \"CONNECTION_PROBLEM\",\n context: null,\n reason: e.message,\n details: null\n }]);\n }\n }\n}\n\nfunction jsonRequest(method, body, headers){\n return {\n headers: {\n \"Content-Type\": \"application/json\",\n ...headers\n },\n method: method,\n body: JSON.stringify(body) \n }\n}\nfunction jsonPost(body, headers){\n return jsonRequest('POST', body, headers);\n}\nfunction jsonPut(body, headers){\n return jsonRequest('PUT', body, headers);\n}\nfunction jsonPatch(body, headers){\n return jsonRequest('PATCH', body, headers);\n}\n\n\nexport { HttpClient, Failure, jsonRequest, jsonPost, jsonPut, jsonPatch };\n","\nclass Storage {\n constructor(prefix, storage) {\n this.prefix = prefix;\n this.storage = storage;\n }\n save(k, v) {\n this.storage.setItem(`${this.prefix}-${k}`, JSON.stringify(v));\n }\n load(k) {\n const got = this.storage.getItem(`${this.prefix}-${k}`);\n return got === undefined ? undefined : JSON.parse(got);\n }\n remove(k) {\n this.storage.removeItem(`${this.prefix}-${k}`);\n }\n pop(k) {\n const decoded = this.load(k);\n this.remove(k);\n return decoded;\n }\n}\n\nclass LocalStorage extends Storage {\n constructor(prefix) {\n super(prefix, localStorage);\n }\n}\n\nclass SessionStorage extends Storage {\n constructor(prefix) {\n super(prefix, sessionStorage);\n }\n}\n\nclass VersionedStorage {\n constructor(storage, key, dataSupplier){\n this.storage = storage;\n this.key = key;\n this.dataSupplier = dataSupplier;\n this.cache = null;\n \n }\n async load(revision){\n const saved = this.storage.load(this.key);\n if (!!saved && saved.revision === revision) {\n this.cache = saved.value;\n return;\n }\n const freshData = await this.dataSupplier(revision, this.key);\n this.storage.save(this.key, {\n revision: revision,\n value: freshData\n });\n this.cache = freshData;\n }\n data(){\n return this.cache;\n }\n}\n\n\n\nexport {LocalStorage, SessionStorage, VersionedStorage};","import { Base64 } from \"./encodings.mjs\";\nimport { SessionStorage } from \"./storage.mjs\";\n\n\nclass AuthorizationCodeFlow {\n static forKeycloak(clientId, realmBaseUrl, redirectUri){\n const scope = \"openid profile\";\n return new AuthorizationCodeFlow(clientId, scope, {\n auth: new URL(\"protocol/openid-connect/auth\", realmBaseUrl),\n token: new URL(\"protocol/openid-connect/token\", realmBaseUrl),\n logout: new URL(\"protocol/openid-connect/logout\", realmBaseUrl),\n registration: new URL(\"protocol/openid-connect/registrations\", realmBaseUrl),\n redirect: redirectUri\n }); \n }\n constructor(clientId, scope, {auth, token, registration, logout, redirect}) {\n this.storage = new SessionStorage(clientId);\n this.clientId = clientId;\n this.scope = scope;\n this.uri = {auth, token, registration, logout, redirect};\n }\n async action(uri, additionalParams){\n const pkceVerifier = Base64.encode(crypto.getRandomValues(new Uint8Array(32)).buffer);\n const pkceChallenge = Base64.encode(await crypto.subtle.digest(\"SHA-256\", new TextEncoder().encode(pkceVerifier)));\n const state = this.clientId + Base64.encode(crypto.getRandomValues(new Uint8Array(16)).buffer);\n this.storage.save(AuthorizationCodeFlow.PKCE_AND_STATE_KEY, {\n state: state,\n verifier: pkceVerifier\n });\n const url = new URL(uri);\n url.searchParams.set(\"client_id\", this.clientId);\n url.searchParams.set(\"redirect_uri\", this.uri.redirect);\n url.searchParams.set(\"response_type\", 'code');\n url.searchParams.set(\"scope\", this.scope);\n url.searchParams.set(\"state\", state);\n url.searchParams.set(\"code_challenge\", pkceChallenge);\n url.searchParams.set(\"code_challenge_method\", 'S256');\n Object.entries(additionalParams || {}).forEach(kv => {\n url.searchParams.set(kv[0], kv[1]);\n });\n window.location = url;\n }\n async registration(additionalParams){\n await this.action(this.uri.registration, additionalParams);\n }\n async applicationInitiatedAction(kcAction){\n await this.action(this.uri.auth, {\n kc_action: kcAction\n });\n }\n async _tokenExchange(code, state) {\n window.history.replaceState('', \"\", this.uri.redirect);\n const stateAndVerifier = this.storage.pop(AuthorizationCodeFlow.PKCE_AND_STATE_KEY);\n if (stateAndVerifier.state !== state) {\n throw new Error(\"State mismatch\");\n }\n const response = await fetch(this.uri.token, {\n method: \"POST\",\n headers: {\n \"Content-Type\": 'application/x-www-form-urlencoded'\n },\n body: new URLSearchParams([\n [\"client_id\", this.clientId],\n [\"code\", code],\n [\"grant_type\", \"authorization_code\"],\n [\"code_verifier\", stateAndVerifier.verifier],\n [\"state\", stateAndVerifier.state],\n [\"redirect_uri\", this.uri.redirect]\n ])\n });\n if (!response.ok) {\n const text = await response.text();\n throw new Error(\"Error:\" + response.status + \": \" + text);\n }\n const token = await response.json();\n return new AuthorizationCodeFlowSession(this.clientId, token, this.uri);\n }\n async ensureLoggedIn() {\n const url = new URL(window.location.href);\n const code = url.searchParams.get(\"code\");\n if (code && this.storage.load(AuthorizationCodeFlow.PKCE_AND_STATE_KEY)) {\n //if callback from keycloak and we have our state still stored\n const state = url.searchParams.get(\"state\");\n return await this._tokenExchange(code, state);\n }\n //if not authorized\n await this.action(this.uri.auth, {});\n return null;\n }\n}\nAuthorizationCodeFlow.PKCE_AND_STATE_KEY = \"state-and-verifier\";\n\nclass AuthorizationCodeFlowSession {\n static parseToken(token) {\n const [rawHeader, rawPayload, signature] = token.split(\".\");\n const ut8decoder = new TextDecoder(\"utf-8\");\n return {\n header: JSON.parse(ut8decoder.decode(Base64.decode(rawHeader, Base64.STANDARD))),\n payload: JSON.parse(ut8decoder.decode(Base64.decode(rawPayload, Base64.STANDARD))),\n signature: signature\n };\n } \n constructor(clientId, t, {token, logout, redirect}) {\n this.clientId = clientId;\n this.token = t;\n this.accessToken = AuthorizationCodeFlowSession.parseToken(t.access_token);\n this.refreshToken = AuthorizationCodeFlowSession.parseToken(t.refresh_token);\n this.uri = { token, logout, redirect }\n this.refreshCallback = null;\n }\n onRefresh(callback) {\n this.refreshCallback = callback;\n }\n async refresh() {\n const response = await fetch(this.uri.token, {\n method: \"POST\",\n headers: {\n \"Content-Type\": 'application/x-www-form-urlencoded'\n },\n body: new URLSearchParams([\n [\"client_id\", this.clientId],\n [\"grant_type\", \"refresh_token\"],\n [\"refresh_token\", this.token.refresh_token]\n ])\n });\n if (!response.ok) {\n throw new Error(\"Error:\" + response.status + \": \" + response.text());\n }\n const token = await response.json();\n this.token = token;\n this.accessToken = AuthorizationCodeFlowSession.parseToken(token.access_token);\n this.refreshToken = AuthorizationCodeFlowSession.parseToken(token.refresh_token);\n if (this.refreshCallback) {\n this.refreshCallback(this.token, this.accessToken, this.refreshToken);\n }\n }\n shouldBeRefreshed(gracePeriod) {\n const now = new Date().getTime();\n const refreshTokenExpiresAt = this.refreshToken.payload.exp * 1000;\n const expired = now > refreshTokenExpiresAt;\n const shouldRefresh = now - gracePeriod > refreshTokenExpiresAt;\n return !expired && shouldRefresh;\n }\n async refreshIf(gracePeriod) {\n if (!this.shouldBeRefreshed(gracePeriod)) {\n return;\n }\n await this.refresh();\n }\n logout() {\n const url = new URL(this.uri.logout);\n url.searchParams.set(\"post_logout_redirect_uri\", this.uri.redirect);\n url.searchParams.set(\"id_token_hint\", this.token.id_token);\n window.location = url;\n }\n\n bearerToken() {\n return `Bearer ${this.token.access_token}`;\n }\n \n interceptor(gracePeriodBefore, gracePeriodAfter){\n return new AuthorizationCodeFlowInterceptor(this, gracePeriodBefore, gracePeriodAfter); \n }\n}\n\nclass AuthorizationCodeFlowInterceptor {\n constructor(session, gracePeriodBefore, gracePeriodAfter) {\n this.session = session;\n this.gracePeriodBefore = gracePeriodBefore || 2000;\n this.gracePeriodAfter = gracePeriodAfter || 30000;\n }\n async intercept(request, chain) {\n await this.session.refreshIf(this.gracePeriodBefore);\n const headers = new Headers(request.options.headers);\n headers.set(\"Authorization\", this.session.bearerToken());\n request.options.headers = headers;\n const response = await chain.proceed(request);\n await this.session.refreshIf(this.gracePeriodAfter);\n return response;\n }\n}\n\n\nexport {AuthorizationCodeFlow, AuthorizationCodeFlowSession, AuthorizationCodeFlowInterceptor };","\nconst timing = {\n sleep(ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n },\n DEBOUNCE_DEFAULT: 0,\n DEBOUNCE_IMMEDIATE: 1,\n debounce(timeoutMs, func, options) {\n let tid = null;\n let args = [];\n let previousTimestamp = 0;\n let opts = options || timing.DEBOUNCE_DEFAULT;\n\n const later = () => {\n const elapsed = new Date().getTime() - previousTimestamp;\n if (timeoutMs > elapsed) {\n tid = setTimeout(later, timeoutMs - elapsed);\n return;\n }\n tid = null;\n if (opts !== timing.DEBOUNCE_IMMEDIATE) {\n func(...args);\n }\n // This check is needed because `func` can recursively invoke `debounced`.\n if (tid === null) {\n args = [];\n }\n };\n\n return function () {\n args = arguments;\n previousTimestamp = new Date().getTime();\n if (tid === null) {\n tid = setTimeout(later, timeoutMs);\n if (opts === timing.DEBOUNCE_IMMEDIATE) {\n func(...args);\n }\n }\n };\n },\n THROTTLE_DEFAULT: 0,\n THROTTLE_NO_LEADING: 1,\n THROTTLE_NO_TRAILING: 2,\n throttle(timeoutMs, func, options) {\n let tid = null;\n let args = [];\n let previousTimestamp = 0;\n let opts = options || timing.THROTTLE_DEFAULT;\n\n const later = () => {\n previousTimestamp = (opts & timing.THROTTLE_NO_LEADING) ? 0 : new Date().getTime();\n tid = null;\n func(...args);\n if (tid === null) {\n args = [];\n }\n };\n\n return function () {\n const now = new Date().getTime();\n if (!previousTimestamp && (opts & timing.THROTTLE_NO_LEADING)) {\n previousTimestamp = now;\n }\n const remaining = timeoutMs - (now - previousTimestamp);\n args = arguments;\n if (remaining <= 0 || remaining > timeoutMs) {\n if (tid !== null) {\n clearTimeout(tid);\n tid = null;\n }\n previousTimestamp = now;\n func(...args);\n if (tid === null) {\n args = [];\n }\n } else if (tid === null && !(opts & timing.THROTTLE_NO_TRAILING)) {\n tid = setTimeout(later, remaining);\n }\n };\n\n }\n};\n\n\nexport { timing };","class Fragments {\n static fromHtml(...html) {\n const el = document.createElement('div');\n el.innerHTML = html.join(\"\");\n const fragment = new DocumentFragment();\n Array.from(el.childNodes).forEach(node => {\n fragment.appendChild(node);\n });\n return fragment;\n } \n static toHtml(fragment) {\n var r = document.createElement(\"root\");\n r.appendChild(fragment);\n return r.innerHTML;\n }\n static from(...nodes) {\n const fragment = new DocumentFragment();\n for (let i = 0; i !== nodes.length; ++i) {\n fragment.appendChild(nodes[i]);\n }\n return fragment;\n }\n static fromChildNodes(el) {\n const nodes = Array.from(el.childNodes);\n const fragment = new DocumentFragment();\n for (let i = 0; i !== nodes.length; ++i) {\n fragment.appendChild(nodes[i]);\n }\n return fragment;\n }\n}\n\nclass Attributes {\n static id = 0;\n static uid(prefix) {\n return `${prefix}-${++Attributes.id}`;\n }\n static asBoolean(value) {\n return value !== null && value !== undefined && value !== false;\n }\n static defaultValue(el, k, v) {\n if (!el.hasAttribute(k)) {\n el.setAttribute(k, v);\n }\n return el.getAttribute(k);\n }\n static forward(prefix, from, to) {\n from.getAttributeNames()\n .filter(a => a.startsWith(prefix))\n .forEach(a => {\n const target = a.substring(prefix.length);\n if (target === 'class') {\n to.classList.add(...from.getAttribute(prefix + \"class\").split(\" \").filter(a => a.length));\n return;\n }\n to.setAttribute(target, from.getAttribute(a))\n });\n }\n}\n\nclass Slots {\n static from(el) {\n const namedSlots = Array.from(el.childNodes)\n .filter(el => el.matches && el.matches('[slot]'))\n .map(el => {\n el.remove();\n const slot = el.getAttribute(\"slot\");\n el.removeAttribute(\"slot\");\n return [slot, el];\n });\n const slotted = Object.fromEntries(namedSlots);\n slotted.default = new DocumentFragment();\n slotted.default.append(...el.childNodes);\n return slotted;\n }\n}\n\nconst Templated = (SuperClass, template) => {\n return class extends SuperClass {\n rendered_;\n get rendered() {\n return this.rendered_;\n }\n async connectedCallback() {\n if (this.rendered_) {\n return;\n }\n const slotted = Slots.from(this);\n const fragment = await Promise.resolve(this.render(slotted, template));\n this.innerHTML = '';\n if (fragment) {\n this.appendChild(fragment);\n }\n this.rendered_ = true;\n }\n };\n}\n\nconst Stateful = (SuperClass, flags, others) => {\n\n const all = [].concat(flags).concat(others || []);\n\n return class extends SuperClass {\n static get observedAttributes() {\n return all;\n }\n constructor(...args) {\n super(...args);\n this.internals_ = this.internals_ || this.attachInternals();\n for (const flag of flags) {\n Object.defineProperty(this, flag, {\n get() {\n return this.hasAttribute(flag);\n },\n set(value) {\n //see https://developer.mozilla.org/en-US/docs/Web/API/CustomStateSet#using_double_dash_prefixed_idents\n if (Attributes.asBoolean(value)) {\n this.internals_.states.add(`--${flag}`);\n this.setAttribute(flag, '');\n return;\n }\n this.internals_.states.delete(`--${flag}`);\n this.removeAttribute(flag);\n }\n });\n }\n }\n attributeChangedCallback(name, oldValue, newValue) {\n if (oldValue === newValue) {\n return;\n }\n this[name] = newValue;\n const method = this[`on${name.charAt(0).toUpperCase()}${name.substr(1).toLowerCase()}Changed`];\n method?.call(this, newValue, oldValue);\n }\n };\n}\n\nexport { Fragments, Attributes, Slots, Templated, Stateful };\n","/* global Infinity, CSS */\n\nimport { Failure } from \"../http-client.mjs\";\nimport { Templated } from \"./elements.mjs\"\n\nfunction flatten(obj, prefix) {\n return Object.keys(obj).reduce((acc, k) => {\n const pre = prefix.length ? prefix + '.' : '';\n if (typeof obj[k] === 'object' && obj[k] !== null) {\n Object.assign(acc, flatten(obj[k], pre + k));\n } else {\n acc[pre + k] = obj[k];\n }\n return acc;\n }, {});\n}\n\n\n\nclass Form extends Templated(HTMLElement) {\n static MUTATORS = {};\n static EXTRACTORS = {};\n static VALUE_HOLDERS_SELECTOR = '[name]';\n static IGNORED_CHILDREN_SELECTOR = '.d-none, [hidden]';\n\n render(slotted, template) {\n const form = document.createElement('form');\n form.append(slotted.default);\n form.addEventListener('submit', async (e) => {\n e.preventDefault();\n this.spinner(true);\n try {\n if (this.submitter) {\n await this.submitter(this.getValues(), this);\n }\n } catch (e) {\n if (e instanceof Failure) {\n this.setErrors(e.problems);\n return;\n }\n throw e;\n } finally {\n this.spinner(false)\n }\n })\n return form;\n }\n spinner(spin) {\n this.querySelectorAll('ful-spinner').forEach(el => {\n el.hidden = !spin;\n })\n this.querySelectorAll('[type=submit],[type=reset]').forEach(el => {\n el.disabled = spin;\n })\n }\n setValues(values) {\n for (const [flattenedKey, value] of Object.entries(flatten(values, ''))) {\n Array.from(this.querySelectorAll(`[name='${CSS.escape(flattenedKey)}']`)).forEach((el) => {\n Form.mutate(Form.MUTATORS, el, value, flattenedKey);\n });\n }\n }\n getValues() {\n return Array.from(this.querySelectorAll(Form.VALUE_HOLDERS_SELECTOR))\n .filter((el) => {\n if (el.dataset['fulBindInclude'] === 'never') {\n return false;\n }\n return el.dataset['fulBindInclude'] === 'always' || el.closest(Form.IGNORED_CHILDREN_SELECTOR) === null;\n })\n .reduce((result, el) => {\n return Form.providePath(result, el.getAttribute('name'), Form.extract(Form.EXTRACTORS, el));\n }, {});\n }\n setErrors(errors) {\n this.clearErrors();\n errors\n .filter((e) => e.type === 'FIELD_ERROR' || e.type === 'INVALID_FORMAT')\n .forEach((e) => {\n const name = e.context.replace(\"[\", \".\").replace(\"].\", \".\");\n this.querySelectorAll(`[name='${CSS.escape(name)}'] [ful-validation-target],[name='${CSS.escape(name)}']:not(:has([ful-validation-target]))`)\n .forEach(input => input.classList.add('is-invalid'));\n this.querySelectorAll(`ful-field-error[field='${CSS.escape(name)}']`)\n .forEach(el => el.innerText = e.reason);\n });\n this.querySelectorAll(\"ful-errors\")\n .forEach(el => {\n const globalErrors = errors.filter((e) => e.type !== 'FIELD_ERROR' && e.type !== 'INVALID_FORMAT');\n el.innerHTML = globalErrors.map(e => e.reason).join(\"\\n\");\n if (globalErrors.length !== 0) {\n el.removeAttribute('hidden');\n }\n })\n\n if (!this.hasAttribute('scroll-on-error')) {\n return;\n }\n const ys = Array.from(this.querySelectorAll('ful-field-error'))\n .map(el => el.getBoundingClientRect().y + window.scrollY)\n const miny = Math.min(...ys);\n if (miny !== Infinity) {\n window.scroll(window.scrollX, miny > 100 ? miny - 100 : 0);\n }\n }\n clearErrors() {\n this.querySelectorAll('.is-invalid')\n .forEach(el => el.classList.remove('is-invalid'));\n this.querySelectorAll(\"ful-errors\")\n .forEach(el => {\n el.innerHTML = '';\n el.setAttribute('hidden', '');\n });\n }\n static extract(extractors, el) {\n const maybeExtractor = extractors[el.dataset['fulBindExtractor']] || extractors[el.dataset['fulBindProvide']];\n if (maybeExtractor) {\n return maybeExtractor(el);\n }\n if (el.getAttribute('type') === 'radio') {\n if (!el.checked) {\n return undefined;\n }\n return el.dataset['fulBindType'] === 'boolean' ? el.value === 'true' : el.value;\n }\n if (el.getAttribute('type') === 'checkbox') {\n return el.checked;\n }\n if (el.dataset['fulBindType'] === 'boolean') {\n return !el.value ? null : el.value === 'true';\n }\n return el.value || null;\n }\n static mutate(mutators, el, raw, flattenedKey) {\n const maybeMutator = mutators[el.dataset['fulBindMutator']] || mutators[el.dataset['fulBindProvide']];\n if (maybeMutator) {\n maybeMutator(el, raw, flattenedKey);\n return;\n }\n if (el.getAttribute('type') === 'radio') {\n el.checked = el.getAttribute('value') === raw;\n return;\n }\n if (el.getAttribute('type') === 'checkbox') {\n el.checked = raw;\n return;\n }\n el.value = raw;\n }\n\n static providePath(result, path, value) {\n const keys = path.split(\".\").map((k) => k.match(/^[0-9]+$/) ? +k : k);\n let current = result;\n let previous = null;\n for (let i = 0; ; ++i) {\n const ckey = keys[i];\n const pkey = keys[i - 1];\n if (Number.isInteger(ckey) && !Array.isArray(current)) {\n if (previous !== null) {\n previous[pkey] = current = [];\n } else {\n result = current = [];\n }\n }\n if (i === keys.length - 1) {\n //when value is undefined we only want to define the property if it's not defined \n current[ckey] = value !== undefined ? value : (ckey in current ? current[ckey] : null);\n return result;\n }\n if (current[ckey] === undefined) {\n current[ckey] = {};\n }\n previous = current;\n current = current[ckey];\n }\n }\n static custom(tagName, configuration) {\n customElements.define(tagName, class extends Form {\n constructor() {\n super(configuration);\n }\n });\n }\n}\n\nexport { Form };\n","import { Attributes, Templated } from \"./elements.mjs\"\n\nconst ful_input_ec = globalThis.ec || ftl.EvaluationContext.configure({\n\n});\n\nconst ful_input_template_ = globalThis.ful_input_template || ftl.Template.fromHtml(`\n <label data-tpl-for=\"id\" class=\"form-label\">{{{{ slotted.default }}}}</label>\n <div class=\"input-group\">\n <span data-tpl-if=\"slotted.ibefore\" class=\"input-group-text\">{{{{ slotted.ibefore }}}}</span>\n <div data-tpl-if=\"slotted.before\" data-tpl-remove=\"tag\">{{{{ slotted.before }}}}</div>\n {{{{ slotted.input }}}} \n <div data-tpl-if=\"slotted.after\" data-tpl-remove=\"tag\">{{{{ slotted.after }}}}</div>\n <span data-tpl-if=\"slotted.iafter\" class=\"input-group-text\">{{{{ slotted.iafter }}}}</span>\n </div>\n <ful-field-error data-tpl-if=\"name\" data-tpl-field=\"name\"></ful-field-error>\n`, ful_input_ec);\n\nclass Input extends Templated(HTMLElement, ful_input_template_) {\n render(slotted, template) {\n const input = this.input = slotted.input = slotted.input || (() => {\n const el = document.createElement(\"input\")\n el.classList.add(\"form-control\");\n return el;\n })();\n input.setAttribute('ful-validation-target', '');\n \n const id = input.getAttribute('id') || this.getAttribute('input-id') || Attributes.uid('ful-input');\n Attributes.forward('input-', this, slotted.input)\n Attributes.defaultValue(slotted.input, \"id\", id);\n Attributes.defaultValue(slotted.input, \"type\", \"text\");\n Attributes.defaultValue(slotted.input, \"placeholder\", \" \");\n const name = this.getAttribute('name');\n return template.render({ id, name, slotted });\n }\n get value(){\n return this.input.value;\n }\n set value(value){\n this.input.value = value;\n }\n static configure() {\n customElements.define('ful-input', Input);\n }\n}\n\nexport { Input };\n","import { Fragments, Attributes, Templated } from \"./elements.mjs\"\n/**\n * <script src=\"tom-select.complete.js\"></script>\n * <link href=\"tom-select.bootstrap5.css\" rel=\"stylesheet\" />\n */\nconst ful_select_ec = globalThis.ec || ftl.EvaluationContext.configure({\n\n});\n\nconst ful_select_template_ = globalThis.ful_select_template || ftl.Template.fromHtml(`\n <label data-tpl-for=\"tsId\" class=\"form-label\">{{{{ slotted.default }}}}</label>\n {{{{ input }}}}\n <div class=\"input-group\">\n <span data-tpl-if=\"slotted.ibefore\" class=\"input-group-text\">{{{{ slotted.ibefore }}}}</span>\n <div data-tpl-if=\"slotted.before\" data-tpl-remove=\"tag\">{{{{ slotted.before }}}}</div>\n {{{{ slotted.input }}}} \n <div data-tpl-if=\"slotted.after\" data-tpl-remove=\"tag\">{{{{ slotted.after }}}}</div>\n <span data-tpl-if=\"slotted.iafter\" class=\"input-group-text\">{{{{ slotted.iafter }}}}</span>\n </div>\n <ful-field-error data-tpl-if=\"name\" data-tpl-field=\"name\"></ful-field-error> \n`, ful_select_ec);\n\n\nclass Select extends Templated(HTMLElement, ful_select_template_) {\n constructor(tsConfig) {\n super();\n this.tsConfig = tsConfig;\n }\n render(slotted, template) {\n const type = this.getAttribute(\"type\") || 'local';\n const remote = type != 'local';\n const loadOnce = this.getAttribute('load') != 'always';\n const name = this.getAttribute('name');\n const input = slotted.input = slotted.input || (() => {\n return document.createElement(\"select\");\n })();\n input.setAttribute('ful-validation-target', '');\n\n const id = input.getAttribute('id') || this.getAttribute('input-id') || Attributes.uid('ful-select');\n const tsId = `${id}-ts-control`;\n Attributes.forward('input-', this, input)\n Attributes.defaultValue(input, \"id\", id);\n Attributes.defaultValue(input, \"placeholder\", \" \");\n\n //tomselect needs the input to have a parent.\n //se we move the input to a fragment\n slotted.input = Fragments.from(input);\n\n this.loaded = !remote;\n\n const tsDefaultConfig = {\n render: {\n loading: () => '<ful-spinner class=\"centered p-2\"></ful-spinner>'\n }\n }\n\n\n this._remote = remote;\n // we need to await this load in setValue when remote is configured and the option\n // is not loaded yet.\n // tomselect settings.load does not retun a promise as it wraps the configured load function\n // with a debouncer\n this._unwrappedRemoteLoad = async (query, callback) => {\n\n if (!remote || remote && loadOnce && this.loaded) {\n callback();\n return;\n }\n const type = query && query.hasOwnProperty('byId') ? 'id' : 'query';\n const qvalue = type === 'id' ? query.byId : query;\n const data = await (this.loader ? this.loader(qvalue, type) : []);\n if(type !== 'id'){\n this.loaded = true;\n }\n callback(data);\n };\n\n\n this.ts = new TomSelect(input, Object.assign(remote ? {\n preload: 'focus',\n load: this._unwrappedRemoteLoad,\n shouldLoad: (query) => this.shouldLoad ? this.shouldLoad(query) : true\n } : {}, tsDefaultConfig, this.tsConfig));\n //we remove the input to move it\n input.remove();\n return template.render({ id, tsId, name, input, slotted });\n }\n set value(v) {\n (async () => {\n if(this._remote){\n await this._unwrappedRemoteLoad({byId: v}, this.ts.loadCallback.bind(this.ts));\n }\n this.ts.setValue(v);\n })();\n }\n get value() {\n const v = this.ts.getValue();\n return v === '' ? null : v;\n }\n static custom(tagName, configuration) {\n customElements.define(tagName, class extends Select {\n constructor() {\n super(configuration);\n }\n });\n }\n static configure() {\n return Select.custom('ful-select');\n }\n\n}\n\nexport { Select };\n","import { Attributes, Fragments, Stateful, Templated } from \"./elements.mjs\"\n\n\n\n\n\nconst ful_radiogroup_ec = globalThis.ec || ftl.EvaluationContext.configure({\n\n});\n\nconst ful_radiougroup_template_ = globalThis.ful_radiogroup_template || ftl.Template.fromHtml(`\n <fieldset>\n <legend class=\"form-label\">\n {{{{ slotted.default }}}}\n </legend>\n <header data-tpl-if=\"slotted.header\">\n {{{{ slotted.header }}}}\n </header>\n <section>\n <label data-tpl-each=\"inputsAndLabels\" data-tpl-var=\"ial\">\n {{{{ ial[0] }}}}\n {{{{ ial[1] }}}}\n </label>\n </section>\n <ful-field-error data-tpl-if=\"name\" data-tpl-field=\"name\"></ful-field-error>\n </fieldset>\n`, ful_radiogroup_ec);\n\n\nclass RadioGroup extends Stateful(Templated(HTMLElement, ful_radiougroup_template_), ['disabled']) {\n render(slotted, template) { \n const name = this.getAttribute('name') || Attributes.uid('ful-radiogroup');\n const radioEls = Array.from(slotted.default.querySelectorAll('ful-radio'));\n const inputsAndLabels = radioEls.map(el => {\n const input = document.createElement('input');\n input.setAttribute('type', 'radio');\n Attributes.forward('input-', this, input);\n Attributes.forward('', el, input);\n input.setAttribute('name', `${name}-ignore`);\n input.setAttribute('ful-validation-target', '');\n input.dataset['fulBindInclude'] = 'never';\n const label = Fragments.fromChildNodes(el);\n return [input, label];\n });\n radioEls.forEach(el => el.remove());\n \n const fragment = template.render({\n name: name,\n slotted: slotted,\n inputsAndLabels: inputsAndLabels\n });\n return fragment;\n }\n get value() {\n const checked = this.querySelector('input[type=radio]:checked');\n return checked ? checked.value : null;\n }\n set value(value){\n this.querySelector(`input[type=radio][value=${CSS.escape(value)}]`).checked = true;\n }\n static configure() {\n customElements.define('ful-radio-group', RadioGroup);\n } \n}\n\n\nexport { RadioGroup };","import { Attributes, Fragments, Templated } from \"./elements.mjs\"\n\n\n\nconst ful_spinner_ec = globalThis.ec || ftl.EvaluationContext.configure({\n\n});\n\nconst ful_spinner_template_ = globalThis.ful_spinner_template || ftl.Template.fromHtml(`\n <div class=\"ful-spinner-wrapper\">\n <div class=\"ful-spinner-text\">{{{{ slotted.default }}}}</div>\n <div class=\"ful-spinner-icon\"></div>\n </div>\n`, ful_spinner_ec);\n\n\nclass Spinner extends Templated(HTMLElement, ful_spinner_template_) {\n render(slotted, template) {\n return template.render({ slotted });\n }\n static configure() {\n customElements.define('ful-spinner', Spinner);\n }\n}\n\nexport { Spinner };","class Wizard extends HTMLElement {\n constructor() {\n super();\n this.progress = [...this.children].filter(e => e.matches(\"header,ol,ul\"));\n\n this.progress.forEach(p => {\n const children = [...p.children];\n const current = children.filter(e => e.matches(\".active\"))[0];\n if (current === undefined && children.length > 0) {\n children[0].classList.add('active');\n }\n });\n if (this.querySelector('section.current') === null) {\n const firstSection = this.querySelector('section:first-of-type');\n if (firstSection !== null) {\n firstSection.classList.add('current');\n }\n }\n }\n next() {\n this.progress.forEach(p => {\n const children = [...p.children];\n const current = children.filter(e => e.matches(\".active\"))[0];\n current?.classList.remove('active');\n current?.nextElementSibling?.classList.add('active');\n });\n const currentSection = this.querySelector('section.current');\n currentSection.classList.remove(\"current\");\n currentSection.nextElementSibling.classList.add('current');\n\n this.dispatchEvent(new CustomEvent('wizard:activate', {\n bubbles: true,\n cancelable: true\n }));\n\n }\n prev() {\n this.progress.forEach(p => {\n const children = [...p.children];\n const current = children.filter(e => e.matches(\".active\"))[0];\n current?.classList.remove('active');\n current?.previousElementSibling?.classList.add('active');\n });\n const currentSection = this.querySelector('section.current');\n currentSection.classList.remove(\"current\");\n currentSection.previousElementSibling.classList.add('current');\n this.dispatchEvent(new CustomEvent('wizard:activate', {\n bubbles: true,\n cancelable: true\n }));\n }\n moveTo = function (n) {\n this.progress.forEach(p => {\n const children = [...p.children];\n const current = children.filter(e => e.matches(\".active\"))[0];\n current?.classList.remove('active');\n p.children[+n]?.classList.add('active');\n });\n const currentSection = this.querySelector('section.current');\n currentSection?.classList.remove(\"current\");\n const nthSection = this.querySelector(`section:nth-child(${+n})`);\n nthSection.classList.add('current');\n this.dispatchEvent(new CustomEvent('wizard:activate', {\n bubbles: true,\n cancelable: true\n }));\n }\n static custom(tagName, configuration) {\n customElements.define(tagName, class extends Wizard {\n constructor() {\n super(configuration);\n }\n });\n }\n static configure() {\n return Wizard.custom('ful-wizard');\n }\n}\n\n\n\n\nexport { Wizard };\n"],"names":["Base64","encode","arrayBuffer","dialect","d","URL_SAFE","len","byteLength","view","Uint8Array","res","i","substring","length","decode","str","nbytes","Math","floor","vi","si","v1","indexOf","charAt","v2","v3","v4","buffer","STANDARD","Hex","hex","Error","lenInBytes","map","e","offset","octet","parseInt","bytes","upper","Array","from","b","toString","toUpperCase","o","padStart","join","ContextInterceptor","constructor","context","document","querySelector","getAttribute","this","endsWith","intercept","request","chain","separator","resource","startsWith","proceed","CsrfTokenInterceptor","k","v","headers","Headers","options","set","RedirectOnUnauthorizedInterceptor","redirectUri","response","status","window","location","href","Failure","parseProblems","text","def","type","reason","details","JSON","parse","fromResponse","problems","super","stringify","name","HttpClientBuilder","interceptors","withContext","push","withCsrfToken","withRedirectOnUnauthorized","withInterceptors","build","HttpClient","HttpCall","fetch","HttpInterceptorChain","current","interceptor","builder","exchange","opts","ok","message","json","undefined","jsonRequest","method","body","jsonPost","jsonPut","jsonPatch","Storage","prefix","storage","save","setItem","load","got","getItem","remove","removeItem","pop","decoded","LocalStorage","localStorage","SessionStorage","sessionStorage","VersionedStorage","key","dataSupplier","cache","revision","saved","value","freshData","data","AuthorizationCodeFlow","forKeycloak","clientId","realmBaseUrl","auth","URL","token","logout","registration","redirect","scope","uri","action","additionalParams","pkceVerifier","crypto","getRandomValues","pkceChallenge","subtle","digest","TextEncoder","state","PKCE_AND_STATE_KEY","verifier","url","searchParams","Object","entries","forEach","kv","applicationInitiatedAction","kcAction","kc_action","_tokenExchange","code","history","replaceState","stateAndVerifier","URLSearchParams","AuthorizationCodeFlowSession","ensureLoggedIn","get","parseToken","rawHeader","rawPayload","signature","split","ut8decoder","TextDecoder","header","payload","t","accessToken","access_token","refreshToken","refresh_token","refreshCallback","onRefresh","callback","refresh","shouldBeRefreshed","gracePeriod","now","Date","getTime","refreshTokenExpiresAt","exp","refreshIf","id_token","bearerToken","gracePeriodBefore","gracePeriodAfter","AuthorizationCodeFlowInterceptor","session","timing","sleep","ms","Promise","resolve","setTimeout","DEBOUNCE_DEFAULT","DEBOUNCE_IMMEDIATE","debounce","timeoutMs","func","tid","args","previousTimestamp","later","elapsed","arguments","THROTTLE_DEFAULT","THROTTLE_NO_LEADING","THROTTLE_NO_TRAILING","throttle","remaining","clearTimeout","Fragments","fromHtml","html","el","createElement","innerHTML","fragment","DocumentFragment","childNodes","node","appendChild","toHtml","r","nodes","fromChildNodes","Attributes","static","uid","id","asBoolean","defaultValue","hasAttribute","setAttribute","forward","to","getAttributeNames","filter","a","target","classList","add","Slots","namedSlots","matches","slot","removeAttribute","slotted","fromEntries","default","append","Templated","SuperClass","template","rendered_","rendered","connectedCallback","render","Stateful","flags","others","all","concat","observedAttributes","internals_","attachInternals","flag","defineProperty","states","delete","attributeChangedCallback","oldValue","newValue","substr","toLowerCase","call","flatten","obj","keys","reduce","acc","pre","assign","Form","HTMLElement","form","addEventListener","async","preventDefault","spinner","submitter","getValues","setErrors","spin","querySelectorAll","hidden","disabled","setValues","values","flattenedKey","CSS","escape","mutate","MUTATORS","VALUE_HOLDERS_SELECTOR","dataset","closest","IGNORED_CHILDREN_SELECTOR","result","providePath","extract","EXTRACTORS","errors","clearErrors","replace","input","innerText","globalErrors","ys","getBoundingClientRect","y","scrollY","miny","min","Infinity","scroll","scrollX","extractors","maybeExtractor","checked","mutators","raw","maybeMutator","path","match","previous","ckey","pkey","Number","isInteger","isArray","custom","tagName","configuration","customElements","define","ful_input_ec","globalThis","ec","ftl","EvaluationContext","configure","ful_input_template_","ful_input_template","Template","Input","ful_select_ec","ful_select_template_","ful_select_template","Select","tsConfig","remote","loadOnce","tsId","loaded","_remote","_unwrappedRemoteLoad","query","hasOwnProperty","qvalue","byId","loader","ts","TomSelect","preload","shouldLoad","loading","loadCallback","bind","setValue","getValue","ful_radiogroup_ec","ful_radiougroup_template_","ful_radiogroup_template","RadioGroup","radioEls","inputsAndLabels","ful_spinner_ec","ful_spinner_template_","ful_spinner_template","Spinner","Wizard","progress","children","p","firstSection","next","nextElementSibling","currentSection","dispatchEvent","CustomEvent","bubbles","cancelable","prev","previousElementSibling","moveTo","n"],"mappings":"AAEA,MAAMA,EACF,aAAOC,CAAOC,EAAaC,GACvB,MAAMC,EAAID,GAAWH,EAAOK,SACtBC,EAAMJ,EAAYK,WAClBC,EAAO,IAAIC,WAAWP,GAC5B,IAAIQ,EAAM,GACV,IAAK,IAAIC,EAAI,EAAGA,EAAIL,EAAKK,GAAK,EAAG,CAK7BD,GAJWN,EAAEI,EAAKG,IAAM,GACbP,GAAc,EAAVI,EAAKG,KAAW,EAAMH,EAAKG,EAAI,IAAM,GACzCP,GAAkB,GAAdI,EAAKG,EAAI,KAAY,EAAMH,EAAKG,EAAI,IAAM,GAC9CP,EAAgB,GAAdI,EAAKG,EAAI,GAEzB,CAMD,OALIL,EAAM,GAAM,EACZI,EAAMA,EAAIE,UAAU,EAAGF,EAAIG,OAAS,GAC7BP,EAAM,GAAM,IACnBI,EAAMA,EAAIE,UAAU,EAAGF,EAAIG,OAAS,IAEjCH,CACV,CACD,aAAOI,CAAOC,EAAKZ,GACf,MAAMC,EAAID,GAAWH,EAAOK,SAC5B,IAAIW,EAASC,KAAKC,MAAmB,IAAbH,EAAIF,QAC5B,IAAK,IAAIF,EAAI,EAAGA,IAAMI,EAAIF,QACU,MAA5BE,EAAIA,EAAIF,OAASF,EAAI,KADOA,IAI9BK,EAEN,MAAMR,EAAO,IAAIC,WAAW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mB,CAClDC,SAAS,EACTC,YAAY,IAGnB,CACD,IAAAC,GACI1X,KAAK+W,SAAS1P,SAAQ4P,IAClB,MACMhU,EADW,IAAIgU,EAAED,UACE5J,QAAOxO,GAAKA,EAAE+O,QAAQ,aAAY,GAC3D1K,GAASsK,UAAU/I,OAAO,UAC1BvB,GAAS0U,wBAAwBpK,UAAUC,IAAI,SAAS,IAE5D,MAAM6J,EAAiBrX,KAAKF,cAAc,mBAC1CuX,EAAe9J,UAAU/I,OAAO,WAChC6S,EAAeM,uBAAuBpK,UAAUC,IAAI,WACpDxN,KAAKsX,cAAc,IAAIC,YAAY,kBAAmB,CAClDC,SAAS,EACTC,YAAY,IAEnB,CACDG,OAAS,SAAUC,GACf7X,KAAK+W,SAAS1P,SAAQ4P,IAClB,MACMhU,EADW,IAAIgU,EAAED,UACE5J,QAAOxO,GAAKA,EAAE+O,QAAQ,aAAY,GAC3D1K,GAASsK,UAAU/I,OAAO,UAC1ByS,EAAED,UAAUa,IAAItK,UAAUC,IAAI,SAAS,IAE3C,MAAM6J,EAAiBrX,KAAKF,cAAc,mBAC1CuX,GAAgB9J,UAAU/I,OAAO,WACdxE,KAAKF,cAAc,sBAAsB+X,MACjDtK,UAAUC,IAAI,WACzBxN,KAAKsX,cAAc,IAAIC,YAAY,kBAAmB,CAClDC,SAAS,EACTC,YAAY,IAEnB,EACD,aAAO7D,CAAOC,EAASC,GACnBC,eAAeC,OAAOH,EAAS,cAAciD,EACzC,WAAAnX,GACIuC,MAAM4R,EACT,GAER,CACD,gBAAOQ,GACH,OAAOwC,EAAOlD,OAAO,aACxB"}
|
package/dist/ful.mjs
CHANGED
|
@@ -697,6 +697,20 @@ const Stateful = (SuperClass, flags, others) => {
|
|
|
697
697
|
|
|
698
698
|
/* global Infinity, CSS */
|
|
699
699
|
|
|
700
|
+
function flatten(obj, prefix) {
|
|
701
|
+
return Object.keys(obj).reduce((acc, k) => {
|
|
702
|
+
const pre = prefix.length ? prefix + '.' : '';
|
|
703
|
+
if (typeof obj[k] === 'object' && obj[k] !== null) {
|
|
704
|
+
Object.assign(acc, flatten(obj[k], pre + k));
|
|
705
|
+
} else {
|
|
706
|
+
acc[pre + k] = obj[k];
|
|
707
|
+
}
|
|
708
|
+
return acc;
|
|
709
|
+
}, {});
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
|
|
700
714
|
class Form extends Templated(HTMLElement) {
|
|
701
715
|
static MUTATORS = {};
|
|
702
716
|
static EXTRACTORS = {};
|
|
@@ -734,12 +748,9 @@ class Form extends Templated(HTMLElement) {
|
|
|
734
748
|
});
|
|
735
749
|
}
|
|
736
750
|
setValues(values) {
|
|
737
|
-
for (
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
}
|
|
741
|
-
Array.from(this.querySelectorAll(`[name='${CSS.escape(k)}']`)).forEach((el) => {
|
|
742
|
-
Form.mutate(Form.MUTATORS, el, values[k], k, values);
|
|
751
|
+
for (const [flattenedKey, value] of Object.entries(flatten(values, ''))) {
|
|
752
|
+
Array.from(this.querySelectorAll(`[name='${CSS.escape(flattenedKey)}']`)).forEach((el) => {
|
|
753
|
+
Form.mutate(Form.MUTATORS, el, value, flattenedKey);
|
|
743
754
|
});
|
|
744
755
|
}
|
|
745
756
|
}
|
|
@@ -755,15 +766,13 @@ class Form extends Templated(HTMLElement) {
|
|
|
755
766
|
return Form.providePath(result, el.getAttribute('name'), Form.extract(Form.EXTRACTORS, el));
|
|
756
767
|
}, {});
|
|
757
768
|
}
|
|
758
|
-
setErrors(errors
|
|
769
|
+
setErrors(errors) {
|
|
759
770
|
this.clearErrors();
|
|
760
771
|
errors
|
|
761
772
|
.filter((e) => e.type === 'FIELD_ERROR' || e.type === 'INVALID_FORMAT')
|
|
762
773
|
.forEach((e) => {
|
|
763
774
|
const name = e.context.replace("[", ".").replace("].", ".");
|
|
764
|
-
|
|
765
|
-
//
|
|
766
|
-
this.querySelectorAll(`[name='${CSS.escape(name)}']`)
|
|
775
|
+
this.querySelectorAll(`[name='${CSS.escape(name)}'] [ful-validation-target],[name='${CSS.escape(name)}']:not(:has([ful-validation-target]))`)
|
|
767
776
|
.forEach(input => input.classList.add('is-invalid'));
|
|
768
777
|
this.querySelectorAll(`ful-field-error[field='${CSS.escape(name)}']`)
|
|
769
778
|
.forEach(el => el.innerText = e.reason);
|
|
@@ -777,7 +786,7 @@ class Form extends Templated(HTMLElement) {
|
|
|
777
786
|
}
|
|
778
787
|
});
|
|
779
788
|
|
|
780
|
-
if (!scroll) {
|
|
789
|
+
if (!this.hasAttribute('scroll-on-error')) {
|
|
781
790
|
return;
|
|
782
791
|
}
|
|
783
792
|
const ys = Array.from(this.querySelectorAll('ful-field-error'))
|
|
@@ -813,15 +822,12 @@ class Form extends Templated(HTMLElement) {
|
|
|
813
822
|
if (el.dataset['fulBindType'] === 'boolean') {
|
|
814
823
|
return !el.value ? null : el.value === 'true';
|
|
815
824
|
}
|
|
816
|
-
if (el.getValue) {
|
|
817
|
-
return el.getValue();
|
|
818
|
-
}
|
|
819
825
|
return el.value || null;
|
|
820
826
|
}
|
|
821
|
-
static mutate(mutators, el, raw,
|
|
827
|
+
static mutate(mutators, el, raw, flattenedKey) {
|
|
822
828
|
const maybeMutator = mutators[el.dataset['fulBindMutator']] || mutators[el.dataset['fulBindProvide']];
|
|
823
829
|
if (maybeMutator) {
|
|
824
|
-
maybeMutator(el, raw,
|
|
830
|
+
maybeMutator(el, raw, flattenedKey);
|
|
825
831
|
return;
|
|
826
832
|
}
|
|
827
833
|
if (el.getAttribute('type') === 'radio') {
|
|
@@ -832,10 +838,6 @@ class Form extends Templated(HTMLElement) {
|
|
|
832
838
|
el.checked = raw;
|
|
833
839
|
return;
|
|
834
840
|
}
|
|
835
|
-
if (el.setValue) {
|
|
836
|
-
el.setValue(raw);
|
|
837
|
-
return;
|
|
838
|
-
}
|
|
839
841
|
el.value = raw;
|
|
840
842
|
}
|
|
841
843
|
|
|
@@ -892,19 +894,27 @@ const ful_input_template_ = globalThis.ful_input_template || ftl.Template.fromHt
|
|
|
892
894
|
|
|
893
895
|
class Input extends Templated(HTMLElement, ful_input_template_) {
|
|
894
896
|
render(slotted, template) {
|
|
895
|
-
const input = slotted.input = slotted.input || (() => {
|
|
897
|
+
const input = this.input = slotted.input = slotted.input || (() => {
|
|
896
898
|
const el = document.createElement("input");
|
|
897
899
|
el.classList.add("form-control");
|
|
898
900
|
return el;
|
|
899
901
|
})();
|
|
902
|
+
input.setAttribute('ful-validation-target', '');
|
|
903
|
+
|
|
900
904
|
const id = input.getAttribute('id') || this.getAttribute('input-id') || Attributes.uid('ful-input');
|
|
901
905
|
Attributes.forward('input-', this, slotted.input);
|
|
902
906
|
Attributes.defaultValue(slotted.input, "id", id);
|
|
903
907
|
Attributes.defaultValue(slotted.input, "type", "text");
|
|
904
908
|
Attributes.defaultValue(slotted.input, "placeholder", " ");
|
|
905
|
-
const name =
|
|
909
|
+
const name = this.getAttribute('name');
|
|
906
910
|
return template.render({ id, name, slotted });
|
|
907
911
|
}
|
|
912
|
+
get value(){
|
|
913
|
+
return this.input.value;
|
|
914
|
+
}
|
|
915
|
+
set value(value){
|
|
916
|
+
this.input.value = value;
|
|
917
|
+
}
|
|
908
918
|
static configure() {
|
|
909
919
|
customElements.define('ful-input', Input);
|
|
910
920
|
}
|
|
@@ -941,18 +951,17 @@ class Select extends Templated(HTMLElement, ful_select_template_) {
|
|
|
941
951
|
const type = this.getAttribute("type") || 'local';
|
|
942
952
|
const remote = type != 'local';
|
|
943
953
|
const loadOnce = this.getAttribute('load') != 'always';
|
|
944
|
-
|
|
954
|
+
const name = this.getAttribute('name');
|
|
945
955
|
const input = slotted.input = slotted.input || (() => {
|
|
946
956
|
return document.createElement("select");
|
|
947
957
|
})();
|
|
958
|
+
input.setAttribute('ful-validation-target', '');
|
|
959
|
+
|
|
948
960
|
const id = input.getAttribute('id') || this.getAttribute('input-id') || Attributes.uid('ful-select');
|
|
949
961
|
const tsId = `${id}-ts-control`;
|
|
950
962
|
Attributes.forward('input-', this, input);
|
|
951
963
|
Attributes.defaultValue(input, "id", id);
|
|
952
964
|
Attributes.defaultValue(input, "placeholder", " ");
|
|
953
|
-
const name = input.getAttribute('name');
|
|
954
|
-
input.setValue = this.setValue.bind(this);
|
|
955
|
-
input.getValue = this.getValue.bind(this);
|
|
956
965
|
|
|
957
966
|
//tomselect needs the input to have a parent.
|
|
958
967
|
//se we move the input to a fragment
|
|
@@ -993,19 +1002,19 @@ class Select extends Templated(HTMLElement, ful_select_template_) {
|
|
|
993
1002
|
load: this._unwrappedRemoteLoad,
|
|
994
1003
|
shouldLoad: (query) => this.shouldLoad ? this.shouldLoad(query) : true
|
|
995
1004
|
} : {}, tsDefaultConfig, this.tsConfig));
|
|
996
|
-
console.log("ts created");
|
|
997
1005
|
//we remove the input to move it
|
|
998
1006
|
input.remove();
|
|
999
|
-
|
|
1000
1007
|
return template.render({ id, tsId, name, input, slotted });
|
|
1001
1008
|
}
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1009
|
+
set value(v) {
|
|
1010
|
+
(async () => {
|
|
1011
|
+
if(this._remote){
|
|
1012
|
+
await this._unwrappedRemoteLoad({byId: v}, this.ts.loadCallback.bind(this.ts));
|
|
1013
|
+
}
|
|
1014
|
+
this.ts.setValue(v);
|
|
1015
|
+
})();
|
|
1007
1016
|
}
|
|
1008
|
-
|
|
1017
|
+
get value() {
|
|
1009
1018
|
const v = this.ts.getValue();
|
|
1010
1019
|
return v === '' ? null : v;
|
|
1011
1020
|
}
|
|
@@ -1047,14 +1056,16 @@ const ful_radiougroup_template_ = globalThis.ful_radiogroup_template || ftl.Temp
|
|
|
1047
1056
|
|
|
1048
1057
|
class RadioGroup extends Stateful(Templated(HTMLElement, ful_radiougroup_template_), ['disabled']) {
|
|
1049
1058
|
render(slotted, template) {
|
|
1050
|
-
const name = this.getAttribute('
|
|
1059
|
+
const name = this.getAttribute('name') || Attributes.uid('ful-radiogroup');
|
|
1051
1060
|
const radioEls = Array.from(slotted.default.querySelectorAll('ful-radio'));
|
|
1052
1061
|
const inputsAndLabels = radioEls.map(el => {
|
|
1053
1062
|
const input = document.createElement('input');
|
|
1054
1063
|
input.setAttribute('type', 'radio');
|
|
1055
1064
|
Attributes.forward('input-', this, input);
|
|
1056
1065
|
Attributes.forward('', el, input);
|
|
1057
|
-
|
|
1066
|
+
input.setAttribute('name', `${name}-ignore`);
|
|
1067
|
+
input.setAttribute('ful-validation-target', '');
|
|
1068
|
+
input.dataset['fulBindInclude'] = 'never';
|
|
1058
1069
|
const label = Fragments.fromChildNodes(el);
|
|
1059
1070
|
return [input, label];
|
|
1060
1071
|
});
|
|
@@ -1067,6 +1078,13 @@ class RadioGroup extends Stateful(Templated(HTMLElement, ful_radiougroup_templat
|
|
|
1067
1078
|
});
|
|
1068
1079
|
return fragment;
|
|
1069
1080
|
}
|
|
1081
|
+
get value() {
|
|
1082
|
+
const checked = this.querySelector('input[type=radio]:checked');
|
|
1083
|
+
return checked ? checked.value : null;
|
|
1084
|
+
}
|
|
1085
|
+
set value(value){
|
|
1086
|
+
this.querySelector(`input[type=radio][value=${CSS.escape(value)}]`).checked = true;
|
|
1087
|
+
}
|
|
1070
1088
|
static configure() {
|
|
1071
1089
|
customElements.define('ful-radio-group', RadioGroup);
|
|
1072
1090
|
}
|