frontile 0.18.3 → 0.18.6
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/declarations/-private/reveal-within.d.ts +19 -0
- package/declarations/-private/reveal-within.d.ts.map +1 -0
- package/declarations/components/collections/calendar/year-grid.d.ts.map +1 -1
- package/declarations/components/forms/autocomplete.d.ts +49 -1
- package/declarations/components/forms/autocomplete.d.ts.map +1 -1
- package/declarations/components/forms/date-input/segment-group.d.ts +2 -1
- package/declarations/components/forms/date-input/segment-group.d.ts.map +1 -1
- package/declarations/components/forms/date-input/segments.d.ts +3 -1
- package/declarations/components/forms/date-input/segments.d.ts.map +1 -1
- package/declarations/components/forms/date-picker/date-picker.d.ts +119 -1
- package/declarations/components/forms/date-picker/date-picker.d.ts.map +1 -1
- package/declarations/components/forms/date-picker/time-columns.d.ts +87 -0
- package/declarations/components/forms/date-picker/time-columns.d.ts.map +1 -0
- package/declarations/components/forms/date-picker/types.d.ts +28 -0
- package/declarations/components/forms/date-picker/types.d.ts.map +1 -1
- package/declarations/components/forms/select/native-mirror.d.ts +3 -2
- package/declarations/components/forms/select/native-mirror.d.ts.map +1 -1
- package/declarations/components/forms/select/select.d.ts +42 -3
- package/declarations/components/forms/select/select.d.ts.map +1 -1
- package/declarations/components/forms/select/types.d.ts +36 -1
- package/declarations/components/forms/select/types.d.ts.map +1 -1
- package/declarations/components/overlays/overlay.d.ts +17 -2
- package/declarations/components/overlays/overlay.d.ts.map +1 -1
- package/declarations/test-support.d.ts.map +1 -1
- package/declarations/utils/filter.d.ts +30 -0
- package/declarations/utils/filter.d.ts.map +1 -1
- package/dist/components/collections/calendar/year-grid.js +1 -30
- package/dist/components/collections/calendar/year-grid.js.map +1 -1
- package/dist/components/forms/autocomplete.js +35 -4
- package/dist/components/forms/autocomplete.js.map +1 -1
- package/dist/components/forms/date-input/segment-group.js +1 -1
- package/dist/components/forms/date-input/segment-group.js.map +1 -1
- package/dist/components/forms/date-input/segments.js +1 -1
- package/dist/components/forms/date-input/segments.js.map +1 -1
- package/dist/components/forms/date-input.js +1 -1
- package/dist/components/forms/date-picker/date-picker.js +57 -6
- package/dist/components/forms/date-picker/date-picker.js.map +1 -1
- package/dist/components/forms/date-picker/time-columns.js +238 -0
- package/dist/components/forms/date-picker/time-columns.js.map +1 -0
- package/dist/components/forms/index.js +1 -1
- package/dist/components/forms/select/native-mirror.js.map +1 -1
- package/dist/components/forms/select/select.js +76 -4
- package/dist/components/forms/select/select.js.map +1 -1
- package/dist/components/overlays/overlay.js +55 -7
- package/dist/components/overlays/overlay.js.map +1 -1
- package/dist/forms.js +1 -1
- package/dist/index.js +1 -1
- package/dist/reveal-within-BcqpOmSI.js +33 -0
- package/dist/reveal-within-BcqpOmSI.js.map +1 -0
- package/dist/test-support.js +3 -1
- package/dist/test-support.js.map +1 -1
- package/dist/utils/filter.js +32 -1
- package/dist/utils/filter.js.map +1 -1
- package/package.json +3 -3
package/dist/test-support.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-support.js","sources":["../../../node_modules/.pnpm/@ember+test-helpers@5.7.0_@babel+core@7.29.7/node_modules/@ember/test-helpers/dist/-internal/deprecations.js","../../../node_modules/.pnpm/@ember+test-helpers@5.7.0_@babel+core@7.29.7/node_modules/@ember/test-helpers/dist/-internal/warnings.js","../../../node_modules/.pnpm/@ember+test-helpers@5.7.0_@babel+core@7.29.7/node_modules/@ember/test-helpers/dist/has-ember-version.js","../../../node_modules/.pnpm/@ember+test-helpers@5.7.0_@babel+core@7.29.7/node_modules/@ember/test-helpers/dist/-internal/debug-info-helpers.js","../../../node_modules/.pnpm/@ember+test-helpers@5.7.0_@babel+core@7.29.7/node_modules/@ember/test-helpers/dist/-internal/debug-info.js","../../../node_modules/.pnpm/@ember+test-helpers@5.7.0_@babel+core@7.29.7/node_modules/@ember/test-helpers/dist/dom/-logging.js","../src/test-support.ts"],"sourcesContent":["import { registerDeprecationHandler } from '@ember/debug';\nimport isPromise from './is-promise.js';\n\nconst DEPRECATIONS = new WeakMap();\n\n/**\n *\n * Provides the list of deprecation failures associated with a given base context;\n *\n * @private\n * @param {BaseContext} [context] the test context\n * @return {Array<DeprecationFailure>} the Deprecation Failures associated with the corresponding BaseContext;\n */\nfunction getDeprecationsForContext(context) {\n if (!context) {\n throw new TypeError(`[@ember/test-helpers] could not get deprecations for an invalid test context: '${context}'`);\n }\n let deprecations = DEPRECATIONS.get(context);\n if (!Array.isArray(deprecations)) {\n deprecations = [];\n DEPRECATIONS.set(context, deprecations);\n }\n return deprecations;\n}\n\n/**\n *\n * Provides the list of deprecation failures associated with a given base\n * context which occur while a callback is executed. This callback can be\n * synchronous, or it can be an async function.\n *\n * @private\n * @param {BaseContext} [context] the test context\n * @param {Function} [callback] The callback that when executed will have its DeprecationFailure recorded\n * @return {Array<DeprecationFailure>} The Deprecation Failures associated with the corresponding baseContext which occurred while the CallbackFunction was executed\n */\nfunction getDeprecationsDuringCallbackForContext(context, callback) {\n if (!context) {\n throw new TypeError(`[@ember/test-helpers] could not get deprecations for an invalid test context: '${context}'`);\n }\n const deprecations = getDeprecationsForContext(context);\n const previousLength = deprecations.length;\n const result = callback();\n if (isPromise(result)) {\n return Promise.resolve(result).then(() => {\n return deprecations.slice(previousLength); // only return deprecations created as a result of the callback\n });\n } else {\n return deprecations.slice(previousLength); // only return deprecations created as a result of the callback\n }\n}\n\n// This provides (when the environment supports) queryParam support for deprecations:\n// * squelch deprecations by name via: `/tests/index.html?disabledDeprecations=this-property-fallback,some-other-thing`\n// * enable a debuggger when a deprecation by a specific name is encountered via: `/tests/index.html?debugDeprecations=some-other-thing` when the\nif (typeof URLSearchParams !== 'undefined') {\n const queryParams = new URLSearchParams(document.location.search.substring(1));\n const disabledDeprecations = queryParams.get('disabledDeprecations');\n const debugDeprecations = queryParams.get('debugDeprecations');\n\n // When using `/tests/index.html?disabledDeprecations=this-property-fallback,some-other-thing`\n // those deprecations will be squelched\n if (disabledDeprecations) {\n registerDeprecationHandler((message, options, next) => {\n if (!options || !disabledDeprecations.includes(options.id)) {\n next.apply(null, [message, options]);\n }\n });\n }\n\n // When using `/tests/index.html?debugDeprecations=some-other-thing` when the\n // `some-other-thing` deprecation is triggered, this `debugger` will be hit`\n if (debugDeprecations) {\n registerDeprecationHandler((message, options, next) => {\n if (options && debugDeprecations.includes(options.id)) {\n debugger; // eslint-disable-line no-debugger\n }\n next.apply(null, [message, options]);\n });\n }\n}\n\nexport { getDeprecationsDuringCallbackForContext, getDeprecationsForContext };\n//# sourceMappingURL=deprecations.js.map\n","import { registerWarnHandler } from '@ember/debug';\nimport isPromise from './is-promise.js';\n\n// the WARNINGS data structure which is used to weakly associated warnings with\n// the test context their occurred within\nconst WARNINGS = new WeakMap();\n\n/**\n *\n * Provides the list of warnings associated with a given base context;\n *\n * @private\n * @param {BaseContext} [context] the test context\n * @return {Array<Warning>} the warnings associated with the corresponding BaseContext;\n */\nfunction getWarningsForContext(context) {\n if (!context) {\n throw new TypeError(`[@ember/test-helpers] could not get warnings for an invalid test context: '${context}'`);\n }\n let warnings = WARNINGS.get(context);\n if (!Array.isArray(warnings)) {\n warnings = [];\n WARNINGS.set(context, warnings);\n }\n return warnings;\n}\n\n/**\n *\n * Provides the list of warnings associated with a given test context which\n * occurred only while a the provided callback is executed. This callback can be\n * synchronous, or it can be an async function.\n *\n * @private\n * @param {BaseContext} [context] the test context\n * @param {Function} [callback] The callback that when executed will have its warnings recorded\n * @return {Array<Warning>} The warnings associated with the corresponding baseContext which occurred while the CallbackFunction was executed\n */\nfunction getWarningsDuringCallbackForContext(context, callback) {\n if (!context) {\n throw new TypeError(`[@ember/test-helpers] could not get warnings for an invalid test context: '${context}'`);\n }\n const warnings = getWarningsForContext(context);\n const previousLength = warnings.length;\n const result = callback();\n if (isPromise(result)) {\n return Promise.resolve(result).then(() => {\n return warnings.slice(previousLength); // only return warnings created as a result of the callback\n });\n } else {\n return warnings.slice(previousLength); // only return warnings created as a result of the callback\n }\n}\n\n// This provides (when the environment supports) queryParam support for warnings:\n// * squelch warnings by name via: `/tests/index.html?disabledWarnings=this-property-fallback,some-other-thing`\n// * enable a debuggger when a warning by a specific name is encountered via: `/tests/index.html?debugWarnings=some-other-thing` when the\nif (typeof URLSearchParams !== 'undefined') {\n const queryParams = new URLSearchParams(document.location.search.substring(1));\n const disabledWarnings = queryParams.get('disabledWarnings');\n const debugWarnings = queryParams.get('debugWarnings');\n\n // When using `/tests/index.html?disabledWarnings=this-property-fallback,some-other-thing`\n // those warnings will be squelched\n if (disabledWarnings) {\n registerWarnHandler((message, options, next) => {\n if (!options || !disabledWarnings.includes(options.id)) {\n next.apply(null, [message, options]);\n }\n });\n }\n\n // When using `/tests/index.html?debugWarnings=some-other-thing` when the\n // `some-other-thing` warning is triggered, this `debugger` will be hit`\n if (debugWarnings) {\n registerWarnHandler((message, options, next) => {\n if (options && debugWarnings.includes(options.id)) {\n debugger; // eslint-disable-line no-debugger\n }\n next.apply(null, [message, options]);\n });\n }\n}\n\nexport { getWarningsDuringCallbackForContext, getWarningsForContext };\n//# sourceMappingURL=warnings.js.map\n","import { VERSION } from '@ember/version';\n\n// @ts-ignore\n\n/**\n Checks if the currently running Ember version is greater than or equal to the\n specified major and minor version numbers.\n\n @private\n @param {number} major the major version number to compare\n @param {number} minor the minor version number to compare\n @returns {boolean} true if the Ember version is >= MAJOR.MINOR specified, false otherwise\n*/\nfunction hasEmberVersion(major, minor) {\n const numbers = VERSION.split('-')[0]?.split('.');\n if (!numbers || !numbers[0] || !numbers[1]) {\n throw new Error('`Ember.VERSION` is not set.');\n }\n const actualMajor = parseInt(numbers[0], 10);\n const actualMinor = parseInt(numbers[1], 10);\n return actualMajor > major || actualMajor === major && actualMinor >= minor;\n}\n\nexport { hasEmberVersion as default };\n//# sourceMappingURL=has-ember-version.js.map\n","const debugInfoHelpers = new Set();\n\n/**\n * Registers a custom debug info helper to augment the output for test isolation validation.\n *\n * @public\n * @param {DebugInfoHelper} debugHelper a custom debug info helper\n * @example\n *\n * import { registerDebugInfoHelper } from '@ember/test-helpers';\n *\n * registerDebugInfoHelper({\n * name: 'Date override detection',\n * log() {\n * if (dateIsOverridden()) {\n * console.log(this.name);\n * console.log('The date object has been overridden');\n * }\n * }\n * })\n */\nfunction registerDebugInfoHelper(debugHelper) {\n debugInfoHelpers.add(debugHelper);\n}\n\nexport { debugInfoHelpers, registerDebugInfoHelper as default };\n//# sourceMappingURL=debug-info-helpers.js.map\n","import { _backburner } from '@ember/runloop';\nimport { debugInfoHelpers } from './debug-info-helpers.js';\nimport { getPendingWaiterState } from '@ember/test-waiters';\n\n// @ts-ignore: this is private API. This import will work Ember 5.1+ since it\n// \"provides\" this public API, but does not for earlier versions. As a result,\n// this type will be `any`.\nconst PENDING_AJAX_REQUESTS = 'Pending AJAX requests';\nconst PENDING_TEST_WAITERS = 'Pending test waiters';\nconst SCHEDULED_ASYNC = 'Scheduled async';\nconst SCHEDULED_AUTORUN = 'Scheduled autorun';\n\n/**\n * The base functionality which may be present on the `SettledState` interface\n * in the `settled` module (**not** the one in this module).\n */\n\n/**\n * Determines if the `getDebugInfo` method is available in the\n * running verison of backburner.\n *\n * @returns {boolean} True if `getDebugInfo` is present in backburner, otherwise false.\n */\nfunction backburnerDebugInfoAvailable() {\n return typeof _backburner.getDebugInfo === 'function';\n}\n\n/**\n * Retrieves debug information from backburner's current deferred actions queue (runloop instance).\n * If the `getDebugInfo` method isn't available, it returns `null`.\n *\n * @public\n * @returns {MaybeDebugInfo | null} Backburner debugInfo or, if the getDebugInfo method is not present, null\n */\nfunction getDebugInfo() {\n return _backburner.DEBUG === true && backburnerDebugInfoAvailable() ? _backburner.getDebugInfo() : null;\n}\n\n/**\n * Encapsulates debug information for an individual test. Aggregates information\n * from:\n * - info provided by getSettledState\n * - hasPendingTimers\n * - hasRunLoop\n * - hasPendingWaiters\n * - hasPendingRequests\n * - info provided by backburner's getDebugInfo method (timers, schedules, and stack trace info)\n *\n */\nclass TestDebugInfo {\n _settledState;\n _debugInfo;\n _summaryInfo = undefined;\n constructor(settledState, debugInfo = getDebugInfo()) {\n this._settledState = settledState;\n this._debugInfo = debugInfo;\n }\n get summary() {\n if (!this._summaryInfo) {\n this._summaryInfo = {\n ...this._settledState\n };\n if (this._debugInfo) {\n this._summaryInfo.autorunStackTrace = this._debugInfo.autorun && this._debugInfo.autorun.stack;\n this._summaryInfo.pendingTimersCount = this._debugInfo.timers.length;\n this._summaryInfo.hasPendingTimers = this._settledState.hasPendingTimers && this._summaryInfo.pendingTimersCount > 0;\n this._summaryInfo.pendingTimersStackTraces = this._debugInfo.timers.map(timer => timer.stack);\n this._summaryInfo.pendingScheduledQueueItemCount = this._debugInfo.instanceStack.filter(isNotNullable).reduce((total, item) => {\n Object.values(item).forEach(queueItems => {\n // SAFETY: this cast is required for versions of Ember which do\n // not supply a correct definition of these types. It should\n // also be compatible with the version where Ember *does* supply\n // the types correctly.\n total += queueItems?.length ?? 0;\n });\n return total;\n }, 0);\n this._summaryInfo.pendingScheduledQueueItemStackTraces = this._debugInfo.instanceStack.filter(isNotNullable).reduce((stacks, deferredActionQueues) => {\n Object.values(deferredActionQueues).forEach(queueItems => {\n // SAFETY: this cast is required for versions of Ember which do\n // not supply a correct definition of these types. It should\n // also be compatible with the version where Ember *does* supply\n // the types correctly.\n queueItems?.forEach(queueItem => queueItem.stack && stacks.push(queueItem.stack));\n });\n return stacks;\n }, []);\n }\n if (this._summaryInfo.hasPendingTestWaiters) {\n this._summaryInfo.pendingTestWaiterInfo = getPendingWaiterState();\n }\n }\n return this._summaryInfo;\n }\n toConsole(_console = console) {\n const summary = this.summary;\n if (summary.hasPendingRequests) {\n _console.log(PENDING_AJAX_REQUESTS);\n }\n if (summary.hasPendingLegacyWaiters) {\n _console.log(PENDING_TEST_WAITERS);\n }\n if (summary.hasPendingTestWaiters) {\n if (!summary.hasPendingLegacyWaiters) {\n _console.log(PENDING_TEST_WAITERS);\n }\n Object.keys(summary.pendingTestWaiterInfo.waiters).forEach(waiterName => {\n const waiterDebugInfo = summary.pendingTestWaiterInfo.waiters[waiterName];\n if (Array.isArray(waiterDebugInfo)) {\n _console.group(waiterName);\n waiterDebugInfo.forEach(debugInfo => {\n _console.log(`${debugInfo.label ? debugInfo.label : 'stack'}: ${debugInfo.stack}`);\n });\n _console.groupEnd();\n } else {\n _console.log(waiterName);\n }\n });\n }\n if (summary.hasPendingTimers || summary.pendingScheduledQueueItemCount > 0) {\n _console.group(SCHEDULED_ASYNC);\n summary.pendingTimersStackTraces.forEach(timerStack => {\n _console.log(timerStack);\n });\n summary.pendingScheduledQueueItemStackTraces.forEach(scheduleQueueItemStack => {\n _console.log(scheduleQueueItemStack);\n });\n _console.groupEnd();\n }\n if (summary.hasRunLoop && summary.pendingTimersCount === 0 && summary.pendingScheduledQueueItemCount === 0) {\n _console.log(SCHEDULED_AUTORUN);\n if (summary.autorunStackTrace) {\n _console.log(summary.autorunStackTrace);\n }\n }\n debugInfoHelpers.forEach(helper => {\n helper.log();\n });\n }\n _formatCount(title, count) {\n return `${title}: ${count}`;\n }\n}\n\n// eslint-disable-next-line require-jsdoc, @typescript-eslint/no-empty-object-type\nfunction isNotNullable(value) {\n return value != null;\n}\n\nexport { TestDebugInfo, backburnerDebugInfoAvailable, getDebugInfo };\n//# sourceMappingURL=debug-info.js.map\n","/**\n * Logs a debug message to the console if the `testHelperLogging` query\n * parameter is set.\n *\n * @private\n * @param {string} helperName Name of the helper\n * @param {string|Element} target The target element or selector\n */\nfunction log(helperName, target, ...args) {\n if (loggingEnabled()) {\n // eslint-disable-next-line no-console\n console.log(`${helperName}(${[elementToString(target), ...args.filter(Boolean)].join(', ')})`);\n }\n}\n\n/**\n * Returns whether the test helper logging is enabled or not via the\n * `testHelperLogging` query parameter.\n *\n * @private\n * @returns {boolean} true if enabled\n */\nfunction loggingEnabled() {\n return typeof location !== 'undefined' && location.search.indexOf('testHelperLogging') !== -1;\n}\n\n/**\n * This generates a human-readable description to a DOM element.\n *\n * @private\n * @param {*} el The element that should be described\n * @returns {string} A human-readable description\n */\nfunction elementToString(el) {\n let desc;\n if (el instanceof NodeList) {\n if (el.length === 0) {\n return 'empty NodeList';\n }\n desc = Array.prototype.slice.call(el, 0, 5).map(elementToString).join(', ');\n return el.length > 5 ? `${desc}... (+${el.length - 5} more)` : desc;\n }\n if (!(el instanceof HTMLElement || el instanceof SVGElement)) {\n return String(el);\n }\n desc = el.tagName.toLowerCase();\n if (el.id) {\n desc += `#${el.id}`;\n }\n if (el.className && !(el.className instanceof SVGAnimatedString)) {\n desc += `.${String(el.className).replace(/\\s+/g, '.')}`;\n }\n Array.prototype.forEach.call(el.attributes, function (attr) {\n if (attr.name !== 'class' && attr.name !== 'id') {\n desc += `[${attr.name}${attr.value ? `=\"${attr.value}\"]` : ']'}`;\n }\n });\n return desc;\n}\n\nexport { elementToString, log };\n//# sourceMappingURL=-logging.js.map\n","import { triggerEvent, focus, triggerKeyEvent } from '@ember/test-helpers';\nimport { parseDate } from './components/forms/date-picker/value';\n\nexport function selectOptionByKey(\n selectSelector: string,\n key: string\n): Promise<void> {\n return changeOption('selectOptionByKey', selectSelector, key, false);\n}\n\nexport function toggleOptionByKey(\n selectSelector: string,\n key: string\n): Promise<void> {\n return changeOption('toggleOptionByKey', selectSelector, key, true);\n}\n\nfunction changeOption(\n functionName: string,\n selectSelector: string,\n key: string,\n toggle: boolean\n): Promise<void> {\n const container = document.querySelector(selectSelector);\n\n if (!container) {\n throw new Error(\n `You called \"${functionName}('${selectSelector}', '${key}')\" but no select was found using selector \"${selectSelector}\"`\n );\n }\n\n let select: Element | null = container;\n if (container.tagName !== 'SELECT') {\n // `data-component=\"native-select\"` lives on FormControl's root element,\n // not the `<select>` itself (the anatomy contract puts `data-component`\n // only on a component's outermost element, and the `<select>` is a\n // *part* of `native-select`, not its root). `data-test-id=\"native-select\"`\n // stays directly on the `<select>` tag, so it is the stable way to reach\n // it from an arbitrary ancestor container.\n select = container.querySelector('[data-test-id=\"native-select\"]');\n }\n\n if (!select) {\n throw new Error(\n `You called \"${functionName}('${selectSelector}', '${key}')\" but no select was found inside container using selector \"${selectSelector}\"`\n );\n }\n\n const option = select.querySelector(`[data-key=\"${key}\"]`) as\n HTMLOptionElement | undefined;\n if (!option) {\n throw new Error(\n `You called \"${functionName}('${selectSelector}', '${key}')\" but no option with key \"${key}\" was found`\n );\n }\n\n if (toggle && option.selected) {\n option.selected = false;\n } else {\n option.selected = true;\n }\n\n return triggerEvent(select, 'change');\n}\n\nexport { setPrefersReducedMotion } from './utils/prefers-reduced-motion';\n\n/**\n * Selects the elements bearing `[data-part=\"${part}\"]` whose *own* anatomy\n * root is `root` — i.e. `root` is the nearest `[data-component]` ancestor.\n *\n * `[data-component=\"X\"] [data-part=\"Y\"]` (plain CSS descendant combinator)\n * matches \"any descendant\", which is ambiguous whenever a component with a\n * part named `Y` renders a nested component that also has an element\n * carrying `data-part=\"Y\"` (its own part, or a caller-supplied one on the\n * nested component's root). CSS has no \"nearest enclosing\" combinator, so\n * this helper resolves ownership the same way behavioural code would have\n * to: walk up from the part element and confirm the nearest\n * `[data-component]` ancestor is `root`.\n *\n * The walk starts at `el.parentElement`, not `el` itself, deliberately:\n * `el` may itself be a nested component's root (e.g. `CloseButton`, which\n * carries its own `data-component=\"close-button\"` on the very element that\n * also carries a caller-supplied `data-part=\"clear-button\"` or\n * `data-part=\"close-button\"`). Starting `closest()`/the walk from `el`\n * would match `el` itself and never reach `root`, wrongly excluding a part\n * that legitimately belongs to `root`.\n */\nexport function ownParts(root: Element, part: string): Element[] {\n return [...root.querySelectorAll(`[data-part=\"${part}\"]`)].filter((el) => {\n let node = el.parentElement;\n while (node && node !== root) {\n if (node.hasAttribute('data-component')) return false;\n node = node.parentElement;\n }\n return node === root;\n });\n}\n\n/**\n * Types a date into a segmented `DateInput` or `DatePicker`.\n *\n * `fillIn` cannot do this and, worse, does not fail when you try. The segments\n * are `contenteditable`, so `fillIn` writes their text and fires `input`\n * without complaint -- but the component renders from its own segments and\n * listens only to `beforeinput`/`keydown`, so nothing reaches the value. The\n * result is a test that reads green, whose `assert.dom(...).hasText('01')`\n * even passes, while the component's value stayed `null` and the form would\n * submit empty.\n *\n * This types the digits segment by segment the way a person does, so the value\n * composes through the same commit path as real input.\n *\n * ```js\n * await fillDate('[data-test-due]', '2026-01-20');\n * await fillDate('[data-test-due]', new Date(2026, 0, 20));\n * ```\n *\n * For `@mode=\"range\"` use {@link fillDateRange}.\n */\nexport function fillDate(\n selector: string,\n value: Date | string\n): Promise<void> {\n return fillGroup('fillDate', selector, value, 0);\n}\n\n/**\n * Types both ends of a range into a segmented `DatePicker @mode=\"range\"`.\n *\n * ```js\n * await fillDateRange('[data-test-trip]', '2026-01-20', '2026-01-25');\n * ```\n */\nexport async function fillDateRange(\n selector: string,\n start: Date | string,\n end: Date | string\n): Promise<void> {\n await fillGroup('fillDateRange', selector, start, 0);\n await fillGroup('fillDateRange', selector, end, 1);\n}\n\nfunction clockHour(hours: number, segment: HTMLElement): number {\n const min = Number(segment.getAttribute('aria-valuemin'));\n const max = Number(segment.getAttribute('aria-valuemax'));\n if (max === 12) return hours % 12 || 12;\n if (max === 11) return hours % 12;\n if (min === 1) return hours || 24;\n return hours;\n}\n\n/**\n * AM/PM is typed by a letter that depends on the locale, so it is stepped\n * instead: ArrowUp fills an empty segment and toggles a filled one.\n */\nasync function setDayPeriod(segment: HTMLElement, value: 0 | 1): Promise<void> {\n await focus(segment);\n for (let i = 0; i < 2; i++) {\n if (segment.getAttribute('aria-valuenow') === String(value)) return;\n await triggerKeyEvent(segment, 'keydown', 'ArrowUp');\n }\n}\n\n/**\n * Reuses the component's own parser rather than restating the wire format, so\n * the helper cannot drift from what `@value` actually accepts -- but turns a\n * refusal into a thrown error, since a test helper handed a bad date should\n * say so rather than quietly fill nothing.\n */\nfunction asDate(functionName: string, value: Date | string): Date {\n const parsed = parseDate(value);\n if (!parsed) {\n throw new Error(\n `You called \"${functionName}\" with \"${String(value)}\", which is neither a Date nor a yyyy-MM-dd or yyyy-MM-ddTHH:mm string.`\n );\n }\n\n return parsed;\n}\n\nasync function fillGroup(\n functionName: string,\n selector: string,\n value: Date | string,\n which: 0 | 1\n): Promise<void> {\n const container = document.querySelector(selector);\n if (!container) {\n throw new Error(\n `You called \"${functionName}('${selector}', ...)\" but no element was found using selector \"${selector}\".`\n );\n }\n\n const group = container.querySelectorAll('[data-part=\"group\"]')[which];\n\n if (!group) {\n // Far and away the likeliest cause: the field is on the button-trigger\n // path, where there is nothing to type into at all.\n const hasButtonTrigger = container.querySelector('[data-part=\"input\"]');\n throw new Error(\n hasButtonTrigger\n ? `You called \"${functionName}('${selector}', ...)\" on a date field rendering its button trigger, which cannot be typed into. Drop @isEditable={{false}}, or click the trigger and pick from the calendar.`\n : `You called \"${functionName}('${selector}', ...)\" but found no date segments inside \"${selector}\".`\n );\n }\n\n const date = asDate(functionName, value);\n const pad = (n: number, width = 2): string => String(n).padStart(width, '0');\n const digits: Record<string, string> = {\n year: pad(date.getFullYear(), 4),\n month: pad(date.getMonth() + 1),\n day: pad(date.getDate()),\n minute: pad(date.getMinutes())\n };\n\n for (const segment of group.querySelectorAll('[data-part=\"segment\"]')) {\n const element = segment as HTMLElement;\n const type = element.dataset['type'];\n\n if (type === 'dayPeriod') {\n await setDayPeriod(element, date.getHours() < 12 ? 0 : 1);\n continue;\n }\n\n // The hour goes in as the field's own clock counts it, which its\n // spinbutton bounds give away: 1-12 or 0-11 for AM/PM, 0-23 or 1-24 not.\n const run =\n type === 'hour'\n ? pad(clockHour(date.getHours(), element))\n : type\n ? digits[type]\n : undefined;\n if (!run) continue;\n\n await focus(element);\n for (const digit of run) {\n await triggerKeyEvent(element, 'keydown', digit);\n }\n }\n}\n"],"names":["DEPRECATIONS","WeakMap","getDeprecationsForContext","context","TypeError","deprecations","get","Array","isArray","set","URLSearchParams","queryParams","document","location","search","substring","disabledDeprecations","debugDeprecations","registerDeprecationHandler","message","options","next","includes","id","apply","WARNINGS","getWarningsForContext","warnings","disabledWarnings","debugWarnings","registerWarnHandler","hasEmberVersion","major","minor","numbers","VERSION","split","Error","actualMajor","parseInt","actualMinor","debugInfoHelpers","Set","PENDING_AJAX_REQUESTS","PENDING_TEST_WAITERS","SCHEDULED_ASYNC","SCHEDULED_AUTORUN","backburnerDebugInfoAvailable","_backburner","getDebugInfo","DEBUG","TestDebugInfo","_settledState","_debugInfo","_summaryInfo","undefined","constructor","settledState","debugInfo","summary","autorunStackTrace","autorun","stack","pendingTimersCount","timers","length","hasPendingTimers","pendingTimersStackTraces","map","timer","pendingScheduledQueueItemCount","instanceStack","filter","isNotNullable","reduce","total","item","Object","values","forEach","queueItems","pendingScheduledQueueItemStackTraces","stacks","deferredActionQueues","queueItem","push","hasPendingTestWaiters","pendingTestWaiterInfo","getPendingWaiterState","toConsole","_console","console","hasPendingRequests","log","hasPendingLegacyWaiters","keys","waiters","waiterName","waiterDebugInfo","group","label","groupEnd","timerStack","scheduleQueueItemStack","hasRunLoop","helper","_formatCount","title","count","value","helperName","target","args","loggingEnabled","elementToString","Boolean","join","indexOf","el","desc","NodeList","prototype","slice","call","HTMLElement","SVGElement","String","tagName","toLowerCase","className","SVGAnimatedString","replace","attributes","attr","name","selectOptionByKey","selectSelector","key","changeOption","toggleOptionByKey","functionName","toggle","container","querySelector","select","option","selected","triggerEvent","ownParts","root","part","querySelectorAll","node","parentElement","hasAttribute","fillDate","selector","fillGroup","fillDateRange","start","end","clockHour","hours","segment","min","Number","getAttribute","max","setDayPeriod","focus","i","triggerKeyEvent","asDate","parsed","parseDate","which","hasButtonTrigger","date","pad","n","width","padStart","digits","year","getFullYear","month","getMonth","day","getDate","minute","getMinutes","element","type","dataset","getHours","run","digit"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkBA,MAAMA,YAAY,GAAG,IAAIC,OAAO,EAA0C;;AAE1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,yBAAyBA,CACvCC,OAAoB,EACO;EAC3B,IAAI,CAACA,OAAO,EAAE;AACZ,IAAA,MAA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AAK,EAAEP,GAAG,CAACD,IAAI,CAACS,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC/BC,GAAG,EAAET,GAAG,CAACD,IAAI,CAACW,OAAO,EAAE,CAAC;AACxBC,IAAAA,MAAM,EAAEX,GAAG,CAACD,IAAI,CAACa,UAAU,EAAE;GAC9B;EAED,KAAK,MAAM3B,OAAO,IAAIhE,KAAK,CAACoD,gBAAgB,CAAC,uBAAuB,CAAC,EAAE;IACrE,MAAMwC,OAAO,GAAG5B,OAAsB;AACtC,IAAA,MAAM6B,IAAI,GAAGD,OAAO,CAACE,OAAO,CAAC,MAAM,CAAC;IAEpC,IAAID,IAAI,KAAK,WAAW,EAAE;AACxB,MAAA,MAAMxB,YAAY,CAACuB,OAAO,EAAEd,IAAI,CAACiB,QAAQ,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;AACzD,MAAA;AACF,IAAA;;AAEA;AACA;IACA,MAAMC,GAAG,GACPH,IAAI,KAAK,MAAM,GACXd,GAAG,CAACjB,SAAS,CAACgB,IAAI,CAACiB,QAAQ,EAAE,EAAEH,OAAO,CAAC,CAAC,GACxCC,IAAI,GACFV,MAAM,CAACU,IAAI,CAAC,GACZzI,SAAS;IACjB,IAAI,CAAC4I,GAAG,EAAE;IAEV,MAAM1B,KAAK,CAACsB,OAAO,CAAC;AACpB,IAAA,KAAK,MAAMK,KAAK,IAAID,GAAG,EAAE;AACvB,MAAA,MAAMxB,eAAe,CAACoB,OAAO,EAAE,SAAS,EAAEK,KAAK,CAAC;AAClD,IAAA;AACF,EAAA;AACF;;","x_google_ignoreList":[0,1,2,3,4,5]}
|
|
1
|
+
{"version":3,"file":"test-support.js","sources":["../../../node_modules/.pnpm/@ember+test-helpers@5.7.0_@babel+core@7.29.7/node_modules/@ember/test-helpers/dist/-internal/deprecations.js","../../../node_modules/.pnpm/@ember+test-helpers@5.7.0_@babel+core@7.29.7/node_modules/@ember/test-helpers/dist/-internal/warnings.js","../../../node_modules/.pnpm/@ember+test-helpers@5.7.0_@babel+core@7.29.7/node_modules/@ember/test-helpers/dist/has-ember-version.js","../../../node_modules/.pnpm/@ember+test-helpers@5.7.0_@babel+core@7.29.7/node_modules/@ember/test-helpers/dist/-internal/debug-info-helpers.js","../../../node_modules/.pnpm/@ember+test-helpers@5.7.0_@babel+core@7.29.7/node_modules/@ember/test-helpers/dist/-internal/debug-info.js","../../../node_modules/.pnpm/@ember+test-helpers@5.7.0_@babel+core@7.29.7/node_modules/@ember/test-helpers/dist/dom/-logging.js","../src/test-support.ts"],"sourcesContent":["import { registerDeprecationHandler } from '@ember/debug';\nimport isPromise from './is-promise.js';\n\nconst DEPRECATIONS = new WeakMap();\n\n/**\n *\n * Provides the list of deprecation failures associated with a given base context;\n *\n * @private\n * @param {BaseContext} [context] the test context\n * @return {Array<DeprecationFailure>} the Deprecation Failures associated with the corresponding BaseContext;\n */\nfunction getDeprecationsForContext(context) {\n if (!context) {\n throw new TypeError(`[@ember/test-helpers] could not get deprecations for an invalid test context: '${context}'`);\n }\n let deprecations = DEPRECATIONS.get(context);\n if (!Array.isArray(deprecations)) {\n deprecations = [];\n DEPRECATIONS.set(context, deprecations);\n }\n return deprecations;\n}\n\n/**\n *\n * Provides the list of deprecation failures associated with a given base\n * context which occur while a callback is executed. This callback can be\n * synchronous, or it can be an async function.\n *\n * @private\n * @param {BaseContext} [context] the test context\n * @param {Function} [callback] The callback that when executed will have its DeprecationFailure recorded\n * @return {Array<DeprecationFailure>} The Deprecation Failures associated with the corresponding baseContext which occurred while the CallbackFunction was executed\n */\nfunction getDeprecationsDuringCallbackForContext(context, callback) {\n if (!context) {\n throw new TypeError(`[@ember/test-helpers] could not get deprecations for an invalid test context: '${context}'`);\n }\n const deprecations = getDeprecationsForContext(context);\n const previousLength = deprecations.length;\n const result = callback();\n if (isPromise(result)) {\n return Promise.resolve(result).then(() => {\n return deprecations.slice(previousLength); // only return deprecations created as a result of the callback\n });\n } else {\n return deprecations.slice(previousLength); // only return deprecations created as a result of the callback\n }\n}\n\n// This provides (when the environment supports) queryParam support for deprecations:\n// * squelch deprecations by name via: `/tests/index.html?disabledDeprecations=this-property-fallback,some-other-thing`\n// * enable a debuggger when a deprecation by a specific name is encountered via: `/tests/index.html?debugDeprecations=some-other-thing` when the\nif (typeof URLSearchParams !== 'undefined') {\n const queryParams = new URLSearchParams(document.location.search.substring(1));\n const disabledDeprecations = queryParams.get('disabledDeprecations');\n const debugDeprecations = queryParams.get('debugDeprecations');\n\n // When using `/tests/index.html?disabledDeprecations=this-property-fallback,some-other-thing`\n // those deprecations will be squelched\n if (disabledDeprecations) {\n registerDeprecationHandler((message, options, next) => {\n if (!options || !disabledDeprecations.includes(options.id)) {\n next.apply(null, [message, options]);\n }\n });\n }\n\n // When using `/tests/index.html?debugDeprecations=some-other-thing` when the\n // `some-other-thing` deprecation is triggered, this `debugger` will be hit`\n if (debugDeprecations) {\n registerDeprecationHandler((message, options, next) => {\n if (options && debugDeprecations.includes(options.id)) {\n debugger; // eslint-disable-line no-debugger\n }\n next.apply(null, [message, options]);\n });\n }\n}\n\nexport { getDeprecationsDuringCallbackForContext, getDeprecationsForContext };\n//# sourceMappingURL=deprecations.js.map\n","import { registerWarnHandler } from '@ember/debug';\nimport isPromise from './is-promise.js';\n\n// the WARNINGS data structure which is used to weakly associated warnings with\n// the test context their occurred within\nconst WARNINGS = new WeakMap();\n\n/**\n *\n * Provides the list of warnings associated with a given base context;\n *\n * @private\n * @param {BaseContext} [context] the test context\n * @return {Array<Warning>} the warnings associated with the corresponding BaseContext;\n */\nfunction getWarningsForContext(context) {\n if (!context) {\n throw new TypeError(`[@ember/test-helpers] could not get warnings for an invalid test context: '${context}'`);\n }\n let warnings = WARNINGS.get(context);\n if (!Array.isArray(warnings)) {\n warnings = [];\n WARNINGS.set(context, warnings);\n }\n return warnings;\n}\n\n/**\n *\n * Provides the list of warnings associated with a given test context which\n * occurred only while a the provided callback is executed. This callback can be\n * synchronous, or it can be an async function.\n *\n * @private\n * @param {BaseContext} [context] the test context\n * @param {Function} [callback] The callback that when executed will have its warnings recorded\n * @return {Array<Warning>} The warnings associated with the corresponding baseContext which occurred while the CallbackFunction was executed\n */\nfunction getWarningsDuringCallbackForContext(context, callback) {\n if (!context) {\n throw new TypeError(`[@ember/test-helpers] could not get warnings for an invalid test context: '${context}'`);\n }\n const warnings = getWarningsForContext(context);\n const previousLength = warnings.length;\n const result = callback();\n if (isPromise(result)) {\n return Promise.resolve(result).then(() => {\n return warnings.slice(previousLength); // only return warnings created as a result of the callback\n });\n } else {\n return warnings.slice(previousLength); // only return warnings created as a result of the callback\n }\n}\n\n// This provides (when the environment supports) queryParam support for warnings:\n// * squelch warnings by name via: `/tests/index.html?disabledWarnings=this-property-fallback,some-other-thing`\n// * enable a debuggger when a warning by a specific name is encountered via: `/tests/index.html?debugWarnings=some-other-thing` when the\nif (typeof URLSearchParams !== 'undefined') {\n const queryParams = new URLSearchParams(document.location.search.substring(1));\n const disabledWarnings = queryParams.get('disabledWarnings');\n const debugWarnings = queryParams.get('debugWarnings');\n\n // When using `/tests/index.html?disabledWarnings=this-property-fallback,some-other-thing`\n // those warnings will be squelched\n if (disabledWarnings) {\n registerWarnHandler((message, options, next) => {\n if (!options || !disabledWarnings.includes(options.id)) {\n next.apply(null, [message, options]);\n }\n });\n }\n\n // When using `/tests/index.html?debugWarnings=some-other-thing` when the\n // `some-other-thing` warning is triggered, this `debugger` will be hit`\n if (debugWarnings) {\n registerWarnHandler((message, options, next) => {\n if (options && debugWarnings.includes(options.id)) {\n debugger; // eslint-disable-line no-debugger\n }\n next.apply(null, [message, options]);\n });\n }\n}\n\nexport { getWarningsDuringCallbackForContext, getWarningsForContext };\n//# sourceMappingURL=warnings.js.map\n","import { VERSION } from '@ember/version';\n\n// @ts-ignore\n\n/**\n Checks if the currently running Ember version is greater than or equal to the\n specified major and minor version numbers.\n\n @private\n @param {number} major the major version number to compare\n @param {number} minor the minor version number to compare\n @returns {boolean} true if the Ember version is >= MAJOR.MINOR specified, false otherwise\n*/\nfunction hasEmberVersion(major, minor) {\n const numbers = VERSION.split('-')[0]?.split('.');\n if (!numbers || !numbers[0] || !numbers[1]) {\n throw new Error('`Ember.VERSION` is not set.');\n }\n const actualMajor = parseInt(numbers[0], 10);\n const actualMinor = parseInt(numbers[1], 10);\n return actualMajor > major || actualMajor === major && actualMinor >= minor;\n}\n\nexport { hasEmberVersion as default };\n//# sourceMappingURL=has-ember-version.js.map\n","const debugInfoHelpers = new Set();\n\n/**\n * Registers a custom debug info helper to augment the output for test isolation validation.\n *\n * @public\n * @param {DebugInfoHelper} debugHelper a custom debug info helper\n * @example\n *\n * import { registerDebugInfoHelper } from '@ember/test-helpers';\n *\n * registerDebugInfoHelper({\n * name: 'Date override detection',\n * log() {\n * if (dateIsOverridden()) {\n * console.log(this.name);\n * console.log('The date object has been overridden');\n * }\n * }\n * })\n */\nfunction registerDebugInfoHelper(debugHelper) {\n debugInfoHelpers.add(debugHelper);\n}\n\nexport { debugInfoHelpers, registerDebugInfoHelper as default };\n//# sourceMappingURL=debug-info-helpers.js.map\n","import { _backburner } from '@ember/runloop';\nimport { debugInfoHelpers } from './debug-info-helpers.js';\nimport { getPendingWaiterState } from '@ember/test-waiters';\n\n// @ts-ignore: this is private API. This import will work Ember 5.1+ since it\n// \"provides\" this public API, but does not for earlier versions. As a result,\n// this type will be `any`.\nconst PENDING_AJAX_REQUESTS = 'Pending AJAX requests';\nconst PENDING_TEST_WAITERS = 'Pending test waiters';\nconst SCHEDULED_ASYNC = 'Scheduled async';\nconst SCHEDULED_AUTORUN = 'Scheduled autorun';\n\n/**\n * The base functionality which may be present on the `SettledState` interface\n * in the `settled` module (**not** the one in this module).\n */\n\n/**\n * Determines if the `getDebugInfo` method is available in the\n * running verison of backburner.\n *\n * @returns {boolean} True if `getDebugInfo` is present in backburner, otherwise false.\n */\nfunction backburnerDebugInfoAvailable() {\n return typeof _backburner.getDebugInfo === 'function';\n}\n\n/**\n * Retrieves debug information from backburner's current deferred actions queue (runloop instance).\n * If the `getDebugInfo` method isn't available, it returns `null`.\n *\n * @public\n * @returns {MaybeDebugInfo | null} Backburner debugInfo or, if the getDebugInfo method is not present, null\n */\nfunction getDebugInfo() {\n return _backburner.DEBUG === true && backburnerDebugInfoAvailable() ? _backburner.getDebugInfo() : null;\n}\n\n/**\n * Encapsulates debug information for an individual test. Aggregates information\n * from:\n * - info provided by getSettledState\n * - hasPendingTimers\n * - hasRunLoop\n * - hasPendingWaiters\n * - hasPendingRequests\n * - info provided by backburner's getDebugInfo method (timers, schedules, and stack trace info)\n *\n */\nclass TestDebugInfo {\n _settledState;\n _debugInfo;\n _summaryInfo = undefined;\n constructor(settledState, debugInfo = getDebugInfo()) {\n this._settledState = settledState;\n this._debugInfo = debugInfo;\n }\n get summary() {\n if (!this._summaryInfo) {\n this._summaryInfo = {\n ...this._settledState\n };\n if (this._debugInfo) {\n this._summaryInfo.autorunStackTrace = this._debugInfo.autorun && this._debugInfo.autorun.stack;\n this._summaryInfo.pendingTimersCount = this._debugInfo.timers.length;\n this._summaryInfo.hasPendingTimers = this._settledState.hasPendingTimers && this._summaryInfo.pendingTimersCount > 0;\n this._summaryInfo.pendingTimersStackTraces = this._debugInfo.timers.map(timer => timer.stack);\n this._summaryInfo.pendingScheduledQueueItemCount = this._debugInfo.instanceStack.filter(isNotNullable).reduce((total, item) => {\n Object.values(item).forEach(queueItems => {\n // SAFETY: this cast is required for versions of Ember which do\n // not supply a correct definition of these types. It should\n // also be compatible with the version where Ember *does* supply\n // the types correctly.\n total += queueItems?.length ?? 0;\n });\n return total;\n }, 0);\n this._summaryInfo.pendingScheduledQueueItemStackTraces = this._debugInfo.instanceStack.filter(isNotNullable).reduce((stacks, deferredActionQueues) => {\n Object.values(deferredActionQueues).forEach(queueItems => {\n // SAFETY: this cast is required for versions of Ember which do\n // not supply a correct definition of these types. It should\n // also be compatible with the version where Ember *does* supply\n // the types correctly.\n queueItems?.forEach(queueItem => queueItem.stack && stacks.push(queueItem.stack));\n });\n return stacks;\n }, []);\n }\n if (this._summaryInfo.hasPendingTestWaiters) {\n this._summaryInfo.pendingTestWaiterInfo = getPendingWaiterState();\n }\n }\n return this._summaryInfo;\n }\n toConsole(_console = console) {\n const summary = this.summary;\n if (summary.hasPendingRequests) {\n _console.log(PENDING_AJAX_REQUESTS);\n }\n if (summary.hasPendingLegacyWaiters) {\n _console.log(PENDING_TEST_WAITERS);\n }\n if (summary.hasPendingTestWaiters) {\n if (!summary.hasPendingLegacyWaiters) {\n _console.log(PENDING_TEST_WAITERS);\n }\n Object.keys(summary.pendingTestWaiterInfo.waiters).forEach(waiterName => {\n const waiterDebugInfo = summary.pendingTestWaiterInfo.waiters[waiterName];\n if (Array.isArray(waiterDebugInfo)) {\n _console.group(waiterName);\n waiterDebugInfo.forEach(debugInfo => {\n _console.log(`${debugInfo.label ? debugInfo.label : 'stack'}: ${debugInfo.stack}`);\n });\n _console.groupEnd();\n } else {\n _console.log(waiterName);\n }\n });\n }\n if (summary.hasPendingTimers || summary.pendingScheduledQueueItemCount > 0) {\n _console.group(SCHEDULED_ASYNC);\n summary.pendingTimersStackTraces.forEach(timerStack => {\n _console.log(timerStack);\n });\n summary.pendingScheduledQueueItemStackTraces.forEach(scheduleQueueItemStack => {\n _console.log(scheduleQueueItemStack);\n });\n _console.groupEnd();\n }\n if (summary.hasRunLoop && summary.pendingTimersCount === 0 && summary.pendingScheduledQueueItemCount === 0) {\n _console.log(SCHEDULED_AUTORUN);\n if (summary.autorunStackTrace) {\n _console.log(summary.autorunStackTrace);\n }\n }\n debugInfoHelpers.forEach(helper => {\n helper.log();\n });\n }\n _formatCount(title, count) {\n return `${title}: ${count}`;\n }\n}\n\n// eslint-disable-next-line require-jsdoc, @typescript-eslint/no-empty-object-type\nfunction isNotNullable(value) {\n return value != null;\n}\n\nexport { TestDebugInfo, backburnerDebugInfoAvailable, getDebugInfo };\n//# sourceMappingURL=debug-info.js.map\n","/**\n * Logs a debug message to the console if the `testHelperLogging` query\n * parameter is set.\n *\n * @private\n * @param {string} helperName Name of the helper\n * @param {string|Element} target The target element or selector\n */\nfunction log(helperName, target, ...args) {\n if (loggingEnabled()) {\n // eslint-disable-next-line no-console\n console.log(`${helperName}(${[elementToString(target), ...args.filter(Boolean)].join(', ')})`);\n }\n}\n\n/**\n * Returns whether the test helper logging is enabled or not via the\n * `testHelperLogging` query parameter.\n *\n * @private\n * @returns {boolean} true if enabled\n */\nfunction loggingEnabled() {\n return typeof location !== 'undefined' && location.search.indexOf('testHelperLogging') !== -1;\n}\n\n/**\n * This generates a human-readable description to a DOM element.\n *\n * @private\n * @param {*} el The element that should be described\n * @returns {string} A human-readable description\n */\nfunction elementToString(el) {\n let desc;\n if (el instanceof NodeList) {\n if (el.length === 0) {\n return 'empty NodeList';\n }\n desc = Array.prototype.slice.call(el, 0, 5).map(elementToString).join(', ');\n return el.length > 5 ? `${desc}... (+${el.length - 5} more)` : desc;\n }\n if (!(el instanceof HTMLElement || el instanceof SVGElement)) {\n return String(el);\n }\n desc = el.tagName.toLowerCase();\n if (el.id) {\n desc += `#${el.id}`;\n }\n if (el.className && !(el.className instanceof SVGAnimatedString)) {\n desc += `.${String(el.className).replace(/\\s+/g, '.')}`;\n }\n Array.prototype.forEach.call(el.attributes, function (attr) {\n if (attr.name !== 'class' && attr.name !== 'id') {\n desc += `[${attr.name}${attr.value ? `=\"${attr.value}\"]` : ']'}`;\n }\n });\n return desc;\n}\n\nexport { elementToString, log };\n//# sourceMappingURL=-logging.js.map\n","import { triggerEvent, focus, triggerKeyEvent } from '@ember/test-helpers';\nimport { parseDate } from './components/forms/date-picker/value';\n\nexport function selectOptionByKey(\n selectSelector: string,\n key: string\n): Promise<void> {\n return changeOption('selectOptionByKey', selectSelector, key, false);\n}\n\nexport function toggleOptionByKey(\n selectSelector: string,\n key: string\n): Promise<void> {\n return changeOption('toggleOptionByKey', selectSelector, key, true);\n}\n\nfunction changeOption(\n functionName: string,\n selectSelector: string,\n key: string,\n toggle: boolean\n): Promise<void> {\n const container = document.querySelector(selectSelector);\n\n if (!container) {\n throw new Error(\n `You called \"${functionName}('${selectSelector}', '${key}')\" but no select was found using selector \"${selectSelector}\"`\n );\n }\n\n let select: Element | null = container;\n if (container.tagName !== 'SELECT') {\n // `data-component=\"native-select\"` lives on FormControl's root element,\n // not the `<select>` itself (the anatomy contract puts `data-component`\n // only on a component's outermost element, and the `<select>` is a\n // *part* of `native-select`, not its root). `data-test-id=\"native-select\"`\n // stays directly on the `<select>` tag, so it is the stable way to reach\n // it from an arbitrary ancestor container.\n select = container.querySelector('[data-test-id=\"native-select\"]');\n }\n\n if (!select) {\n throw new Error(\n `You called \"${functionName}('${selectSelector}', '${key}')\" but no select was found inside container using selector \"${selectSelector}\"`\n );\n }\n\n const option = select.querySelector(`[data-key=\"${key}\"]`) as\n HTMLOptionElement | undefined;\n if (!option) {\n // A Select with `@displayLimit` holds only the first options (and the\n // selected ones) in its hidden `<select>`, like its listbox.\n throw new Error(\n `You called \"${functionName}('${selectSelector}', '${key}')\" but no option with key \"${key}\" was found. ` +\n 'With @displayLimit, only the first options and the selected ones are there: type into the filter and click the option instead.'\n );\n }\n\n if (toggle && option.selected) {\n option.selected = false;\n } else {\n option.selected = true;\n }\n\n return triggerEvent(select, 'change');\n}\n\nexport { setPrefersReducedMotion } from './utils/prefers-reduced-motion';\n\n/**\n * Selects the elements bearing `[data-part=\"${part}\"]` whose *own* anatomy\n * root is `root` — i.e. `root` is the nearest `[data-component]` ancestor.\n *\n * `[data-component=\"X\"] [data-part=\"Y\"]` (plain CSS descendant combinator)\n * matches \"any descendant\", which is ambiguous whenever a component with a\n * part named `Y` renders a nested component that also has an element\n * carrying `data-part=\"Y\"` (its own part, or a caller-supplied one on the\n * nested component's root). CSS has no \"nearest enclosing\" combinator, so\n * this helper resolves ownership the same way behavioural code would have\n * to: walk up from the part element and confirm the nearest\n * `[data-component]` ancestor is `root`.\n *\n * The walk starts at `el.parentElement`, not `el` itself, deliberately:\n * `el` may itself be a nested component's root (e.g. `CloseButton`, which\n * carries its own `data-component=\"close-button\"` on the very element that\n * also carries a caller-supplied `data-part=\"clear-button\"` or\n * `data-part=\"close-button\"`). Starting `closest()`/the walk from `el`\n * would match `el` itself and never reach `root`, wrongly excluding a part\n * that legitimately belongs to `root`.\n */\nexport function ownParts(root: Element, part: string): Element[] {\n return [...root.querySelectorAll(`[data-part=\"${part}\"]`)].filter((el) => {\n let node = el.parentElement;\n while (node && node !== root) {\n if (node.hasAttribute('data-component')) return false;\n node = node.parentElement;\n }\n return node === root;\n });\n}\n\n/**\n * Types a date into a segmented `DateInput` or `DatePicker`.\n *\n * `fillIn` cannot do this and, worse, does not fail when you try. The segments\n * are `contenteditable`, so `fillIn` writes their text and fires `input`\n * without complaint -- but the component renders from its own segments and\n * listens only to `beforeinput`/`keydown`, so nothing reaches the value. The\n * result is a test that reads green, whose `assert.dom(...).hasText('01')`\n * even passes, while the component's value stayed `null` and the form would\n * submit empty.\n *\n * This types the digits segment by segment the way a person does, so the value\n * composes through the same commit path as real input.\n *\n * ```js\n * await fillDate('[data-test-due]', '2026-01-20');\n * await fillDate('[data-test-due]', new Date(2026, 0, 20));\n * ```\n *\n * For `@mode=\"range\"` use {@link fillDateRange}.\n */\nexport function fillDate(\n selector: string,\n value: Date | string\n): Promise<void> {\n return fillGroup('fillDate', selector, value, 0);\n}\n\n/**\n * Types both ends of a range into a segmented `DatePicker @mode=\"range\"`.\n *\n * ```js\n * await fillDateRange('[data-test-trip]', '2026-01-20', '2026-01-25');\n * ```\n */\nexport async function fillDateRange(\n selector: string,\n start: Date | string,\n end: Date | string\n): Promise<void> {\n await fillGroup('fillDateRange', selector, start, 0);\n await fillGroup('fillDateRange', selector, end, 1);\n}\n\nfunction clockHour(hours: number, segment: HTMLElement): number {\n const min = Number(segment.getAttribute('aria-valuemin'));\n const max = Number(segment.getAttribute('aria-valuemax'));\n if (max === 12) return hours % 12 || 12;\n if (max === 11) return hours % 12;\n if (min === 1) return hours || 24;\n return hours;\n}\n\n/**\n * AM/PM is typed by a letter that depends on the locale, so it is stepped\n * instead: ArrowUp fills an empty segment and toggles a filled one.\n */\nasync function setDayPeriod(segment: HTMLElement, value: 0 | 1): Promise<void> {\n await focus(segment);\n for (let i = 0; i < 2; i++) {\n if (segment.getAttribute('aria-valuenow') === String(value)) return;\n await triggerKeyEvent(segment, 'keydown', 'ArrowUp');\n }\n}\n\n/**\n * Reuses the component's own parser rather than restating the wire format, so\n * the helper cannot drift from what `@value` actually accepts -- but turns a\n * refusal into a thrown error, since a test helper handed a bad date should\n * say so rather than quietly fill nothing.\n */\nfunction asDate(functionName: string, value: Date | string): Date {\n const parsed = parseDate(value);\n if (!parsed) {\n throw new Error(\n `You called \"${functionName}\" with \"${String(value)}\", which is neither a Date nor a yyyy-MM-dd or yyyy-MM-ddTHH:mm string.`\n );\n }\n\n return parsed;\n}\n\nasync function fillGroup(\n functionName: string,\n selector: string,\n value: Date | string,\n which: 0 | 1\n): Promise<void> {\n const container = document.querySelector(selector);\n if (!container) {\n throw new Error(\n `You called \"${functionName}('${selector}', ...)\" but no element was found using selector \"${selector}\".`\n );\n }\n\n const group = container.querySelectorAll('[data-part=\"group\"]')[which];\n\n if (!group) {\n // Far and away the likeliest cause: the field is on the button-trigger\n // path, where there is nothing to type into at all.\n const hasButtonTrigger = container.querySelector('[data-part=\"input\"]');\n throw new Error(\n hasButtonTrigger\n ? `You called \"${functionName}('${selector}', ...)\" on a date field rendering its button trigger, which cannot be typed into. Drop @isEditable={{false}}, or click the trigger and pick from the calendar.`\n : `You called \"${functionName}('${selector}', ...)\" but found no date segments inside \"${selector}\".`\n );\n }\n\n const date = asDate(functionName, value);\n const pad = (n: number, width = 2): string => String(n).padStart(width, '0');\n const digits: Record<string, string> = {\n year: pad(date.getFullYear(), 4),\n month: pad(date.getMonth() + 1),\n day: pad(date.getDate()),\n minute: pad(date.getMinutes())\n };\n\n for (const segment of group.querySelectorAll('[data-part=\"segment\"]')) {\n const element = segment as HTMLElement;\n const type = element.dataset['type'];\n\n if (type === 'dayPeriod') {\n await setDayPeriod(element, date.getHours() < 12 ? 0 : 1);\n continue;\n }\n\n // The hour goes in as the field's own clock counts it, which its\n // spinbutton bounds give away: 1-12 or 0-11 for AM/PM, 0-23 or 1-24 not.\n const run =\n type === 'hour'\n ? pad(clockHour(date.getHours(), element))\n : type\n ? digits[type]\n : undefined;\n if (!run) continue;\n\n await focus(element);\n for (const digit of run) {\n await triggerKeyEvent(element, 'keydown', digit);\n }\n }\n}\n"],"names":["DEPRECATIONS","WeakMap","getDeprecationsForContext","context","TypeError","deprecations","get","Array","isArray","set","URLSearchParams","queryParams","document","location","search","substring","disabledDeprecations","debugDeprecations","registerDeprecationHandler","message","options","next","includes","id","apply","WARNINGS","getWarningsForContext","warnings","disabledWarnings","debugWarnings","registerWarnHandler","hasEmberVersion","major","minor","numbers","VERSION","split","Error","actualMajor","parseInt","actualMinor","debugInfoHelpers","Set","PENDING_AJAX_REQUESTS","PENDING_TEST_WAITERS","SCHEDULED_ASYNC","SCHEDULED_AUTORUN","backburnerDebugInfoAvailable","_backburner","getDebugInfo","DEBUG","TestDebugInfo","_settledState","_debugInfo","_summaryInfo","undefined","constructor","settledState","debugInfo","summary","autorunStackTrace","autorun","stack","pendingTimersCount","timers","length","hasPendingTimers","pendingTimersStackTraces","map","timer","pendingScheduledQueueItemCount","instanceStack","filter","isNotNullable","reduce","total","item","Object","values","forEach","queueItems","pendingScheduledQueueItemStackTraces","stacks","deferredActionQueues","queueItem","push","hasPendingTestWaiters","pendingTestWaiterInfo","getPendingWaiterState","toConsole","_console","console","hasPendingRequests","log","hasPendingLegacyWaiters","keys","waiters","waiterName","waiterDebugInfo","group","label","groupEnd","timerStack","scheduleQueueItemStack","hasRunLoop","helper","_formatCount","title","count","value","helperName","target","args","loggingEnabled","elementToString","Boolean","join","indexOf","el","desc","NodeList","prototype","slice","call","HTMLElement","SVGElement","String","tagName","toLowerCase","className","SVGAnimatedString","replace","attributes","attr","name","selectOptionByKey","selectSelector","key","changeOption","toggleOptionByKey","functionName","toggle","container","querySelector","select","option","selected","triggerEvent","ownParts","root","part","querySelectorAll","node","parentElement","hasAttribute","fillDate","selector","fillGroup","fillDateRange","start","end","clockHour","hours","segment","min","Number","getAttribute","max","setDayPeriod","focus","i","triggerKeyEvent","asDate","parsed","parseDate","which","hasButtonTrigger","date","pad","n","width","padStart","digits","year","getFullYear","month","getMonth","day","getDate","minute","getMinutes","element","type","dataset","getHours","run","digit"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkBA,MAAMA,YAAY,GAAG,IAAIC,OAAO,EAA0C;;AAE1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,yBAAyBA,CACvCC,OAAoB,EACO;EAC3B,IAAI,CAACA,OAAO,EAAE;AACZ,IAAA,MAAM,IAAIC,SAAS,CACjB,CAAA,+EAAA,EAAkFD,OAAO,GAC3F,CAAC;AACH,EAAA;AAEA,EAAA,IAAIE,YAAY,GAAGL,YAAY,CAACM,GAAG,CAACH,OAAO,CAAC;AAE5C,EAAA,IAAI,CAACI,KAAK,CAACC,OAAO,CAACH,YAAY,CAAC,EAAE;AAChCA,IAAAA,YAAY,GAAG,EAAE;AACjBL,IAAAA,YAAY,CAACS,GAAG,CAACN,OAAO,EAAEE,YAAY,CAAC;AACzC,EAAA;AAEA,EAAA,OAAOA,YAAY;AACrB;;AAqCA;AACA;AACA;AACA,IAAI,OAAOK,eAAe,KAAK,WAAW,EAAE;AAC1C,EAAA,MAAMC,WAAW,GAAG,IAAID,eAAe,CACrCE,QAAQ,CAACC,QAAQ,CAACC,MAAM,CAACC,SAAS,CAAC,CAAC,CACtC,CAAC;AACD,EAAA,MAAMC,oBAAoB,GAAGL,WAAW,CAACL,GAAG,CAAC,sBAAsB,CAAC;AACpE,EAAA,MAAMW,iBAAiB,GAAGN,WAAW,CAACL,GAAG,CAAC,mBAAmB,CAAC;;AAE9D;AACA;AACA,EAAA,IAAIU,oBAAoB,EAAE;AACxBE,IAAAA,0BAA0B,CA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AM,CAACU,IAAI,CAAC,GACZzI,SAAS;IACjB,IAAI,CAAC4I,GAAG,EAAE;IAEV,MAAM1B,KAAK,CAACsB,OAAO,CAAC;AACpB,IAAA,KAAK,MAAMK,KAAK,IAAID,GAAG,EAAE;AACvB,MAAA,MAAMxB,eAAe,CAACoB,OAAO,EAAE,SAAS,EAAEK,KAAK,CAAC;AAClD,IAAA;AACF,EAAA;AACF;;","x_google_ignoreList":[0,1,2,3,4,5]}
|
package/dist/utils/filter.js
CHANGED
|
@@ -162,5 +162,36 @@ function filterAndRankItems(items, query, labelFor, filter = defaultFilter) {
|
|
|
162
162
|
return matched.map(entry => entry.item);
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
|
|
165
|
+
/**
|
|
166
|
+
* Cap `items` at the first `limit`, for rendering.
|
|
167
|
+
*
|
|
168
|
+
* A long list is cheap to filter but expensive to render: every option is DOM
|
|
169
|
+
* that has to be built, and rebuilt as the matches change on each keystroke.
|
|
170
|
+
* Capping what is rendered keeps that cost proportional to `limit` instead of
|
|
171
|
+
* to `items`. It is meant for lists the user narrows by typing, where the
|
|
172
|
+
* options past the cap are still reachable through the query.
|
|
173
|
+
*
|
|
174
|
+
* Items `isKept` accepts are rendered even past the cap, in their place in
|
|
175
|
+
* `items`, so a cap never hides the current selection. That is why the result
|
|
176
|
+
* can be longer than `limit`.
|
|
177
|
+
*
|
|
178
|
+
* Without a `limit`, or when `items` already fits, `items` is returned as is.
|
|
179
|
+
*
|
|
180
|
+
* @param items - The items to cap, already filtered and ranked.
|
|
181
|
+
* @param limit - The most items to render.
|
|
182
|
+
* @param isKept - Items to render whatever their position.
|
|
183
|
+
*/
|
|
184
|
+
function limitItems(items, limit, isKept = () => false) {
|
|
185
|
+
if (!items || limit === undefined || items.length <= limit) {
|
|
186
|
+
return items;
|
|
187
|
+
}
|
|
188
|
+
return items.filter((item, index) => index < limit || isKept(item));
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Yielded to the `displayLimitContent` block of a `Select` or `Autocomplete`
|
|
193
|
+
* whose `@displayLimit` left options out.
|
|
194
|
+
*/
|
|
195
|
+
|
|
196
|
+
export { DEFAULT_MATCH_THRESHOLD, SECONDARY_FIELD_WEIGHT, createFuzzyFilter, defaultFilter, filterAndRankItems, limitItems };
|
|
166
197
|
//# sourceMappingURL=filter.js.map
|
package/dist/utils/filter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.js","sources":["../../src/utils/filter.ts"],"sourcesContent":["import fuzzysort from 'fuzzysort';\n\n/**\n * Score or match an item against the current input text.\n *\n * Return a **number** to rank: higher sorts first and `0` (or any value at or\n * below it) means no match. Return a **boolean** to match without expressing\n * relevance — `true` normalizes to a full match (`1`) and `false` to `0`.\n *\n * Because a boolean filter scores every match identically, and the sort is\n * stable, a purely boolean filter leaves the order of `@items` untouched. That\n * is exactly the behavior filters had before scoring existed.\n */\nexport type FilterFn = (\n itemValue: string,\n inputValue: string\n) => boolean | number;\n\n/**\n * Guarantees a match is distinguishable from no match. `0` is load-bearing in\n * {@link FilterFn}, so a value that must count as a match is never allowed to\n * land exactly on it.\n */\nconst MIN_MATCH_SCORE = Number.EPSILON;\n\n/**\n * Scores at or above this count as a match; anything below is discarded.\n *\n * This is fuzzysort's own default: `fuzzysort.go()` applies `threshold: 0.5`,\n * while `fuzzysort.single()` — which this filter uses, because it scores one\n * item at a time — applies none at all. Taking the threshold on ourselves keeps\n * us at the library's own quality bar rather than below it.\n *\n * It matters because fuzzy matching is *looser* than the `includes()` filter\n * this replaced, and fuzzysort cannot distinguish a useful abbreviation\n * (`btn` -> `Button`) from noise (`sa` -> `Spain`) — both are scattered mid-word\n * subsequences scoring ~0.32-0.36. Without a threshold, a two-letter query\n * against a country list returns two to three times as many rows as before,\n * most of them baffling.\n *\n * A threshold alone is not enough, though: genuine substring matches can score\n * *below* it (`ma` -> `Guatemala` is 0.500, `an` -> `Switzerland` is 0.447), so\n * see the substring floor in {@link createFuzzyFilter}.\n */\nexport const DEFAULT_MATCH_THRESHOLD = 0.5;\n\nexport interface FuzzyFilterOptions {\n /**\n * Minimum score to count as a match, between `0` and `1`. Lower it to trade\n * precision for recall — at `0`, `btn` matches `Button`, and `sa` also\n * matches `Spain`.\n *\n * Substring matches are never dropped regardless of this value.\n *\n * @defaultValue {@link DEFAULT_MATCH_THRESHOLD}\n */\n threshold?: number;\n}\n\n/**\n * Build a relevance filter backed by fuzzysort.\n *\n * The filter is a strict superset of a case-insensitive \"contains\" match: every\n * item `includes()` would have matched still matches, scored at no less than\n * the threshold, so raising the threshold can never make a result disappear\n * that used to be there. On top of that it matches acronyms and initialisms\n * (`bg` -> `ButtonGroup`, `nz` -> `New Zealand`) and orders everything by\n * relevance instead of by source position.\n *\n * @param options - See {@link FuzzyFilterOptions}.\n */\nexport function createFuzzyFilter(\n options: FuzzyFilterOptions = {}\n): (itemValue: string, inputValue: string) => number {\n const threshold = options.threshold ?? DEFAULT_MATCH_THRESHOLD;\n\n // The query is the same for every candidate in a pass, so its lowercased\n // form is memoized rather than rebuilt once per item.\n let lastQuery: string | undefined;\n let lastQueryLower = '';\n\n return function fuzzyFilter(itemValue: string, inputValue: string): number {\n // A blank query matches everything. fuzzysort returns null for a blank or\n // whitespace-only needle, which would otherwise read as \"no match\" and\n // empty the list rather than leaving it alone.\n if (!inputValue.trim()) {\n return 1;\n }\n\n if (!itemValue) {\n return 0;\n }\n\n if (inputValue !== lastQuery) {\n lastQuery = inputValue;\n lastQueryLower = inputValue.toLowerCase();\n }\n\n const score = fuzzysort.single(inputValue, itemValue)?.score ?? 0;\n\n // The substring floor. This is what makes the filter a superset of the old\n // `includes()` default: a substring match is always a match, whatever it\n // scored, so the threshold only ever removes results that are new.\n if (itemValue.toLowerCase().includes(lastQueryLower)) {\n return Math.max(score, threshold, MIN_MATCH_SCORE);\n }\n\n return score >= threshold ? Math.max(score, MIN_MATCH_SCORE) : 0;\n };\n}\n\n/**\n * The default relevance filter: {@link createFuzzyFilter} at\n * {@link DEFAULT_MATCH_THRESHOLD}.\n */\nexport const defaultFilter = createFuzzyFilter();\n\n/**\n * Weight applied to every field after the first.\n *\n * Fields are combined by weighted **max**, never by sum: summing lets three\n * weak field hits outrank one exact hit on the primary field.\n */\nexport const SECONDARY_FIELD_WEIGHT = 0.6;\n\n/**\n * Normalize whatever a {@link FilterFn} returned into a score.\n *\n * `true` is a full match rather than a zero one — without this, a filter that\n * mixed booleans and numbers would sort its `true` results below every numeric\n * match, including the very weakest.\n *\n * `NaN` falls through to `0`, since no comparison with it is true.\n */\nfunction toScore(result: boolean | number): number {\n if (typeof result === 'number') {\n return result > 0 ? result : 0;\n }\n\n return result ? 1 : 0;\n}\n\n/** Weighted max across fields; see {@link SECONDARY_FIELD_WEIGHT}. */\nfunction scoreFields(\n values: string | string[],\n query: string,\n filter: FilterFn\n): number {\n if (typeof values === 'string') {\n return toScore(filter(values, query));\n }\n\n let best = 0;\n\n values.forEach((value, index) => {\n const weight = index === 0 ? 1 : SECONDARY_FIELD_WEIGHT;\n best = Math.max(best, toScore(filter(value, query)) * weight);\n });\n\n return best;\n}\n\n/**\n * Filter `items` by `query`, ordering them by relevance.\n *\n * A blank query returns the items untouched, so a caller can render a default\n * list (recents, suggestions) without special-casing it.\n *\n * The sort is stable, so items scoring equally keep the order they were given.\n * A filter that only ever returns booleans scores every match identically and\n * therefore preserves the order of `items` exactly.\n *\n * @param items - The items to filter.\n * @param query - The user's input text.\n * @param labelFor - Extracts the text to match against. Return an array to\n * search several fields; the first is the primary one and the rest are\n * weighted by {@link SECONDARY_FIELD_WEIGHT}, combined by max.\n * @param filter - Scores one item; defaults to {@link defaultFilter}.\n */\nexport function filterAndRankItems<T>(\n items: T[] | undefined,\n query: string,\n labelFor: (item: T) => string | string[],\n filter: FilterFn = defaultFilter\n): T[] | undefined {\n if (!items || !query.trim()) {\n return items;\n }\n\n const matched: { item: T; score: number }[] = [];\n\n for (const item of items) {\n const score = scoreFields(labelFor(item), query, filter);\n\n if (score > 0) {\n matched.push({ item, score });\n }\n }\n\n matched.sort((a, b) => b.score - a.score);\n\n return matched.map((entry) => entry.item);\n}\n"],"names":["MIN_MATCH_SCORE","Number","EPSILON","DEFAULT_MATCH_THRESHOLD","createFuzzyFilter","options","threshold","lastQuery","lastQueryLower","fuzzyFilter","itemValue","inputValue","trim","toLowerCase","score","fuzzysort","single","includes","Math","max","defaultFilter","SECONDARY_FIELD_WEIGHT","toScore","result","scoreFields","values","query","filter","best","forEach","value","index","weight","filterAndRankItems","items","labelFor","matched","item","push","sort","a","b","map","entry"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA,MAAMA,eAAe,GAAGC,MAAM,CAACC,OAAO;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,uBAAuB,GAAG;AAevC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,iBAAiBA,CAC/BC,OAA2B,GAAG,EAAE,EACmB;AACnD,EAAA,MAAMC,SAAS,GAAGD,OAAO,CAACC,SAAS,IAAIH,uBAAuB;;AAE9D;AACA;AACA,EAAA,IAAII,SAA6B;EACjC,IAAIC,cAAc,GAAG,EAAE;AAEvB,EAAA,OAAO,SAASC,WAAWA,CAACC,SAAiB,EAAEC,UAAkB,EAAU;AACzE;AACA;AACA;AACA,IAAA,IAAI,CAACA,UAAU,CAACC,IAAI,EAAE,EAAE;AACtB,MAAA,OAAO,CAAC;AACV,IAAA;IAEA,IAAI,CAACF,SAAS,EAAE;AACd,MAAA,OAAO,CAAC;AACV,IAAA;IAEA,IAAIC,UAAU,KAAKJ,SAAS,EAAE;AAC5BA,MAAAA,SAAS,GAAGI,UAAU;AACtBH,MAAAA,cAAc,GAAGG,UAAU,CAACE,WAAW,EAAE;AAC3C,I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EAAEN,OAAO,CAACK,MAAM,CAACG,KAAK,EAAEJ,KAAK,CAAC,CAAC,GAAGM,MAAM,CAAC;AAC/D,EAAA,CAAC,CAAC;AAEF,EAAA,OAAOJ,IAAI;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASK,kBAAkBA,CAChCC,KAAsB,EACtBR,KAAa,EACbS,QAAwC,EACxCR,MAAgB,GAAGP,aAAa,EACf;EACjB,IAAI,CAACc,KAAK,IAAI,CAACR,KAAK,CAACd,IAAI,EAAE,EAAE;AAC3B,IAAA,OAAOsB,KAAK;AACd,EAAA;EAEA,MAAME,OAAqC,GAAG,EAAE;AAEhD,EAAA,KAAK,MAAMC,IAAI,IAAIH,KAAK,EAAE;AACxB,IAAA,MAAMpB,KAAK,GAAGU,WAAW,CAACW,QAAQ,CAACE,IAAI,CAAC,EAAEX,KAAK,EAAEC,MAAM,CAAC;IAExD,IAAIb,KAAK,GAAG,CAAC,EAAE;MACbsB,OAAO,CAACE,IAAI,CAAC;QAAED,IAAI;AAAEvB,QAAAA;AAAM,OAAC,CAAC;AAC/B,IAAA;AACF,EAAA;AAEAsB,EAAAA,OAAO,CAACG,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKA,CAAC,CAAC3B,KAAK,GAAG0B,CAAC,CAAC1B,KAAK,CAAC;EAEzC,OAAOsB,OAAO,CAACM,GAAG,CAAEC,KAAK,IAAKA,KAAK,CAACN,IAAI,CAAC;AAC3C;;"}
|
|
1
|
+
{"version":3,"file":"filter.js","sources":["../../src/utils/filter.ts"],"sourcesContent":["import fuzzysort from 'fuzzysort';\n\n/**\n * Score or match an item against the current input text.\n *\n * Return a **number** to rank: higher sorts first and `0` (or any value at or\n * below it) means no match. Return a **boolean** to match without expressing\n * relevance — `true` normalizes to a full match (`1`) and `false` to `0`.\n *\n * Because a boolean filter scores every match identically, and the sort is\n * stable, a purely boolean filter leaves the order of `@items` untouched. That\n * is exactly the behavior filters had before scoring existed.\n */\nexport type FilterFn = (\n itemValue: string,\n inputValue: string\n) => boolean | number;\n\n/**\n * Guarantees a match is distinguishable from no match. `0` is load-bearing in\n * {@link FilterFn}, so a value that must count as a match is never allowed to\n * land exactly on it.\n */\nconst MIN_MATCH_SCORE = Number.EPSILON;\n\n/**\n * Scores at or above this count as a match; anything below is discarded.\n *\n * This is fuzzysort's own default: `fuzzysort.go()` applies `threshold: 0.5`,\n * while `fuzzysort.single()` — which this filter uses, because it scores one\n * item at a time — applies none at all. Taking the threshold on ourselves keeps\n * us at the library's own quality bar rather than below it.\n *\n * It matters because fuzzy matching is *looser* than the `includes()` filter\n * this replaced, and fuzzysort cannot distinguish a useful abbreviation\n * (`btn` -> `Button`) from noise (`sa` -> `Spain`) — both are scattered mid-word\n * subsequences scoring ~0.32-0.36. Without a threshold, a two-letter query\n * against a country list returns two to three times as many rows as before,\n * most of them baffling.\n *\n * A threshold alone is not enough, though: genuine substring matches can score\n * *below* it (`ma` -> `Guatemala` is 0.500, `an` -> `Switzerland` is 0.447), so\n * see the substring floor in {@link createFuzzyFilter}.\n */\nexport const DEFAULT_MATCH_THRESHOLD = 0.5;\n\nexport interface FuzzyFilterOptions {\n /**\n * Minimum score to count as a match, between `0` and `1`. Lower it to trade\n * precision for recall — at `0`, `btn` matches `Button`, and `sa` also\n * matches `Spain`.\n *\n * Substring matches are never dropped regardless of this value.\n *\n * @defaultValue {@link DEFAULT_MATCH_THRESHOLD}\n */\n threshold?: number;\n}\n\n/**\n * Build a relevance filter backed by fuzzysort.\n *\n * The filter is a strict superset of a case-insensitive \"contains\" match: every\n * item `includes()` would have matched still matches, scored at no less than\n * the threshold, so raising the threshold can never make a result disappear\n * that used to be there. On top of that it matches acronyms and initialisms\n * (`bg` -> `ButtonGroup`, `nz` -> `New Zealand`) and orders everything by\n * relevance instead of by source position.\n *\n * @param options - See {@link FuzzyFilterOptions}.\n */\nexport function createFuzzyFilter(\n options: FuzzyFilterOptions = {}\n): (itemValue: string, inputValue: string) => number {\n const threshold = options.threshold ?? DEFAULT_MATCH_THRESHOLD;\n\n // The query is the same for every candidate in a pass, so its lowercased\n // form is memoized rather than rebuilt once per item.\n let lastQuery: string | undefined;\n let lastQueryLower = '';\n\n return function fuzzyFilter(itemValue: string, inputValue: string): number {\n // A blank query matches everything. fuzzysort returns null for a blank or\n // whitespace-only needle, which would otherwise read as \"no match\" and\n // empty the list rather than leaving it alone.\n if (!inputValue.trim()) {\n return 1;\n }\n\n if (!itemValue) {\n return 0;\n }\n\n if (inputValue !== lastQuery) {\n lastQuery = inputValue;\n lastQueryLower = inputValue.toLowerCase();\n }\n\n const score = fuzzysort.single(inputValue, itemValue)?.score ?? 0;\n\n // The substring floor. This is what makes the filter a superset of the old\n // `includes()` default: a substring match is always a match, whatever it\n // scored, so the threshold only ever removes results that are new.\n if (itemValue.toLowerCase().includes(lastQueryLower)) {\n return Math.max(score, threshold, MIN_MATCH_SCORE);\n }\n\n return score >= threshold ? Math.max(score, MIN_MATCH_SCORE) : 0;\n };\n}\n\n/**\n * The default relevance filter: {@link createFuzzyFilter} at\n * {@link DEFAULT_MATCH_THRESHOLD}.\n */\nexport const defaultFilter = createFuzzyFilter();\n\n/**\n * Weight applied to every field after the first.\n *\n * Fields are combined by weighted **max**, never by sum: summing lets three\n * weak field hits outrank one exact hit on the primary field.\n */\nexport const SECONDARY_FIELD_WEIGHT = 0.6;\n\n/**\n * Normalize whatever a {@link FilterFn} returned into a score.\n *\n * `true` is a full match rather than a zero one — without this, a filter that\n * mixed booleans and numbers would sort its `true` results below every numeric\n * match, including the very weakest.\n *\n * `NaN` falls through to `0`, since no comparison with it is true.\n */\nfunction toScore(result: boolean | number): number {\n if (typeof result === 'number') {\n return result > 0 ? result : 0;\n }\n\n return result ? 1 : 0;\n}\n\n/** Weighted max across fields; see {@link SECONDARY_FIELD_WEIGHT}. */\nfunction scoreFields(\n values: string | string[],\n query: string,\n filter: FilterFn\n): number {\n if (typeof values === 'string') {\n return toScore(filter(values, query));\n }\n\n let best = 0;\n\n values.forEach((value, index) => {\n const weight = index === 0 ? 1 : SECONDARY_FIELD_WEIGHT;\n best = Math.max(best, toScore(filter(value, query)) * weight);\n });\n\n return best;\n}\n\n/**\n * Filter `items` by `query`, ordering them by relevance.\n *\n * A blank query returns the items untouched, so a caller can render a default\n * list (recents, suggestions) without special-casing it.\n *\n * The sort is stable, so items scoring equally keep the order they were given.\n * A filter that only ever returns booleans scores every match identically and\n * therefore preserves the order of `items` exactly.\n *\n * @param items - The items to filter.\n * @param query - The user's input text.\n * @param labelFor - Extracts the text to match against. Return an array to\n * search several fields; the first is the primary one and the rest are\n * weighted by {@link SECONDARY_FIELD_WEIGHT}, combined by max.\n * @param filter - Scores one item; defaults to {@link defaultFilter}.\n */\nexport function filterAndRankItems<T>(\n items: T[] | undefined,\n query: string,\n labelFor: (item: T) => string | string[],\n filter: FilterFn = defaultFilter\n): T[] | undefined {\n if (!items || !query.trim()) {\n return items;\n }\n\n const matched: { item: T; score: number }[] = [];\n\n for (const item of items) {\n const score = scoreFields(labelFor(item), query, filter);\n\n if (score > 0) {\n matched.push({ item, score });\n }\n }\n\n matched.sort((a, b) => b.score - a.score);\n\n return matched.map((entry) => entry.item);\n}\n\n/**\n * Cap `items` at the first `limit`, for rendering.\n *\n * A long list is cheap to filter but expensive to render: every option is DOM\n * that has to be built, and rebuilt as the matches change on each keystroke.\n * Capping what is rendered keeps that cost proportional to `limit` instead of\n * to `items`. It is meant for lists the user narrows by typing, where the\n * options past the cap are still reachable through the query.\n *\n * Items `isKept` accepts are rendered even past the cap, in their place in\n * `items`, so a cap never hides the current selection. That is why the result\n * can be longer than `limit`.\n *\n * Without a `limit`, or when `items` already fits, `items` is returned as is.\n *\n * @param items - The items to cap, already filtered and ranked.\n * @param limit - The most items to render.\n * @param isKept - Items to render whatever their position.\n */\nexport function limitItems<T>(\n items: T[] | undefined,\n limit: number | undefined,\n isKept: (item: T) => boolean = () => false\n): T[] | undefined {\n if (!items || limit === undefined || items.length <= limit) {\n return items;\n }\n\n return items.filter((item, index) => index < limit || isKept(item));\n}\n\n/**\n * Yielded to the `displayLimitContent` block of a `Select` or `Autocomplete`\n * whose `@displayLimit` left options out.\n */\nexport interface DisplayLimitContentArgs {\n /** How many options are rendered. */\n shown: number;\n /** How many options match, rendered or not. */\n total: number;\n}\n"],"names":["MIN_MATCH_SCORE","Number","EPSILON","DEFAULT_MATCH_THRESHOLD","createFuzzyFilter","options","threshold","lastQuery","lastQueryLower","fuzzyFilter","itemValue","inputValue","trim","toLowerCase","score","fuzzysort","single","includes","Math","max","defaultFilter","SECONDARY_FIELD_WEIGHT","toScore","result","scoreFields","values","query","filter","best","forEach","value","index","weight","filterAndRankItems","items","labelFor","matched","item","push","sort","a","b","map","entry","limitItems","limit","isKept","undefined","length"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA,MAAMA,eAAe,GAAGC,MAAM,CAACC,OAAO;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,uBAAuB,GAAG;AAevC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,iBAAiBA,CAC/BC,OAA2B,GAAG,EAAE,EACmB;AACnD,EAAA,MAAMC,SAAS,GAAGD,OAAO,CAACC,SAAS,IAAIH,uBAAuB;;AAE9D;AACA;AACA,EAAA,IAAII,SAA6B;EACjC,IAAIC,cAAc,GAAG,EAAE;AAEvB,EAAA,OAAO,SAASC,WAAWA,CAACC,SAAiB,EAAEC,UAAkB,EAAU;AACzE;AACA;AACA;AACA,IAAA,IAAI,CAACA,UAAU,CAACC,IAAI,EAAE,EAAE;AACtB,MAAA,OAAO,CAAC;AACV,IAAA;IAEA,IAAI,CAACF,SAAS,EAAE;AACd,MAA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CACxBV,KAAsB,EACtBW,KAAyB,EACzBC,MAA4B,GAAGA,MAAM,KAAK,EACzB;AACjB,EAAA,IAAI,CAACZ,KAAK,IAAIW,KAAK,KAAKE,SAAS,IAAIb,KAAK,CAACc,MAAM,IAAIH,KAAK,EAAE;AAC1D,IAAA,OAAOX,KAAK;AACd,EAAA;AAEA,EAAA,OAAOA,KAAK,CAACP,MAAM,CAAC,CAACU,IAAI,EAAEN,KAAK,KAAKA,KAAK,GAAGc,KAAK,IAAIC,MAAM,CAACT,IAAI,CAAC,CAAC;AACrE;;AAEA;AACA;AACA;AACA;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "frontile",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.6",
|
|
4
4
|
"description": "Component Library for Ember Octane apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"@embroider/addon-shim": "^1.10.3",
|
|
95
95
|
"@embroider/macros": "^1.21.1",
|
|
96
96
|
"@floating-ui/dom": "^1.8.0",
|
|
97
|
-
"@frontile/theme": "^0.18.
|
|
97
|
+
"@frontile/theme": "^0.18.6",
|
|
98
98
|
"@glint/template": "^1.9.0",
|
|
99
99
|
"@universal-ember/table": "^4.0.0",
|
|
100
100
|
"date-fns": "^4.4.0",
|
|
@@ -152,5 +152,5 @@
|
|
|
152
152
|
"./services/notifications.js": "./dist/_app_/services/notifications.js"
|
|
153
153
|
}
|
|
154
154
|
},
|
|
155
|
-
"gitHead": "
|
|
155
|
+
"gitHead": "0ac9ce6c32a419ef622230745f3aff8ed8fea681"
|
|
156
156
|
}
|