@substrate-system/select 0.0.0-stage → 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +168 -0
- package/README.md +312 -2
- package/dist/index.cjs +405 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.css +146 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +376 -0
- package/dist/index.js.map +7 -0
- package/dist/index.min.css +1 -0
- package/dist/index.min.js +2 -0
- package/dist/index.min.js.map +7 -0
- package/dist/meta.json +42 -0
- package/package.json +88 -4
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../node_modules/@substrate-system/web-component/src/attributes.ts", "../node_modules/@substrate-system/web-component/src/util.ts", "../node_modules/@substrate-system/web-component/src/index.ts", "../node_modules/@substrate-system/debug/src/ms.ts", "../node_modules/@substrate-system/debug/src/index.ts", "../node_modules/@substrate-system/debug/src/noop.ts", "../node_modules/@substrate-system/debug/src/browser/util.ts", "../node_modules/@substrate-system/debug/src/browser/index.ts", "../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["export type Attrs = Record<string, undefined|null|string|number|boolean|(string|number)[]>\n\n/**\n * Transform an object into an HTML attributes string. The object should be\n * like `{ attributeName: value }`.\n *\n * @param attrs An object for the attributes.\n * @returns {string} A string suitable for use as HTML attributes.\n */\nexport function toAttributes (attrs:Attrs):string {\n return Object.keys(attrs).reduce((acc, k) => {\n const value = attrs[k]\n if (!value) return acc\n\n if (typeof value === 'boolean') {\n if (value) return (acc + ` ${k}`).trim()\n return acc\n }\n\n if (Array.isArray(value)) {\n return (acc + ` ${k}=\"${value.join(' ')}\"`)\n }\n\n return (acc + ` ${k}=\"${value}\"`).trim()\n }, '')\n}\n", "export { toAttributes } from './attributes.js'\n\n/**\n * Check if the given tag name has been registered.\n *\n * @see {@link https://stackoverflow.com/a/28210364 stackoverflow}\n * @param {string} elName The custom element tag name.\n * @returns {boolean} True if the given name has been registered already.\n */\nexport function isRegistered (elName:string):boolean {\n return document.createElement(elName).constructor !== window.HTMLElement\n}\n\nexport function define (name:string, element:CustomElementConstructor) {\n if (!window) return\n if (!('customElements' in window)) return\n\n if (!isRegistered(name)) {\n window.customElements.define(name, element)\n }\n}\n\nexport const qs = document.querySelector.bind(document)\nexport const qsa = document.querySelectorAll.bind(document)\n\n/**\n * Get the closes parent element matching the given selector.\n * @param el Element to start from\n * @param s Selector for an element\n * @returns {HTMLElement|null} The closes parent element that matches.\n */\nexport function match (el:HTMLElement, s:string):HTMLElement|null {\n if (!el.matches) el = el.parentElement!\n return el.matches(s) ? el : el.closest(s)\n}\n", "import { match as _match } from './util.js'\n\nexport abstract class WebComponent extends window.HTMLElement {\n static TAG:string = ''\n TAG:string = ''\n\n /**\n * Declare boolean attributes that should be reflected as properties.\n * The base class auto-generates getters/setters and includes these in\n * `observedAttributes`. Framework property assignment (e.g. Preact's\n * `el.disabled = true`) will then correctly set the attribute.\n */\n static reflectedBooleanAttributes:string[] = []\n\n /**\n * Declare string attributes that should be reflected as properties.\n * Getter returns `string|null` (null when attribute is absent).\n * Setting `null` or `undefined` removes the attribute.\n */\n static reflectedStringAttributes:string[] = []\n\n /**\n * Auto-derived from `reflectedBooleanAttributes` and\n * `reflectedStringAttributes`. Override with `super.observedAttributes`\n * to add non-reflected observed attributes:\n *\n * ```ts\n * static get observedAttributes () {\n * return [...super.observedAttributes, 'aria-label']\n * }\n * ```\n */\n static get observedAttributes ():string[] {\n return [...new Set([\n ...this.reflectedBooleanAttributes,\n ...this.reflectedStringAttributes,\n ])]\n }\n\n static match (el:HTMLElement):HTMLElement|null {\n return _match(el, this.TAG)\n }\n\n static create (elementName:string):typeof WebComponent & {\n new (...args:any[]):WebComponent;\n TAG:string;\n define: typeof WebComponent.define;\n event: typeof WebComponent.event;\n } {\n const CreatedClass = class extends WebComponent {\n static TAG = elementName\n TAG = elementName\n render () {\n throw new Error('`render` should be implemented by children')\n }\n }\n\n // Copy static methods with proper binding\n CreatedClass.define = function () {\n return WebComponent.define.call(this)\n }\n CreatedClass.event = function (evType:string) {\n return WebComponent.event.call(this, evType)\n }\n\n return CreatedClass\n }\n\n static define<T extends {\n new (...args:any[]):WebComponent;\n TAG:string;\n }>(this:T) {\n define(this.TAG, this)\n }\n\n /**\n * Runs when the value of an attribute is changed.\n *\n * Depends on `static observedAttributes`.\n *\n * Should name methods like `handleChange_disabled`.\n *\n * @param {string} name The attribute name\n * @param {string} oldValue The old attribute value\n * @param {string} newValue The new attribute value\n */\n attributeChangedCallback (\n name:string,\n oldValue:string,\n newValue:string\n ):void {\n const handler = this[handlerKey(name)]\n if (handler) {\n handler.call(this, oldValue, newValue)\n }\n }\n\n connectedCallback () {\n this.render()\n }\n\n abstract render ():any\n\n qs<K extends keyof HTMLElementTagNameMap>(\n selector:K\n ):HTMLElementTagNameMap[K]|null;\n\n qs<E extends Element = Element>(selector:string):E|null;\n qs (selector:string):Element|null {\n return this.querySelector(selector)\n }\n\n qsa<K extends keyof HTMLElementTagNameMap>(\n selector:K\n ):HTMLElementTagNameMap[K]|null;\n\n qsa<E extends Element = Element>(selector:string):E|null;\n qsa (selector:string):NodeListOf<Element> {\n return this.querySelectorAll(selector)\n }\n\n /**\n * Take a non-namepsaced event name, return namespace event name.\n *\n * @param {string} evType The non-namespace event name\n * @returns {string} Namespaced event name, eg, `my-component:click`\n */\n static event (evType:string):string {\n return eventName(this.TAG, evType)\n }\n\n /**\n * Emit a namespaced event.\n *\n * @param type (non-namespaced) event type string\n * @param opts `bubbles`, `detail`, and `cancelable`. Default is\n * `{ bubbles: true, cancelable: true }`\n * @returns {boolean}\n */\n emit<T = any> (type:string, opts:Partial<{\n bubbles:boolean,\n cancelable:boolean,\n detail:CustomEvent<T>['detail']\n }> = {}):boolean {\n if (type === '*') throw new Error('Do not emit the literal \"*\"')\n\n const { bubbles = true, cancelable = true, detail } = opts\n const namespacedType = `${this.TAG}:${type}`\n\n const event = new CustomEvent(namespacedType, {\n bubbles,\n cancelable,\n detail\n })\n\n return this.dispatchEvent(event)\n }\n\n /**\n * Create and emit an event, no namespacing.\n */\n dispatch<T> (type:string, opts:Partial<{\n bubbles:boolean,\n cancelable:boolean,\n detail:CustomEvent<T>['detail']\n }> = {}):boolean {\n const event = new CustomEvent(type, {\n bubbles: (opts.bubbles === undefined) ? true : opts.bubbles,\n cancelable: (opts.cancelable === undefined) ? true : opts.cancelable,\n detail: opts.detail\n })\n\n return this.dispatchEvent(event)\n }\n\n /**\n * Listen for namespaced events.\n */\n on<T extends Event = Event> (\n evName:string,\n handler:(ev:T)=>any,\n options?:boolean|AddEventListenerOptions\n ):void;\n\n on (\n evName:string,\n handler:EventListenerObject,\n options?:boolean|AddEventListenerOptions\n ):void;\n\n on (\n evName:string,\n handler:((ev:Event)=>any)|EventListenerObject,\n options?:boolean|AddEventListenerOptions\n ):void {\n const fullEvName = WebComponent.event.call(this, evName)\n this.addEventListener(fullEvName, handler as EventListenerOrEventListenerObject, options)\n }\n\n /**\n * Remove a namespaced event listener.\n */\n off<T extends Event = Event> (\n evName:string,\n handler:(ev:T)=>any,\n options?:boolean|EventListenerOptions\n ):void;\n\n off (\n evName:string,\n handler:EventListenerObject,\n options?:boolean|EventListenerOptions\n ):void;\n\n off (\n evName:string,\n handler:((ev:Event)=>any)|EventListenerObject,\n options?:boolean|EventListenerOptions\n ):void {\n const fullEvName = WebComponent.event.call(this, evName)\n this.removeEventListener(fullEvName, handler as EventListenerOrEventListenerObject, options)\n }\n}\n\nfunction eventName (namespace:string, evType:string) {\n return `${namespace}:${evType}`\n}\n\n/**\n * Cache of attribute name -> handler method name (`handleChange_<attr>`).\n * Building the lookup string once per attribute avoids re-allocating it on\n * every `attributeChangedCallback`.\n */\nconst handlerKeys:Record<string, string> = Object.create(null)\nfunction handlerKey (name:string):string {\n return handlerKeys[name] || (handlerKeys[name] = `handleChange_${name}`)\n}\n\n/**\n * Check if the given tag name has been registered.\n *\n * @see {@link https://stackoverflow.com/a/28210364 stackoverflow}\n * @param {string} elName The custom element tag name.\n * @returns {boolean} True if the given name has been registered already.\n */\nexport function isRegistered (elName:string):boolean {\n return document.createElement(elName).constructor !== window.HTMLElement\n}\n\nexport function define (name:string, element:CustomElementConstructor) {\n if (typeof window === 'undefined') return\n if (!('customElements' in window)) return\n if (isRegistered(name)) return\n\n const ctor = element as unknown as typeof WebComponent\n const boolAttrs:string[] = ctor.reflectedBooleanAttributes ?? []\n const strAttrs:string[] = ctor.reflectedStringAttributes ?? []\n const proto = (element as any).prototype\n\n for (const attr of boolAttrs) {\n // Skip built-in IDL attributes on HTMLElement and ancestors\n // (covers Element.prototype, Node.prototype, etc.)\n if (attr in HTMLElement.prototype) continue\n // Skip if the subclass already defines an own-property accessor\n if (Object.getOwnPropertyDescriptor(proto, attr)) continue\n Object.defineProperty(proto, attr, {\n get (this:HTMLElement):boolean {\n return this.hasAttribute(attr)\n },\n set (this:HTMLElement, v:unknown) {\n this.toggleAttribute(attr, Boolean(v))\n },\n configurable: true,\n enumerable: true,\n })\n }\n\n for (const attr of strAttrs) {\n if (boolAttrs.includes(attr)) {\n console.warn(\n `[web-component] \"${attr}\" appears in both ` +\n 'reflectedBooleanAttributes and reflectedStringAttributes ' +\n `on <${name}>. Boolean wins.`\n )\n continue\n }\n if (attr in HTMLElement.prototype) continue\n if (Object.getOwnPropertyDescriptor(proto, attr)) continue\n Object.defineProperty(proto, attr, {\n get (this:HTMLElement):string|null {\n return this.getAttribute(attr)\n },\n set (this:HTMLElement, v:unknown) {\n // null and undefined both remove the attribute\n if (v == null) {\n this.removeAttribute(attr)\n } else {\n this.setAttribute(attr, String(v))\n }\n },\n configurable: true,\n enumerable: true,\n })\n }\n\n window.customElements.define(name, element)\n}\n", "/**\n * Helpers.\n */\n\nconst s = 1000\nconst m = s * 60\nconst h = m * 60\nconst d = h * 24\nconst w = d * 7\nconst y = d * 365.25\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nexport default function (val, options:{ long?:boolean } = {}) {\n options = options || {}\n const type = typeof val\n if (type === 'string' && val.length > 0) {\n return parse(val)\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val)\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n )\n}\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse (str) {\n str = String(str)\n if (str.length > 100) {\n return\n }\n const match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n )\n if (!match) {\n return\n }\n const n = parseFloat(match[1])\n const type = (match[2] || 'ms').toLowerCase()\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y\n case 'weeks':\n case 'week':\n case 'w':\n return n * w\n case 'days':\n case 'day':\n case 'd':\n return n * d\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n\n default:\n return undefined\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort (ms) {\n const msAbs = Math.abs(ms)\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd'\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h'\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm'\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's'\n }\n return ms + 'ms'\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong (ms) {\n const msAbs = Math.abs(ms)\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day')\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour')\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute')\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second')\n }\n return ms + ' ms'\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural (ms, msAbs, n, name) {\n const isPlural = msAbs >= n * 1.5\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '')\n}\n", "/**\n* Coerce `val`.\n*\n* @param {unknown} val\n* @return {string}\n*/\nexport function coerce (val:unknown):string {\n if (val instanceof Error) {\n return val.stack || val.message\n }\n\n return String(val)\n}\n\n/**\n * Selects a color for a debug namespace. Same namespace always returns\n * the same color; distinct namespaces may collide.\n * @param {string} namespace The namespace string for the debug instance to be colored\n * @return {number|string} An ANSI color code for the given namespace\n */\nexport function selectColor (\n namespace:string,\n colors:string[]|number[]\n):number|string {\n let hash = 0\n\n for (let i = 0; i < namespace.length; i++) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i)\n hash |= 0 // Convert to 32bit integer\n }\n\n return colors[Math.abs(hash) % colors.length]\n}\n\nexport function createRegexFromEnvVar (names:string):RegExp[] {\n const split = names.split(/[\\s,]+/).filter(Boolean)\n const regexs = split\n .map(word => word.replace(/\\*/g, '.*?'))\n .map(r => new RegExp('^' + r + '$'))\n\n return regexs\n}\n\nexport type Debugger = {\n (...args:any[]):void;\n extend:(namespace:string) => Debugger;\n error:(...args:any[]) => void;\n}\n\n/**\n * Use this to create a random namespace in the case that `debug`\n * is called without any arguments.\n * @param {number} length Lenght of the random string\n * @returns {string}\n */\nexport function generateRandomString (length = 6):string {\n return Math.random().toString(20).substring(2, length)\n}\n", "import { type Debugger } from './index.js'\n\nexport const noop:Debugger = function (_args:any[]) {}\nnoop.extend = function (_namespace:string) { return noop }\nnoop.error = function (..._args:any[]) {}\n\n/**\n * Factory function that matches the main module's API.\n * Always returns the noop debugger regardless of namespace.\n */\nexport function createDebug (_namespace?:string|boolean):Debugger {\n return noop\n}\n\nexport default createDebug\n", "/**\n * Maximally distinct colors for debug namespaces.\n * Every pair has high perceptual distance \u2014 no similar hues nearby.\n * All have sufficient contrast for legibility on white backgrounds.\n */\nexport const colors = [\n '#cc0000', // red\n '#004de6', // blue\n '#008a00', // green\n '#9900db', // purple\n '#dd7700', // orange\n '#cc0088', // pink\n '#61a200', // olive\n '#873600', // brown\n '#bc007d', // magenta\n]\n\nexport const ERROR_COLOR = '#940000'\n", "import humanize from '../ms.js'\nimport {\n generateRandomString,\n coerce,\n selectColor,\n createRegexFromEnvVar,\n type Debugger\n} from '../index.js'\nimport { noop } from '../noop.js'\nimport { colors, ERROR_COLOR } from './util.js'\n\nconst log = console.log || (() => {})\n\nexport { Debugger }\nexport { createDebug }\nexport default createDebug\n\n/**\n * Check if the given namespace is enabled.\n * `namespace` is the name that is passed into debug.\n * `forcedEnabled` is a boolean that forces logging when true.\n * Only checks localStorage for the DEBUG key, unless forced.\n */\nfunction isEnabled (namespace:string, forcedEnabled?:boolean):boolean {\n // If explicitly forced to be enabled via boolean true\n if (forcedEnabled === true) return true\n\n const DEBUG = localStorage?.getItem('DEBUG')\n\n // Check for wildcard\n if (DEBUG === '*') return true\n\n // if we were not called with a namespace\n if (namespace === 'DEV') {\n // We want to log iff there is no DEBUG variable.\n if (!DEBUG) {\n return true\n }\n return false\n }\n\n // No DEBUG variable set\n if (!DEBUG) return false\n\n const envVars = createRegexFromEnvVar(DEBUG)\n return envVars.some(regex => regex.test(namespace))\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\nfunction createFormatters () {\n return {\n j: function (v:any) {\n try {\n return JSON.stringify(v)\n } catch (error) {\n return '[UnexpectedJSONParseError]: ' + String(error)\n }\n }\n }\n}\n\nfunction logger (\n namespace:string,\n args:any[],\n { prevTime, color }\n) {\n args = args || []\n\n // Set `diff` timestamp\n const curr = Number(new Date())\n const diff = curr - (prevTime || curr)\n prevTime = curr\n\n args[0] = coerce(args[0])\n const formatters = createFormatters()\n\n if (typeof args[0] !== 'string') {\n // Anything else let's inspect with %O\n args.unshift('%O')\n }\n\n // Apply any `formatters` transformations\n let index = 0\n args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n // If we encounter an escaped %, then don't increase the\n // array index\n if (match === '%%') return '%'\n\n index++\n\n const formatter = formatters[format]\n if (typeof formatter === 'function') {\n const val = args[index]\n match = formatter.call(self, val)\n\n // Now we need to remove `args[index]` since it's inlined\n // in the `format`\n args.splice(index, 1)\n index--\n }\n return match\n })\n\n // Apply env-specific formatting (colors, etc.)\n const _args = formatArgs({\n diff,\n color,\n useColors: shouldUseColors(),\n namespace\n }, args)\n\n log(..._args)\n}\n\nfunction shouldUseColors ():boolean {\n // Internet Explorer and Edge do not support colors.\n if (typeof navigator !== 'undefined' && navigator.userAgent &&\n navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n return false\n }\n\n // Is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native:\n // https://github.com/facebook/react-native/pull/1632\n return !!((typeof document !== 'undefined' && document.documentElement &&\n document.documentElement.style &&\n document.documentElement.style.webkitAppearance) ||\n // Is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' &&\n navigator.userAgent &&\n navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) &&\n parseInt(RegExp.$1, 10) >= 31) ||\n // Double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' &&\n navigator.userAgent &&\n navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/)))\n}\n\n/**\n * Colorize log arguments if enabled.\n */\nfunction formatArgs ({ diff, color, namespace, useColors }:{\n diff:number,\n color:number|string,\n namespace:string,\n useColors:boolean\n}, args) {\n args[0] = (useColors ? '%c' : '') +\n namespace +\n (useColors ? ' %c' : ' ') +\n args[0] +\n (useColors ? '%c ' : ' ') +\n '+' + humanize(diff, {})\n\n if (!useColors) return\n\n const c = 'color: ' + color\n args.splice(1, 0, c, 'color: inherit')\n\n // The final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n let index = 0\n let lastC = 0\n args[0].replace(/%[a-zA-Z%]/g, match => {\n if (match === '%%') {\n return\n }\n index++\n if (match === '%c') {\n // We only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index\n }\n })\n\n args.splice(lastC, 0, c)\n\n return args\n}\n\nfunction createDebug (namespace:string|boolean):Debugger {\n if (namespace === false) return noop\n const prevTime = Number(new Date())\n const color = selectColor(\n typeof namespace === 'string' ? namespace : generateRandomString(10),\n colors\n )\n\n // Determine if this is a boolean true passed as the namespace\n const forcedEnabled = namespace === true\n const actualNamespace = typeof namespace === 'string' ? namespace : 'DEV'\n\n const debug = function (...args:any[]) {\n if (!isEnabled(actualNamespace, forcedEnabled)) return\n return logger(\n actualNamespace,\n args,\n { prevTime, color }\n )\n }\n\n debug.extend = function (extension:string):Debugger {\n const extendedNamespace = actualNamespace + ':' + extension\n return createDebug(extendedNamespace)\n }\n\n debug.error = function (...args:any[]) {\n if (!isEnabled(actualNamespace, forcedEnabled)) return\n return logger(\n 'ERROR',\n args,\n { prevTime, color: ERROR_COLOR }\n )\n }\n\n return debug as Debugger\n}\n", "// pattern: Imperative Shell\nimport { WebComponent } from '@substrate-system/web-component'\nimport Debug from '@substrate-system/debug'\nconst debug = Debug('substrate-select')\n\n// for document.querySelector\ndeclare global {\n interface HTMLElementTagNameMap {\n 'substrate-select':SubstrateSelect\n }\n}\n\n/**\n * ARIA attributes the component observes, so a change after upgrade is\n * moved to the inner select too. `attributeChangedCallback` only sees\n * attributes named in `observedAttributes`. Copied from\n * `@substrate-system/input` (`src/util.ts`). At first render every\n * `aria-*` attribute moves, listed here or not.\n */\nexport const ARIA_ATTRIBUTES = [\n 'aria-activedescendant',\n 'aria-atomic',\n 'aria-autocomplete',\n 'aria-braillelabel',\n 'aria-brailleroledescription',\n 'aria-busy',\n 'aria-checked',\n 'aria-colcount',\n 'aria-colindex',\n 'aria-colindextext',\n 'aria-colspan',\n 'aria-controls',\n 'aria-current',\n 'aria-describedby',\n 'aria-description',\n 'aria-details',\n 'aria-disabled',\n 'aria-dropeffect',\n 'aria-errormessage',\n 'aria-expanded',\n 'aria-flowto',\n 'aria-grabbed',\n 'aria-haspopup',\n 'aria-hidden',\n 'aria-invalid',\n 'aria-keyshortcuts',\n 'aria-label',\n 'aria-labelledby',\n 'aria-level',\n 'aria-live',\n 'aria-modal',\n 'aria-multiline',\n 'aria-multiselectable',\n 'aria-orientation',\n 'aria-owns',\n 'aria-placeholder',\n 'aria-posinset',\n 'aria-pressed',\n 'aria-readonly',\n 'aria-relevant',\n 'aria-required',\n 'aria-roledescription',\n 'aria-rowcount',\n 'aria-rowindex',\n 'aria-rowindextext',\n 'aria-rowspan',\n 'aria-selected',\n 'aria-setsize',\n 'aria-sort',\n 'aria-valuemax',\n 'aria-valuemin',\n 'aria-valuenow',\n 'aria-valuetext'\n]\n\n/**\n * Attributes copied to the inner select and also left on the host.\n */\nconst FORWARDED_ATTRIBUTES = [\n 'name',\n 'disabled',\n 'required',\n 'autocomplete',\n 'form'\n]\n\n/**\n * Properties a framework may set before this module defines the\n * element. See `#upgradeProperty`.\n */\nconst UPGRADED_PROPERTIES = [\n 'value',\n 'label',\n 'name',\n 'disabled',\n 'required'\n]\n\nfunction isOptionNode (\n node:Node\n):node is HTMLOptionElement|HTMLOptGroupElement {\n return (\n node instanceof HTMLOptionElement ||\n node instanceof HTMLOptGroupElement\n )\n}\n\nexport interface SubstrateSelectChangeDetail {\n value:string;\n}\n\n/**\n * Use the `create` factory rather than `class X extends WebComponent`\n * with `static TAG`. The base class declares `TAG` as an *instance*\n * field defaulting to `''`, and `emit`/`on` namespace from that instance\n * field while `static event()` reads the static one. Setting only\n * `static TAG` therefore emits `':change'` while listeners built from\n * `SubstrateSelect.event('change')` expect `'substrate-select:change'`,\n * and nothing fires. `create` sets both.\n */\nexport class SubstrateSelect extends WebComponent.create('substrate-select') {\n /**\n * The base class generates the accessors for these and derives\n * `observedAttributes` from them.\n *\n * @see docs/adr/ADR-004-attributes-as-state.md\n */\n static reflectedStringAttributes = ['label', 'name']\n static reflectedBooleanAttributes = ['disabled', 'required']\n\n static get observedAttributes ():string[] {\n return [\n ...super.observedAttributes,\n 'id',\n 'autocomplete',\n 'form',\n ...ARIA_ATTRIBUTES\n ]\n }\n\n /**\n * Installed at runtime by `define()`. `declare` types them without\n * emitting a field that would shadow the generated accessor.\n */\n declare label:string|null\n declare name:string|null\n declare disabled:boolean\n declare required:boolean\n\n /**\n * The inner select's value. Before the first render this holds the\n * value and `render` applies it once the options are in.\n */\n get value ():string {\n if (this.#select) return this.#select.value\n return this.#pendingValue ?? ''\n }\n\n set value (value:string) {\n const normalized = String(value ?? '')\n if (this.#select) {\n // Options appended this tick are still in the host, waiting\n // for the observer. Move them now so the value can match.\n this.#adopt(Array.from(this.childNodes))\n // A later set replaces any value still waiting for its option\n this.#pendingValue = null\n this.#select.value = normalized\n return\n }\n this.#pendingValue = normalized\n }\n\n /**\n * The inner select, or `null` before the first render. An escape\n * hatch, for example to remove options.\n */\n get select ():HTMLSelectElement|null {\n return this.#select\n }\n\n #select:HTMLSelectElement|null = null\n #label:HTMLLabelElement|null = null\n #pendingValue:string|null = null\n #observer:MutationObserver|null = null\n #generatedId = 'substrate-select-' +\n Math.random().toString(36).slice(2, 10)\n\n connectedCallback () {\n debug('connected')\n for (const prop of UPGRADED_PROPERTIES) {\n this.#upgradeProperty(prop)\n }\n\n // Not `super.connectedCallback()`: that renders on every\n // connect. `render` is idempotent, so a reconnect keeps the\n // existing select, its options, and the user's selection.\n this.render()\n\n // Options appended while disconnected\n this.#adopt(Array.from(this.childNodes))\n\n this.#observer ??= new MutationObserver(records => {\n this.#handleRecords(records)\n })\n this.#observer.observe(this, { childList: true })\n // Options added through `el.select` may be what a waiting value\n // is waiting for. `subtree` covers options inside an optgroup.\n if (this.#select) {\n this.#observer.observe(this.#select, {\n childList: true,\n subtree: true\n })\n }\n }\n\n disconnectedCallback () {\n debug('disconnected')\n if (!this.#observer) return\n // Deliver additions the observer has queued but not reported\n this.#handleRecords(this.#observer.takeRecords())\n this.#observer.disconnect()\n }\n\n attributeChangedCallback (\n name:string,\n oldValue:string|null,\n newValue:string|null\n ) {\n if (name === 'id' || name.startsWith('aria-')) {\n this.#moveToSelect(name, newValue)\n return\n }\n\n // The base class types these as `string`; the DOM passes `null`\n // for an absent attribute, and the handlers here accept it.\n super.attributeChangedCallback(\n name,\n oldValue as string,\n newValue as string\n )\n }\n\n handleChange_label (_oldValue:string|null, newValue:string|null) {\n const select = this.#select\n if (!select) return // render reads the attribute\n\n if (!newValue) {\n this.#label?.remove()\n this.#label = null\n return\n }\n\n if (!this.#label) {\n this.#label = this.#createLabel(select.id)\n this.insertBefore(this.#label, select)\n }\n\n this.#label.textContent = newValue\n }\n\n handleChange_name (_oldValue:string|null, newValue:string|null) {\n this.#forward('name', newValue)\n }\n\n handleChange_disabled (_oldValue:string|null, newValue:string|null) {\n this.#forward('disabled', newValue)\n }\n\n handleChange_required (_oldValue:string|null, newValue:string|null) {\n this.#forward('required', newValue)\n }\n\n handleChange_autocomplete (\n _oldValue:string|null,\n newValue:string|null\n ) {\n this.#forward('autocomplete', newValue)\n }\n\n handleChange_form (_oldValue:string|null, newValue:string|null) {\n this.#forward('form', newValue)\n }\n\n /**\n * Copy a forwarded attribute to the select. Before the first render\n * there is no select, and `render` copies the host's attributes.\n */\n #forward (name:string, value:string|null) {\n const select = this.#select\n if (!select) return\n\n if (value === null) {\n select.removeAttribute(name)\n } else {\n select.setAttribute(name, value)\n }\n }\n\n /**\n * Move `id` or an `aria-*` attribute from the host to the select.\n *\n * A `null` value is ignored. The host never keeps these attributes\n * after the first render, so a removal callback is always the one\n * this method or `render` just caused. A consumer's removal goes\n * through the `removeAttribute` override instead, because the host\n * no longer has the attribute and no callback would fire.\n *\n * Before the first render there is no select; `render` reads the\n * host attributes itself.\n */\n #moveToSelect (name:string, value:string|null) {\n const select = this.#select\n if (value === null || !select) return\n\n if (name === 'id') {\n this.#setSelectId(value || this.#generatedId)\n } else {\n select.setAttribute(name, value)\n }\n super.removeAttribute(name)\n }\n\n #setSelectId (id:string) {\n if (!this.#select) return\n this.#select.id = id\n if (this.#label) this.#label.htmlFor = id\n }\n\n /**\n * After the first render, `id` and `aria-*` live on the inner select,\n * so removing one from the host removes it from the select. This is\n * how frameworks clear an attribute (Preact calls `removeAttribute`\n * for `undefined`). A removed `id` falls back to the generated one,\n * so the label stays connected.\n *\n * Internal code calls `super.removeAttribute` to strip the host\n * without touching the select. `toggleAttribute(name, false)` and\n * `removeAttributeNode` on the host are not covered.\n */\n removeAttribute (qualifiedName:string) {\n const name = qualifiedName.toLowerCase()\n const select = this.#select\n if (select && name === 'id') {\n this.#setSelectId(this.#generatedId)\n } else if (select && name.startsWith('aria-')) {\n select.removeAttribute(name)\n }\n super.removeAttribute(qualifiedName)\n }\n\n /**\n * Apply a value that was set before the first render. It stays\n * pending until an option with that value exists, so a value set\n * before the options arrive (an empty first render, then appended\n * options) still lands. A later `value` set or a user change clears\n * it.\n */\n #applyPendingValue () {\n const select = this.#select\n const pending = this.#pendingValue\n if (!select || pending === null) return\n // Write only on a match. A write with no match would clear\n // whatever is selected now, including a pick made through\n // `el.select`, with no event.\n const options = Array.from(select.options)\n if (!options.some(option => option.value === pending)) return\n select.value = pending\n this.#pendingValue = null\n }\n\n /**\n * A property set before the element was defined is an own data\n * property that hides the class accessor. Remove it and set it\n * again so the accessor sees it.\n */\n #upgradeProperty (prop:string) {\n if (!Object.prototype.hasOwnProperty.call(this, prop)) return\n const value = Reflect.get(this, prop)\n Reflect.deleteProperty(this, prop)\n Reflect.set(this, prop, value)\n }\n\n /**\n * Move options added to the host into the select, and retry a\n * waiting value when nodes were added inside the select.\n */\n #handleRecords (records:MutationRecord[]) {\n const fromHost = records.filter(record => record.target === this)\n this.#adopt(\n fromHost.flatMap(record => Array.from(record.addedNodes))\n )\n const intoSelect = records.some(record => {\n return record.target !== this && record.addedNodes.length > 0\n })\n if (intoSelect) this.#applyPendingValue()\n }\n\n /**\n * Move `<option>` and `<optgroup>` children of the host to the end of\n * the select. The component's own label and select, and anything\n * that is not an option, stay where they are.\n */\n #adopt (nodes:Node[]) {\n const select = this.#select\n if (!select) return\n let moved = false\n for (const node of nodes) {\n // already moved, or removed again before delivery\n if (node.parentNode !== this) continue\n if (!isOptionNode(node)) continue\n select.append(node)\n moved = true\n }\n // a value set before connect may be waiting for these options\n if (moved) this.#applyPendingValue()\n }\n\n #createLabel (selectId:string):HTMLLabelElement {\n const label = document.createElement('label')\n label.htmlFor = selectId\n return label\n }\n\n render () {\n if (this.#select) return\n\n const authored:(HTMLOptionElement|HTMLOptGroupElement)[] = []\n const stray:Node[] = []\n for (const node of Array.from(this.childNodes)) {\n if (isOptionNode(node)) {\n authored.push(node)\n } else if (\n node.nodeType !== Node.TEXT_NODE ||\n node.textContent?.trim()\n ) {\n stray.push(node)\n }\n }\n if (stray.length) debug('dropping non-option children', stray)\n\n // The option the parser marked selected. Reapplied after the\n // move instead of relying on insertion to keep it.\n const chosen = authored\n .flatMap(node => {\n return node instanceof HTMLOptionElement ?\n [node] :\n Array.from(node.querySelectorAll('option'))\n })\n .filter(option => option.selected)\n .pop()\n\n // DOM APIs only, so attribute values are never parsed as HTML\n const select = document.createElement('select')\n select.id = this.getAttribute('id') ?? this.#generatedId\n for (const attr of Array.from(this.attributes)) {\n if (attr.name.startsWith('aria-')) {\n select.setAttribute(attr.name, attr.value)\n }\n }\n for (const name of FORWARDED_ATTRIBUTES) {\n const value = this.getAttribute(name)\n if (value !== null) select.setAttribute(name, value)\n }\n\n // Native `change` and `input` bubble out of the host as they\n // are. Also emit the namespaced event (ADR-005).\n select.addEventListener('change', () => {\n // the user's pick replaces a value still waiting for its\n // option\n this.#pendingValue = null\n this.emit<SubstrateSelectChangeDetail>('change', {\n detail: { value: select.value }\n })\n })\n\n select.append(...authored)\n if (chosen) chosen.selected = true\n this.#select = select\n this.#applyPendingValue()\n // A value set from code wins over an authored `selected`, as on\n // a native select, so while it waits nothing is selected\n if (this.#pendingValue !== null) select.selectedIndex = -1\n\n const labelText = this.getAttribute('label')\n if (labelText) {\n this.#label = this.#createLabel(select.id)\n this.#label.textContent = labelText\n this.replaceChildren(this.#label, select)\n } else {\n this.replaceChildren(select)\n }\n\n // `super`, not `this`: strip the host only; the select keeps\n // the values. The removal callbacks this causes carry `null`,\n // which `#moveToSelect` ignores.\n super.removeAttribute('id')\n for (const attr of Array.from(this.attributes)) {\n if (attr.name.startsWith('aria-')) {\n super.removeAttribute(attr.name)\n }\n }\n }\n}\n\nSubstrateSelect.define()\n"],
|
|
5
|
+
"mappings": "2KASO,SAASA,EAAcC,EAAoB,CAC9C,OAAO,OAAO,KAAKA,CAAK,EAAE,OAAO,CAACC,EAAKC,IAAM,CACzC,IAAMC,EAAQH,EAAME,CAAC,EACrB,OAAKC,EAED,OAAOA,GAAU,UACbA,GAAeF,EAAM,IAAIC,CAAC,IAAI,KAAK,EAChCD,EAGP,MAAM,QAAQE,CAAK,EACXF,EAAM,IAAIC,CAAC,KAAKC,EAAM,KAAK,GAAG,CAAC,KAGnCF,EAAM,IAAIC,CAAC,KAAKC,CAAK,KAAK,KAAK,EAXpBF,CAYvB,EAAG,EAAE,CACT,CAhBgBG,EAAAL,EAAA,gBAAAK,GAAAL,EAAA,cAAA,2FCAT,SAASM,EAAcC,EAAuB,CACjD,OAAO,SAAS,cAAcA,CAAM,EAAE,cAAgB,OAAO,WACjE,CAFgBC,EAAAF,EAAA,gBAAAE,EAAAF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A,GACA,KAAK/B,GAAS,KAAKa,GAAaD,EAAO,EAAE,EACzC,KAAKZ,GAAO,YAAc+B,EAC1B,KAAK,gBAAgB,KAAK/B,GAAQY,CAAM,GAExC,KAAK,gBAAgBA,CAAM,EAM/B,MAAM,gBAAgB,IAAI,EAC1B,QAAWkB,KAAQ,MAAM,KAAK,KAAK,UAAU,EACrCA,EAAK,KAAK,WAAW,OAAO,GAC5B,MAAM,gBAAgBA,EAAK,IAAI,CAG3C,CACJ,EAEArC,EAAgB,OAAO",
|
|
6
|
+
"names": ["toAttributes", "attrs", "acc", "k", "value", "__name", "isRegistered", "elName", "__name", "define", "name", "element", "qs", "qsa", "match", "el", "s", "WebComponent", "_WebComponent", "__name", "el", "match", "elementName", "CreatedClass", "evType", "define", "name", "oldValue", "newValue", "handler", "handlerKey", "selector", "eventName", "type", "opts", "bubbles", "cancelable", "detail", "namespacedType", "event", "evName", "options", "fullEvName", "namespace", "handlerKeys", "isRegistered", "elName", "element", "ctor", "boolAttrs", "strAttrs", "proto", "attr", "v", "s", "m", "h", "d", "w", "y", "ms_default", "val", "options", "type", "parse", "fmtLong", "fmtShort", "__name", "str", "match", "n", "ms", "msAbs", "plural", "name", "isPlural", "coerce", "val", "__name", "selectColor", "namespace", "colors", "hash", "i", "createRegexFromEnvVar", "names", "word", "r", "generateRandomString", "length", "noop", "__name", "_args", "_namespace", "createDebug", "colors", "ERROR_COLOR", "log", "browser_default", "createDebug", "isEnabled", "namespace", "forcedEnabled", "DEBUG", "createRegexFromEnvVar", "regex", "__name", "createFormatters", "v", "error", "logger", "args", "prevTime", "color", "curr", "diff", "coerce", "formatters", "index", "match", "format", "formatter", "val", "_args", "formatArgs", "shouldUseColors", "useColors", "ms_default", "c", "lastC", "noop", "selectColor", "generateRandomString", "colors", "actualNamespace", "debug", "extension", "extendedNamespace", "ERROR_COLOR", "debug", "browser_default", "ARIA_ATTRIBUTES", "FORWARDED_ATTRIBUTES", "UPGRADED_PROPERTIES", "isOptionNode", "node", "__name", "SubstrateSelect", "WebComponent", "#select", "#pendingValue", "value", "normalized", "#adopt", "#label", "#observer", "#generatedId", "prop", "#upgradeProperty", "records", "#handleRecords", "name", "oldValue", "newValue", "#moveToSelect", "_oldValue", "select", "#createLabel", "#forward", "#setSelectId", "id", "qualifiedName", "#applyPendingValue", "pending", "option", "fromHost", "record", "nodes", "moved", "selectId", "label", "authored", "stray", "chosen", "attr", "labelText"]
|
|
7
|
+
}
|
package/dist/meta.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"inputs": {
|
|
3
|
+
"src/index.ts": {
|
|
4
|
+
"bytes": 16164,
|
|
5
|
+
"imports": [],
|
|
6
|
+
"format": "esm"
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"outputs": {
|
|
10
|
+
"dist/index.js.map": {
|
|
11
|
+
"imports": [],
|
|
12
|
+
"exports": [],
|
|
13
|
+
"inputs": {},
|
|
14
|
+
"bytes": 23045
|
|
15
|
+
},
|
|
16
|
+
"dist/index.js": {
|
|
17
|
+
"imports": [
|
|
18
|
+
{
|
|
19
|
+
"path": "@substrate-system/web-component",
|
|
20
|
+
"kind": "import-statement",
|
|
21
|
+
"external": true
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"path": "@substrate-system/debug",
|
|
25
|
+
"kind": "import-statement",
|
|
26
|
+
"external": true
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"exports": [
|
|
30
|
+
"ARIA_ATTRIBUTES",
|
|
31
|
+
"SubstrateSelect"
|
|
32
|
+
],
|
|
33
|
+
"entryPoint": "src/index.ts",
|
|
34
|
+
"inputs": {
|
|
35
|
+
"src/index.ts": {
|
|
36
|
+
"bytesInOutput": 10954
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"bytes": 11166
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,90 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@substrate-system/select",
|
|
3
|
-
"version": "0.0.0
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Select input with style",
|
|
6
|
+
"files": [
|
|
7
|
+
"./dist/*"
|
|
8
|
+
],
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"require": "./dist/index.cjs"
|
|
13
|
+
},
|
|
14
|
+
"./css": "./dist/index.css",
|
|
15
|
+
"./min/css": "./dist/index.min.css",
|
|
16
|
+
"./min/*": {
|
|
17
|
+
"import": "./dist/*.min.js",
|
|
18
|
+
"require": "./dist/*.min.cjs"
|
|
19
|
+
},
|
|
20
|
+
"./*": {
|
|
21
|
+
"import": "./dist/*.js",
|
|
22
|
+
"require": "./dist/*.cjs"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"main": "dist/index.js",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"scripts": {
|
|
28
|
+
"lint": "eslint \"./**/*.{ts,js}\"",
|
|
29
|
+
"test": "esbuild ./test/index.ts --bundle | tapout",
|
|
30
|
+
"build-css": "lightningcss --nesting src/index.css -o dist/index.css",
|
|
31
|
+
"build-css:min": "lightningcss --nesting --minify src/index.css -o dist/index.min.css",
|
|
32
|
+
"build-cjs": "esbuild src/*.ts --format=cjs --keep-names --tsconfig=tsconfig.build.json --outdir=./dist --out-extension:.js=.cjs --sourcemap",
|
|
33
|
+
"build-esm": "esbuild src/*.ts --format=esm --metafile=dist/meta.json --keep-names --tsconfig=tsconfig.build.json --outdir=./dist --sourcemap && tsc --emitDeclarationOnly --project tsconfig.build.json --outDir dist",
|
|
34
|
+
"build-esm:min": "esbuild ./src/*.ts --format=esm --keep-names --bundle --tsconfig=tsconfig.build.json --minify --out-extension:.js=.min.js --outdir=./dist --sourcemap",
|
|
35
|
+
"build-example": "mkdir -p ./public && rm -rf ./public/* && NODE_ENV=development vite --mode staging --base=\"/select\" build",
|
|
36
|
+
"build": "mkdir -p ./dist && rm -rf ./dist/* && npm run build-cjs && npm run build-esm && npm run build-esm:min && npm run build-css && npm run build-css:min",
|
|
37
|
+
"start": "vite",
|
|
38
|
+
"toc": "markdown-toc --maxdepth 3 -i README.md",
|
|
39
|
+
"preversion": "npm run lint && stylelint src/*.css",
|
|
40
|
+
"version": "npm run toc && auto-changelog -p --template keepachangelog --breaking-pattern 'BREAKING CHANGE:' && git add CHANGELOG.md README.md",
|
|
41
|
+
"postversion": "git push --follow-tags && npm publish",
|
|
42
|
+
"prepublishOnly": "npm run build"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@substrate-system/debug": "^0.9.60",
|
|
46
|
+
"@substrate-system/web-component": "^0.0.56"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@substrate-system/dom": "^0.1.13",
|
|
50
|
+
"@substrate-system/tapout": "^0.0.37",
|
|
51
|
+
"@substrate-system/tapzero": "^0.10.16",
|
|
52
|
+
"@typescript-eslint/eslint-plugin": "^8.7.0",
|
|
53
|
+
"@typescript-eslint/parser": "^8.7.0",
|
|
54
|
+
"auto-changelog": "^2.4.0",
|
|
55
|
+
"browserslist": "^4.28.1",
|
|
56
|
+
"esbuild": "^0.28.0",
|
|
57
|
+
"eslint": "^8.57.0",
|
|
58
|
+
"eslint-config-standard": "^17.1.0",
|
|
59
|
+
"lightningcss": "^1.30.2",
|
|
60
|
+
"lightningcss-cli": "^1.30.2",
|
|
61
|
+
"markdown-toc": "^1.2.0",
|
|
62
|
+
"stylelint": "^17.0.0",
|
|
63
|
+
"stylelint-config-standard": "^40.0.0",
|
|
64
|
+
"tap-spec": "^5.0.0",
|
|
65
|
+
"typedoc": "^0.28.1",
|
|
66
|
+
"typescript": "^6.0.2",
|
|
67
|
+
"vite": "^8.0.5"
|
|
68
|
+
},
|
|
69
|
+
"keywords": [
|
|
70
|
+
"select",
|
|
71
|
+
"html",
|
|
72
|
+
"web",
|
|
73
|
+
"component"
|
|
74
|
+
],
|
|
75
|
+
"homepage": "https://github.com/substrate-system/select",
|
|
76
|
+
"bugs": {
|
|
77
|
+
"url": "https://github.com/substrate-system/select/issues"
|
|
78
|
+
},
|
|
79
|
+
"repository": {
|
|
80
|
+
"type": "git",
|
|
81
|
+
"url": "git+https://github.com/substrate-system/select.git"
|
|
82
|
+
},
|
|
83
|
+
"directories": {
|
|
84
|
+
"doc": "docs",
|
|
85
|
+
"example": "example",
|
|
86
|
+
"test": "test"
|
|
87
|
+
},
|
|
88
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
89
|
+
"author": "nichoth <nichoth@nichoth.com> (https://nichoth.com)"
|
|
90
|
+
}
|