mirror of
https://github.com/ae-utbm/sith.git
synced 2026-02-15 20:08:17 +00:00
update BiomeJS
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { Product } from "#counter:counter/types";
|
||||
import type { Product } from "#counter:counter/types.ts";
|
||||
|
||||
export class BasketItem {
|
||||
quantity: number;
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { AjaxSelect } from "#core:core/components/ajax-select-base";
|
||||
import { registerComponent } from "#core:utils/web-components";
|
||||
import type { TomOption } from "tom-select/dist/types/types";
|
||||
import type { escape_html } from "tom-select/dist/types/utils";
|
||||
import { AjaxSelect } from "#core:core/components/ajax-select-base.ts";
|
||||
import { registerComponent } from "#core:utils/web-components.ts";
|
||||
import {
|
||||
type CounterSchema,
|
||||
type ProductTypeSchema,
|
||||
type SimpleProductSchema,
|
||||
counterSearchCounter,
|
||||
type ProductTypeSchema,
|
||||
productSearchProducts,
|
||||
producttypeFetchAll,
|
||||
type SimpleProductSchema,
|
||||
} from "#openapi";
|
||||
|
||||
@registerComponent("product-ajax-select")
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { AutoCompleteSelectBase } from "#core:core/components/ajax-select-base";
|
||||
import { registerComponent } from "#core:utils/web-components";
|
||||
import type { RecursivePartial, TomSettings } from "tom-select/dist/types/types";
|
||||
import { AutoCompleteSelectBase } from "#core:core/components/ajax-select-base.ts";
|
||||
import { registerComponent } from "#core:utils/web-components.ts";
|
||||
|
||||
const productParsingRegex = /^(\d+x)?(.*)/i;
|
||||
const codeParsingRegex = / \((\w+)\)$/;
|
||||
|
||||
function parseProduct(query: string): [number, string] {
|
||||
const parsed = productParsingRegex.exec(query);
|
||||
return [Number.parseInt(parsed[1] || "1"), parsed[2]];
|
||||
return [Number.parseInt(parsed[1] || "1", 10), parsed[2]];
|
||||
}
|
||||
|
||||
@registerComponent("counter-product-select")
|
||||
@@ -80,9 +80,9 @@ export class CounterProductSelect extends AutoCompleteSelectBase {
|
||||
// We need to manually set weights or it results on an inconsistent
|
||||
// behavior between production and development environment
|
||||
searchField: [
|
||||
// @ts-ignore documentation says it's fine, specified type is wrong
|
||||
// @ts-expect-error documentation says it's fine, specified type is wrong
|
||||
{ field: "code", weight: 2 },
|
||||
// @ts-ignore documentation says it's fine, specified type is wrong
|
||||
// @ts-expect-error documentation says it's fine, specified type is wrong
|
||||
{ field: "text", weight: 0.5 },
|
||||
],
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { AlertMessage } from "#core:utils/alert-message";
|
||||
import { BasketItem } from "#counter:counter/basket";
|
||||
import type { CounterConfig, ErrorMessage } from "#counter:counter/types";
|
||||
import { AlertMessage } from "#core:utils/alert-message.ts";
|
||||
import { BasketItem } from "#counter:counter/basket.ts";
|
||||
import type { CounterConfig, ErrorMessage } from "#counter:counter/types.ts";
|
||||
import type { CounterProductSelect } from "./components/counter-product-select-index.ts";
|
||||
|
||||
document.addEventListener("alpine:init", () => {
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
import { paginated } from "#core:utils/api";
|
||||
import { csv } from "#core:utils/csv";
|
||||
import { History, getCurrentUrlParams, updateQueryString } from "#core:utils/history";
|
||||
import type { NestedKeyOf } from "#core:utils/types";
|
||||
import { showSaveFilePicker } from "native-file-system-adapter";
|
||||
import type TomSelect from "tom-select";
|
||||
import { paginated } from "#core:utils/api.ts";
|
||||
import { csv } from "#core:utils/csv.ts";
|
||||
import {
|
||||
getCurrentUrlParams,
|
||||
History,
|
||||
updateQueryString,
|
||||
} from "#core:utils/history.ts";
|
||||
import type { NestedKeyOf } from "#core:utils/types.ts";
|
||||
import {
|
||||
type ProductSchema,
|
||||
type ProductSearchProductsDetailedData,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AlertMessage } from "#core:utils/alert-message";
|
||||
import Alpine from "alpinejs";
|
||||
import { AlertMessage } from "#core:utils/alert-message.ts";
|
||||
import { producttypeReorder } from "#openapi";
|
||||
|
||||
document.addEventListener("alpine:init", () => {
|
||||
@@ -22,7 +22,7 @@ document.addEventListener("alpine:init", () => {
|
||||
const productTypes = this.$refs.productTypes
|
||||
.childNodes as NodeListOf<HTMLLIElement>;
|
||||
const getId = (elem: HTMLLIElement) =>
|
||||
Number.parseInt(elem.getAttribute("x-sort:item"));
|
||||
Number.parseInt(elem.getAttribute("x-sort:item"), 10);
|
||||
const query =
|
||||
newPosition === 0
|
||||
? { above: getId(productTypes.item(1)) }
|
||||
|
||||
Reference in New Issue
Block a user