@adyen/bento-vue2 1.77.0 → 1.78.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/index.d.ts +137 -98
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/checkbox-group.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/index.css +1 -0
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/radio-group.css +1 -1
- package/dist/assets/selection-card-group.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/checkbox-group.HqNbZx2y.js +141 -0
- package/dist/chunks/checkbox-group.HqNbZx2y.js.map +1 -0
- package/dist/chunks/{checkbox.itbBlXev.js → checkbox.CqF5Dank.js} +18 -18
- package/dist/chunks/{checkbox.itbBlXev.js.map → checkbox.CqF5Dank.js.map} +1 -1
- package/dist/chunks/{data-grid.B-kBw540.js → data-grid.BhwTkhfk.js} +508 -503
- package/dist/chunks/data-grid.BhwTkhfk.js.map +1 -0
- package/dist/chunks/date-range-picker.CmKA76Yu.js +898 -0
- package/dist/chunks/date-range-picker.CmKA76Yu.js.map +1 -0
- package/dist/chunks/date-range-picker.types.Ckt7zxGy.js +5 -0
- package/dist/chunks/date-range-picker.types.Ckt7zxGy.js.map +1 -0
- package/dist/chunks/es6.MoTTyETW.js.map +1 -1
- package/dist/chunks/{filter-bar.BLnSnOlj.js → filter-bar.Bj4LgjzJ.js} +5 -5
- package/dist/chunks/filter-bar.Bj4LgjzJ.js.map +1 -0
- package/dist/chunks/{header-with-views.C6Y7mAkq.js → header-with-views.D6JUlnEf.js} +2 -2
- package/dist/chunks/{header-with-views.C6Y7mAkq.js.map → header-with-views.D6JUlnEf.js.map} +1 -1
- package/dist/chunks/link.D8qpqg3W.js.map +1 -1
- package/dist/chunks/{radio-group.B8ukv-pw.js → radio-group.0JNwgkZa.js} +64 -63
- package/dist/chunks/radio-group.0JNwgkZa.js.map +1 -0
- package/dist/chunks/{rich-text-editor.DzH-Z5oi.js → rich-text-editor.NFLhgVJo.js} +2 -2
- package/dist/chunks/{rich-text-editor.DzH-Z5oi.js.map → rich-text-editor.NFLhgVJo.js.map} +1 -1
- package/dist/chunks/{selection-card-group.D4rcUyvV.js → selection-card-group.u-2Y_9o2.js} +97 -94
- package/dist/chunks/{selection-card-group.D4rcUyvV.js.map → selection-card-group.u-2Y_9o2.js.map} +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-range-picker.js +5 -4
- package/dist/date-range-picker.js.map +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/index.js +382 -357
- package/dist/index.js.map +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/styles/bento-dark.css +5 -0
- package/dist/styles/bento-light.css +5 -0
- package/dist/styles/bento.css +5 -0
- package/dist/styles/legacy.css +5 -0
- package/dist/styles/styleguide.css +5 -0
- package/dist/web-types.json +44 -16
- package/package.json +6 -6
- package/dist/chunks/checkbox-group.C3RH5Gcg.js +0 -152
- package/dist/chunks/checkbox-group.C3RH5Gcg.js.map +0 -1
- package/dist/chunks/data-grid.B-kBw540.js.map +0 -1
- package/dist/chunks/date-range-picker.BtPxkPN0.js +0 -942
- package/dist/chunks/date-range-picker.BtPxkPN0.js.map +0 -1
- package/dist/chunks/filter-bar.BLnSnOlj.js.map +0 -1
- package/dist/chunks/radio-group.B8ukv-pw.js.map +0 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/composables/use-bento-base-filter/utils/utils.ts","../src/composables/use-bento-base-filter/use-bento-base-filter.ts","../src/composables/use-form-validate/use-form.ts","../src/composables/use-bento-theme/use-bento-theme.types.ts","../src/composables/use-bento-theme/use-bento-theme.ts","../src/composables/use-bento-toast-controller/install.ts","../src/composables/use-bento-theme/install.types.ts","../src/composables/use-bento-theme/install.ts","../src/install.ts","../src/types/base-filter.ts"],"sourcesContent":["/**\n * Checks if a value is a plain object.\n *\n * @param value The value to check.\n * @returns Whether the value is a plain object.\n */\nexport const isPlainObject = (value: unknown) => {\n if (value === null || typeof value !== 'object') {\n return false;\n }\n\n return Object.prototype.toString.call(value) === '[object Object]';\n};\n\n/**\n * Checks if a value is an array.\n *\n * @param value The value to check.\n * @returns Whether the value is an array.\n */\nexport const isArray = <T>(value: T) => Array.isArray(value);\n\n/**\n * Checks if a value is empty.\n * If the value is an array, it checks if the array is empty or if all elements are empty strings.\n * If the value is not an array, it checks if the value is falsy.\n *\n * @param value The value to check.\n * @returns Whether the value is empty.\n */\nexport const isValueEmpty = <T>(value: T) =>\n isArray(value) ? (value as []).length === 0 || (value as Array<T>).every(el => el === '') : !value;\n\n/**\n * Checks if two objects are deeply equal by comparing their JSON string representations.\n *\n * @param first The first value.\n * @param second The second value.\n * @returns Whether the values are equal.\n */\nexport const isEqual = <T>(first: T, second: T) => JSON.stringify(first) === JSON.stringify(second);\n\n/**\n * Creates a deep copy of a value.\n * If the value is a plain object, it uses `JSON.parse(JSON.stringify(value))` to create a deep copy.\n * Otherwise, it returns the value as is.\n *\n * @param value The value to copy.\n * @returns The deep copied value or the original value if it's not a plain object.\n */\nexport const deepCopy = <T>(value: T) =>\n isPlainObject(value) || isArray(value) ? (JSON.parse(JSON.stringify(value)) as T) : value;\n\n/**\n * Copies the structure of a plain object, setting all values to `undefined`.\n * If the value is not a plain object, it returns `undefined`.\n *\n * @param value The object whose structure to copy.\n * @returns An object with the same keys as the input object but with all values set to `undefined`, or `undefined` if the input is not a plain object.\n */\nexport const copyStructure = <T>(value: T) =>\n isPlainObject(value) ? Object.fromEntries(Object.keys(value).map(key => [key, undefined])) : undefined;\n","import { computed, onMounted, ref, watch } from 'vue';\nimport type { Ref } from 'vue';\nimport { copyStructure, deepCopy, isEqual, isValueEmpty } from './utils';\n\n/**\n * A composable to wire the `bento-base-filter` component for the mandatory fields and events.\n *\n * @usage\n * ```vue\n * <template>\n * <bento-base-filter\n * :disable-apply-button=\"isApplyButtonDisabled\"\n * :disable-secondary-button=\"isSecondaryButtonDisabled\"\n * @ apply=\"updateFilter\"\n * @ clear=\"clearFilter(updateFilter)\"\n * @ open=\"openFilter\"\n * @ reset=\"resetFilter(updateFilter)\"\n * >\n * <!-- CONTENT HERE -->\n * </bento-base-filter>\n * </template>\n * <script>\n * import { ref } from 'vue'\n * import { useBentoBaseFilter, BentoBaseFilter, BentoBaseFilterProps } from '@adyen/bento-vue2'\n *\n * type CustomFilterValue = boolean\n * const props = defineProps<BentoBaseFilterProps<CustomFilterValue>>();\n *\n * const {\n * // Values\n * internalFilterValue,\n * isSecondaryButtonDisabled,\n * isApplyButtonDisabled,\n *\n * // Methods\n * clearFilter,\n * resetFilter,\n * openFilter,\n * } = useBentoBaseFilter<CustomFilterValue>(toRef(props, 'value'), toRef(props, 'defaultValue'));\n * </script>\n * ```\n *\n * @param appliedFilter The currently applied filter value.\n * @param defaultFilter The default filter value (if available).\n * @returns An object containing refs and functions:\n * - `internalFilterValue`: The temporary state of the filter before it's applied.\n * - `isSecondaryButtonDisabled`: `true` if the secondary (clear/reset) button should be disabled.\n * - `isApplyButtonDisabled`: `true` if the apply button should be disabled.\n * - `clearFilter`: Clears the filter to its initial or default state.\n * - `resetFilter`: Resets the filter to its default state.\n * - `openFilter`: Syncs the internal state with the applied filter.\n */\nexport function useBentoBaseFilter<T>(appliedFilter: Ref<T>, defaultFilter: Ref<T>) {\n /**\n * Handles the internal value. Kept in sync when the new value is applied\n */\n const internalFilterValue = ref<T>();\n const initialStructureOrValue = ref<T>();\n\n onMounted(() => {\n /**\n * Copy initial structure as long as the value is not \"undefined\"\n */\n if (appliedFilter.value != null) {\n initialStructureOrValue.value = copyStructure<T>(appliedFilter.value) as T;\n }\n });\n\n watch(\n () => appliedFilter.value,\n newValue => {\n internalFilterValue.value = deepCopy<T>(newValue);\n },\n { immediate: true }\n );\n\n /**\n * Indicates if the filter has a value applied (active).\n * - inactive (`true`): `appliedFilter` is empty (`undefined`) or all of its properties are empty for object values\n */\n const isFilterInactive = computed(\n () => isValueEmpty(appliedFilter.value) || isEqual<T>(appliedFilter.value, initialStructureOrValue.value)\n );\n\n /**\n * Indicates if the secondary (clear/reset) button should be disabled.\n * - disabled (`true`): No filter value is applied or `appliedFilter` value is the same as the `defaultFilter` (persistent) value\n */\n const isSecondaryButtonDisabled = computed(() =>\n defaultFilter.value != null ? isEqual<T>(defaultFilter.value, appliedFilter.value) : isFilterInactive.value\n );\n\n const isApplyButtonDisabled = computed(() => {\n const isValueUnchanged = isEqual<T>(internalFilterValue.value, appliedFilter.value);\n return isValueUnchanged || (isValueEmpty(internalFilterValue.value) && isFilterInactive.value);\n });\n\n /**\n * Clears the non-persistent filters (not used in persistent filters).\n *\n * Receives a callback to execute additional tasks required when clearing a filter\n *\n * - `object`: Sets all properties to `undefined`\n * - non-`object`: Sets to `undefined`\n * @param callback Function to be called when clearing a filter\n */\n function clearFilter(callback?: (newValue: T) => void) {\n internalFilterValue.value = deepCopy<T>(initialStructureOrValue.value);\n if (callback) {\n callback(internalFilterValue.value);\n }\n }\n\n /**\n * Resets the persistent filters (not used in non-persistent filters).\n * Sets the `internalFilterValue`\n *\n * Receives a callback to execute additional tasks required when resetting a filter.\n * @param callback Function to be called when resetting a filter\n */\n function resetFilter(callback?: (newValue: T) => void) {\n internalFilterValue.value = deepCopy<T>(defaultFilter.value);\n if (callback) {\n callback(internalFilterValue.value);\n }\n }\n\n /**\n * Sets the value to what is applied when opening a filter.\n * @param callback Function to be called when opening a filter\n */\n function openFilter(callback?: (newValue: T) => void) {\n // Reset value every time it opens\n internalFilterValue.value = deepCopy<T>(appliedFilter.value);\n if (callback) {\n callback(internalFilterValue.value);\n }\n }\n\n return {\n // Values\n internalFilterValue,\n isSecondaryButtonDisabled,\n isApplyButtonDisabled,\n\n // Methods\n clearFilter,\n resetFilter,\n openFilter,\n };\n}\n","import { type Ref, ref, shallowRef } from 'vue';\nimport * as z from 'zod';\nimport type { ZodSchema } from 'zod';\nimport { type allKeys, type ErrorBag, type UseForm } from './use-form.types';\n\n/**\n * Composable that tansforms a Zod schema into a Typed Schema that can be used alongside with {@see useForm}.\n *\n * This is meant to simulate the behavior of {@link @vee-validate/zod} {@see https://vee-validate.logaretm.com/v4/integrations/zod-schema-validation}.\n * Function that transform Zod’s schemas into something that can be understood by vee-validate\n *\n * @deprecated For usage with Zod/v3. Migrate to Zod/v4 and use `@adyen/bento-vue2/use-form-v4' instead or migrate to Vue3 and use Vee-Validate instead.\n *\n * @param formSchema Zod schema to be transformed into a `vee-validate` schema\n * @returns Schema transformed\n */\nexport function toTypedSchema<T extends ZodSchema>(formSchema: T) {\n return formSchema;\n}\n\n/**\n * Finds and returns the initial values of each of the values defined in the schema so that they\n * can be transformed into a reactive element.\n * @param schema Zod validation schema containing the definitions of each value to be used in the form\n * @returns Object with the items defined in the schema and their (default) values\n *\n * @example\n * const validationSchema = toTypedSchema(\n * z.object({\n * name: z\n * .string()\n * .min(3, { message: 'Name is required' })\n * .startsWith('Jane')\n * .max(4, { message: 'Name cannot be longer than 4 characters' })\n * .default('Joe'),\n * })\n * );\n * getInitialFormValues(validationSchema)\n *\n * Will return:\n *\n * {\n * name: 'Joe'\n * }\n *\n */\nfunction getInitialFormValues<T extends ZodSchema>(schema: T): z.infer<typeof schema> {\n if (!!z && schema instanceof z.ZodObject) {\n return Object.fromEntries(\n Object.entries(schema.shape).map(([key, value]) => {\n if (!!z && value instanceof z.ZodDefault) {\n // eslint-disable-next-line no-underscore-dangle\n return [key, value._def.defaultValue()];\n }\n\n if (!!z && value instanceof z.ZodObject) {\n return [key, getInitialFormValues(value)];\n }\n\n return [key, undefined];\n })\n ) as z.infer<typeof schema>;\n }\n\n return undefined;\n}\n\n/**\n * Constructs a path with dot paths for arrays to use brackets to be compatible with vee-validate path syntax\n * @param issue List of nested path elements\n * @returns Path with dots\n */\nfunction normalizeFormPath(issue: z.ZodIssue) {\n return issue.path.join('.');\n}\n\n/**\n * Composable that facilitates validating form data for Vue2 & Vue3 implementations with FormLayout\n * to ease the migration to Vue3.\n *\n * For Vue3 implementations use Vee-Validate.\n *\n * This provides a simplified version of Vee-Validate v4 implemented with Zod to validate a form schema.\n * It returns reactive values that can be used directly in form input elements with 'v-model' alongside\n * with functions to \"reset\" the data (sets values to default value) and a function to execute the\n * successful form validation process (through a callback).\n *\n * @deprecated For usage with Zod/v3. Migrate to Zod/v4 and use `@adyen/bento-vue2/use-form-v4' instead or migrate to Vue3 and use Vee-Validate instead.\n *\n * @param props Form configuration object\n * @param extends ZodSchema} props.validationSchema Zod typed validation schema\n * @returns response - Composable with reactive form values and errors, and functions to handle the reactive data\n * @returns response.errorBag Object with all the form values and an array of each one of the errors (if any) per value\n * @returns response.errors Object with all the form values and the first error found for that field (if any)\n * @returns response.values Object with all the form values and their current value\n * @returns response.handleReset Resets the form values to default (initial values) when it gets called\n * @returns response.submitForm Validates the data set in {response.values} and sets errors (if found) inside {response.errors} and {response.errorBag}.\n * When the validation is successful it calls the callback so the submit process can continue\n *\n * @example\n * const validationSchema = toTypedSchema(\n * z.object({\n * name: z\n * .string()\n * .min(3, { message: 'Name is required' })\n * .startsWith('Jane')\n * .max(4, { message: 'Name cannot be longer than 4 characters' })\n * .default('Joe'),\n * })\n * );\n *\n * const { values, errors, errorBag, submitForm, handleReset } = useForm({\n * validationSchema\n * });\n * const handleSubmit = submitForm(() => {\n * // Send data to API here\n * })\n *\n */\nexport function useForm<T extends ZodSchema>({\n validationSchema,\n}: UseForm<T>): {\n errorBag: Ref<{\n [P in allKeys<(typeof validationSchema)['_type']>]?: Array<string>;\n }>;\n errors: Ref<{\n [P in allKeys<(typeof validationSchema)['_type']>]?: string;\n }>;\n values: Ref<(typeof validationSchema)['_type']>;\n handleReset: () => void;\n submitForm: (submitted: any) => () => void;\n} {\n // Errors per field\n const errors = shallowRef<z.infer<typeof validationSchema>>({});\n // All errors per field\n const errorBag: Ref<ErrorBag<z.infer<typeof validationSchema>>> = ref({});\n const values: Ref<z.TypeOf<T>> = ref(getInitialFormValues<T>(validationSchema));\n\n const cleanErrors = () => {\n errors.value = {};\n errorBag.value = {};\n };\n\n const resetForm = () => {\n cleanErrors();\n values.value = getInitialFormValues<T>(validationSchema);\n };\n\n const submitForm = submitted => () => {\n cleanErrors();\n\n // Run validations on the form data through the schema\n const validSchema = validationSchema.safeParse(values.value);\n\n // Update errors\n if (!validSchema.success) {\n (validSchema as z.SafeParseError<T>).error.issues.forEach(error => {\n const path = normalizeFormPath(error);\n\n // Add the first ocurrance of a fild error to the \"errors\" object\n if (!errors.value[path]) {\n errors.value[path] = error.message;\n }\n\n // Add each error to the \"errorBag\" per field array\n if (!errorBag.value[path]) {\n errorBag.value[path] = [error.message];\n } else {\n errorBag.value[path].push(error.message);\n }\n });\n } else {\n submitted(values.value);\n }\n };\n\n return {\n // Values\n errorBag,\n errors,\n values,\n\n // Methods\n handleReset: () => resetForm(),\n submitForm,\n };\n}\n","import { type BentoTheme } from './install.types';\n\nexport const useBentoThemeKey = Symbol('use-bento-theme');\n\nexport interface UseBentoTheme {\n getTheme: () => string;\n setTheme: (theme: BentoTheme | `${BentoTheme}`) => void;\n}\n","import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\nimport { getCurrentInstance, inject } from 'vue';\nimport { isVue2 } from 'vue-demi';\nimport { type UseBentoTheme, useBentoThemeKey } from './use-bento-theme.types';\n\n/**\n * Composable that handles theming-related capabilities for the Bento component library.\n * Requires the use of `BentoPlugin`.\n *\n * @example\n * <script setup lang=\"ts\">\n * import { useBentoTheme, BentoTheme } from '@adyen/bento-vue2';\n *\n * const { setTheme } = useBentoTheme();\n *\n * setTheme(BentoTheme.BENTO_DARK)\n * </script>\n *\n * @returns {UseBentoTheme} An object with getter and setter method for the Bento theme.\n * @returns {Function} getTheme - Returns the current theme in the string form of BentoTheme enum.\n * @returns {Function} setTheme - Sets the theme of the Bento component library.\n *\n */\nexport function useBentoTheme(): UseBentoTheme {\n const bentoThemeController = isVue2\n ? getCurrentInstance()?.proxy[useBentoThemeKey]\n : inject(useBentoThemeKey, null);\n\n if (!bentoThemeController) {\n printDevelopmentWarning('useBentoTheme does not work without Vue.use(BentoPlugin)');\n\n // Return placeholder functions so client code won't break, but theme won't toggle\n return {\n getTheme: () => undefined,\n setTheme: () => undefined,\n };\n }\n\n // Return a new object so unintentional reassigning its properties won't override a global state\n return { ...bentoThemeController };\n}\n","import { type App, isVue2, type Vue2 } from 'vue-demi';\nimport { createToastStack, toastStackInjectionKey } from './toast-stack';\n\n/**\n * This function is used to create and register global reactive state necessary fro the Toasts to operate.\n * @param {Vue} Vue A context application to register global state with.\n */\nexport default Vue => {\n if (isVue2) {\n // Add toast stack as a global property as there is no \"app.provide\" functionality in Vue2\n // eslint-disable-next-line no-param-reassign -- this is an official way of setting up instance properties on Vue\n (Vue as typeof Vue2).prototype[toastStackInjectionKey] = createToastStack();\n } else {\n (Vue as App).provide(toastStackInjectionKey, createToastStack());\n }\n};\n","export enum BentoTheme {\n /**\n * @deprecated in favor of {@link BENTO_LIGHT}. To be removed in v2.0.0.\n */\n LEGACY = 'b-legacy-theme',\n STYLEGUIDE = 'b-styleguide-theme',\n\n /**\n * @deprecated in favor of {@link BENTO_LIGHT}. To be removed in v2.0.0.\n */\n BENTO = '',\n\n BENTO_LIGHT = 'b-light-theme',\n BENTO_DARK = 'b-dark-theme',\n BENTO_SYSTEM = 'b-system',\n}\n","import { type App, isVue2, type Vue2 } from 'vue-demi';\nimport { useBentoThemeKey } from './use-bento-theme.types';\nimport { BentoTheme } from './install.types';\n\nconst getTheme = () => document.body.className.match(/b-\\w+-theme/)?.[0] ?? '';\nconst getThemeForSystemPreference = () => {\n const preferredDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;\n\n if (preferredDarkMode) {\n return BentoTheme.BENTO_DARK;\n }\n\n return BentoTheme.BENTO_LIGHT;\n};\n\nexport const setTheme = (theme: BentoTheme) => {\n const currentTheme = getTheme();\n const systemTheme = getThemeForSystemPreference();\n const themeToSet = theme === BentoTheme.BENTO_SYSTEM ? systemTheme : theme;\n\n if (themeToSet === BentoTheme.BENTO_LIGHT || themeToSet === BentoTheme.BENTO) {\n document.documentElement.style.colorScheme = 'light';\n } else if (themeToSet === BentoTheme.BENTO_DARK) {\n document.documentElement.style.colorScheme = 'dark';\n }\n\n // if theme is different from current and it is not `BentoTheme.BENTO`\n if (currentTheme.length && currentTheme !== themeToSet) {\n document.body.classList.remove(currentTheme);\n }\n\n // if theme is not `BentoTheme.BENTO`\n if (themeToSet.length) {\n document.body.classList.add(themeToSet);\n }\n};\n\n/**\n * This function is used to create and register global reactive state necessary for theme to operate.\n * @param {Vue} Vue A context application to register global state with.\n */\nexport default Vue => {\n const themeProvider = {\n getTheme,\n setTheme,\n };\n\n if (isVue2) {\n // Add theme as a global property as there is no \"app.provide\" functionality in Vue2\n // eslint-disable-next-line no-param-reassign -- this is an official way of setting up instance properties on Vue\n (Vue as typeof Vue2).prototype[useBentoThemeKey] = themeProvider;\n } else {\n (Vue as App).provide(useBentoThemeKey, themeProvider);\n }\n};\n","import installToast from './composables/use-bento-toast-controller/install';\nimport installTheme, { setTheme } from './composables/use-bento-theme/install';\nimport { deprecate } from './utils/ts/deprecate';\nimport { BentoTheme } from './composables/use-bento-theme/install.types';\nimport type { PluginObject } from 'vue';\n\ninterface BentoVuePlugin {\n theme?: BentoTheme;\n withToast?: boolean;\n withUtilityClasses?: boolean;\n withDesignTokensCSSInjection?: boolean;\n}\n\nconst plugin: PluginObject<BentoVuePlugin> = {\n name: 'BentoVue',\n install: async (\n Vue,\n {\n theme = BentoTheme.BENTO_LIGHT,\n withToast = false,\n withUtilityClasses = false,\n withDesignTokensCSSInjection = true,\n }: BentoVuePlugin\n ) => {\n installTheme(Vue);\n\n if (withToast) {\n installToast(Vue);\n }\n if (withDesignTokensCSSInjection) {\n deprecate(\n 'Using default setting withDesignTokensCSSInjection set to true in BentoVue plugin',\n 'Please disable CSS injection by setting withDesignTokensCSSInjection to false in BentoVue plugin options as highlighted here:\\nhttps://adyen-bento.netlify.app/?path=/docs/welcome-getting-started--docs#import-css-variables',\n '2.0.0'\n );\n // Make sure to put all awaited CSS imports below this point and not above!\n if (theme === BentoTheme.STYLEGUIDE) {\n await import('@adyen/bento-design-tokens/dist/css/bento/variables-styleguide.css');\n } else {\n await import('@adyen/bento-design-tokens/dist/css/bento/variables.css');\n }\n\n if (withUtilityClasses) {\n await import('@adyen/bento-design-tokens/dist/css/bento/utility.css');\n }\n }\n\n if (theme === BentoTheme.STYLEGUIDE) {\n setTheme(BentoTheme.STYLEGUIDE);\n } else if (theme === BentoTheme.BENTO_SYSTEM) {\n setTheme(BentoTheme.BENTO_SYSTEM);\n } else if (theme === BentoTheme.BENTO_DARK) {\n setTheme(BentoTheme.BENTO_DARK);\n } else if (theme === BentoTheme.BENTO) {\n deprecate('Using `BentoTheme.BENTO`', 'Please use `BentoTheme.BENTO_LIGHT` instead', '2.0.0');\n setTheme(BentoTheme.BENTO_LIGHT);\n } else {\n setTheme(BentoTheme.BENTO_LIGHT);\n }\n },\n};\n\nexport { BentoTheme };\nexport default plugin;\n","/**\n * Defines the props used by `bento-base-filter` that must be implemented\n * on every filter as `defineProps`.\n *\n * The interface can be extended if new values are required.\n * The object can be extended if new values are required.\n *\n * @template CustomValue Defines the type of the `value` and `defaultValue` props.\n * @template CustomOptions Defines the type of the options used by the filter (default: `undefined`).\n *\n * @example\n * Using the interface\n *\n * ```typescript\n * import { type BentoBaseFilterProps } from '@adyen/bento-vue2'\n *\n * interface CustomOptions {\n * option: string;\n * }\n *\n * withDefaults(defineProps<BentoBaseFilterProps<string, CustomOptions>>(), {\n * defaultValue: undefined,\n * })\n * ```\n *\n * @example\n * Using the object\n *\n * ```typescript\n * import { BentoBaseFilterProps } from '@adyen/bento-vue2'\n *\n * defineProps({\n * ...BentoBaseFilterProps,\n * options: {\n * type: Object,\n * default: () => ({\n * option: null\n * })\n * }\n * })\n * ```\n */\nexport interface BentoBaseFilterProps<CustomValue, CustomOptions = undefined> {\n /**\n * Disables the filter from being interacted with.\n */\n disabled?: boolean;\n\n /**\n * Default value of the filter to reset to.\n */\n defaultValue?: CustomValue;\n\n /**\n * Filter name/key referencing the actual property name in the data set.\n * Should be unique per filter bar.\n */\n field: string;\n\n /**\n * Label text to be displayed\n */\n label: string;\n\n /**\n * Renders the base filter's slot content only - leaving out the button and the popover.\n * Used for the allFiltersModal component.\n */\n onlySlot?: boolean;\n\n /**\n * List of options that are needed to setup the filter\n * Available options:\n * - firstDayOfWeek: Allows you to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday\n * - isDateDisabled: Indicate if a date should be disabled or not\n * - tooltipPosition: The position of the tooltip attached to the filter button\n * - tooltipText: The content of the tooltip attached to the filter button\n */\n options?: CustomOptions;\n\n /**\n * Current value of the filter\n */\n value: CustomValue;\n}\n\nexport const BentoBaseFilterProps = Object.freeze({\n /**\n * Disables the filter from being interacted with.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Default value of the filter to reset to.\n */\n defaultValue: {\n type: [Object, Number, Boolean, Array, String, Date],\n default: null,\n },\n\n /**\n * Filter name/key referencing the actual property name in the data set.\n * Should be unique per filter bar.\n */\n field: { type: String, required: true },\n\n /**\n * Label text to be displayed\n */\n label: { type: String, required: true },\n\n /**\n * Renders the base filter's slot content only - leaving out the button and the popover.\n * Used for the allFiltersModal component.\n */\n onlySlot: { type: Boolean, default: false },\n\n /**\n * The current value of the filter, used for v-model.\n */\n value: {\n type: [Object, Number, Boolean, Array, String, Date],\n default: undefined,\n },\n});\n\n/**\n * Defines the mandatory emits that need to be defined by the implementation of any filter\n *\n * @template CustomValue Defines the type of the value being passed to the emit. Same as the type set in `BentoBaseFilterProps`\n *\n * @example\n * Using the interface\n *\n * ```typescript\n * import { type BentoBaseFilterEvents } from '@adyen/bento-vue2'\n *\n * defineEmits<BentoBaseFilterEvents<string>>()\n * ```\n *\n * @example\n * Using the object\n *\n * ```typescript\n * import { BentoBaseFilterEvents } from '@adyen/bento-vue2'\n *\n * defineEmits(BentoBaseFilterEvents)\n * ```\n */\nexport interface BentoBaseFilterEvents<CustomValue> {\n /**\n * Used in the All filters modal\n */\n (e: 'input', newFilterValue: CustomValue): void;\n\n /**\n * Used in the Filter Bar\n */\n (e: 'update', newFilterValue: CustomValue): void;\n}\n\nexport const BentoBaseFilterEvents = ['input', 'update'];\n"],"names":["isPlainObject","value","isArray","isValueEmpty","el","isEqual","first","second","deepCopy","copyStructure","key","useBentoBaseFilter","appliedFilter","defaultFilter","internalFilterValue","ref","initialStructureOrValue","onMounted","watch","newValue","isFilterInactive","computed","isSecondaryButtonDisabled","isApplyButtonDisabled","clearFilter","callback","resetFilter","openFilter","toTypedSchema","formSchema","getInitialFormValues","schema","z","normalizeFormPath","issue","useForm","validationSchema","errors","shallowRef","errorBag","values","cleanErrors","resetForm","validSchema","submitted","error","path","useBentoThemeKey","useBentoTheme","bentoThemeController","_a","getCurrentInstance","printDevelopmentWarning","installToast","Vue","toastStackInjectionKey","createToastStack","BentoTheme","getTheme","getThemeForSystemPreference","setTheme","theme","currentTheme","systemTheme","themeToSet","installTheme","themeProvider","plugin","withToast","withUtilityClasses","withDesignTokensCSSInjection","deprecate","BentoBaseFilterProps","BentoBaseFilterEvents"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMa,MAAAA,IAAgB,CAACC,MACtBA,MAAU,QAAQ,OAAOA,KAAU,WAC5B,KAGJ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AAW,aAC5BG,EAASH,EAAW,UAAU,KACvBI,MAAUJ,EAAW,SAClBc,EAAA,4BAA4B,+CAA+C,OAAO,GAC5FX,EAASH,EAAW,WAAW;AAAA,EAGnC;AAER,GC0Bae,IAAuB,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA,EAI9C,UAAU,EAAE,MAAM,SAAS,SAAS,GAAM;AAAA;AAAA;AAAA;AAAA,EAK1C,cAAc;AAAA,IACV,MAAM,CAAC,QAAQ,QAAQ,SAAS,OAAO,QAAQ,IAAI;AAAA,IACnD,SAAS;AAAA,EACb;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OAAO,EAAE,MAAM,QAAQ,UAAU,GAAK;AAAA;AAAA;AAAA;AAAA,EAKtC,OAAO,EAAE,MAAM,QAAQ,UAAU,GAAK;AAAA;AAAA;AAAA;AAAA;AAAA,EAMtC,UAAU,EAAE,MAAM,SAAS,SAAS,GAAM;AAAA;AAAA;AAAA;AAAA,EAK1C,OAAO;AAAA,IACH,MAAM,CAAC,QAAQ,QAAQ,SAAS,OAAO,QAAQ,IAAI;AAAA,IACnD,SAAS;AAAA,EAAA;AAEjB,CAAC,GAqCYC,IAAwB,CAAC,SAAS,QAAQ;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/composables/use-bento-base-filter/utils/utils.ts","../src/composables/use-bento-base-filter/use-bento-base-filter.ts","../src/composables/use-form-validate/use-form.ts","../src/composables/use-bento-theme/use-bento-theme.types.ts","../src/composables/use-bento-theme/use-bento-theme.ts","../src/directives/highlight/highlight.ts","../src/composables/use-bento-toast-controller/install.ts","../src/composables/use-bento-theme/install.types.ts","../src/composables/use-bento-theme/install.ts","../src/install.ts","../src/types/base-filter.ts"],"sourcesContent":["/**\n * Checks if a value is a plain object.\n *\n * @param value The value to check.\n * @returns Whether the value is a plain object.\n */\nexport const isPlainObject = (value: unknown) => {\n if (value === null || typeof value !== 'object') {\n return false;\n }\n\n return Object.prototype.toString.call(value) === '[object Object]';\n};\n\n/**\n * Checks if a value is an array.\n *\n * @param value The value to check.\n * @returns Whether the value is an array.\n */\nexport const isArray = <T>(value: T) => Array.isArray(value);\n\n/**\n * Checks if a value is empty.\n * If the value is an array, it checks if the array is empty or if all elements are empty strings.\n * If the value is not an array, it checks if the value is falsy.\n *\n * @param value The value to check.\n * @returns Whether the value is empty.\n */\nexport const isValueEmpty = <T>(value: T) =>\n isArray(value) ? (value as []).length === 0 || (value as Array<T>).every(el => el === '') : !value;\n\n/**\n * Checks if two objects are deeply equal by comparing their JSON string representations.\n *\n * @param first The first value.\n * @param second The second value.\n * @returns Whether the values are equal.\n */\nexport const isEqual = <T>(first: T, second: T) => JSON.stringify(first) === JSON.stringify(second);\n\n/**\n * Creates a deep copy of a value.\n * If the value is a plain object, it uses `JSON.parse(JSON.stringify(value))` to create a deep copy.\n * Otherwise, it returns the value as is.\n *\n * @param value The value to copy.\n * @returns The deep copied value or the original value if it's not a plain object.\n */\nexport const deepCopy = <T>(value: T) =>\n isPlainObject(value) || isArray(value) ? (JSON.parse(JSON.stringify(value)) as T) : value;\n\n/**\n * Copies the structure of a plain object, setting all values to `undefined`.\n * If the value is not a plain object, it returns `undefined`.\n *\n * @param value The object whose structure to copy.\n * @returns An object with the same keys as the input object but with all values set to `undefined`, or `undefined` if the input is not a plain object.\n */\nexport const copyStructure = <T>(value: T) =>\n isPlainObject(value) ? Object.fromEntries(Object.keys(value).map(key => [key, undefined])) : undefined;\n","import { computed, onMounted, ref, watch } from 'vue';\nimport type { Ref } from 'vue';\nimport { copyStructure, deepCopy, isEqual, isValueEmpty } from './utils';\n\n/**\n * A composable to wire the `bento-base-filter` component for the mandatory fields and events.\n *\n * @usage\n * ```vue\n * <template>\n * <bento-base-filter\n * :disable-apply-button=\"isApplyButtonDisabled\"\n * :disable-secondary-button=\"isSecondaryButtonDisabled\"\n * @ apply=\"updateFilter\"\n * @ clear=\"clearFilter(updateFilter)\"\n * @ open=\"openFilter\"\n * @ reset=\"resetFilter(updateFilter)\"\n * >\n * <!-- CONTENT HERE -->\n * </bento-base-filter>\n * </template>\n * <script>\n * import { ref } from 'vue'\n * import { useBentoBaseFilter, BentoBaseFilter, BentoBaseFilterProps } from '@adyen/bento-vue2'\n *\n * type CustomFilterValue = boolean\n * const props = defineProps<BentoBaseFilterProps<CustomFilterValue>>();\n *\n * const {\n * // Values\n * internalFilterValue,\n * isSecondaryButtonDisabled,\n * isApplyButtonDisabled,\n *\n * // Methods\n * clearFilter,\n * resetFilter,\n * openFilter,\n * } = useBentoBaseFilter<CustomFilterValue>(toRef(props, 'value'), toRef(props, 'defaultValue'));\n * </script>\n * ```\n *\n * @param appliedFilter The currently applied filter value.\n * @param defaultFilter The default filter value (if available).\n * @returns An object containing refs and functions:\n * - `internalFilterValue`: The temporary state of the filter before it's applied.\n * - `isSecondaryButtonDisabled`: `true` if the secondary (clear/reset) button should be disabled.\n * - `isApplyButtonDisabled`: `true` if the apply button should be disabled.\n * - `clearFilter`: Clears the filter to its initial or default state.\n * - `resetFilter`: Resets the filter to its default state.\n * - `openFilter`: Syncs the internal state with the applied filter.\n */\nexport function useBentoBaseFilter<T>(appliedFilter: Ref<T>, defaultFilter: Ref<T>) {\n /**\n * Handles the internal value. Kept in sync when the new value is applied\n */\n const internalFilterValue = ref<T>();\n const initialStructureOrValue = ref<T>();\n\n onMounted(() => {\n /**\n * Copy initial structure as long as the value is not \"undefined\"\n */\n if (appliedFilter.value != null) {\n initialStructureOrValue.value = copyStructure<T>(appliedFilter.value) as T;\n }\n });\n\n watch(\n () => appliedFilter.value,\n newValue => {\n internalFilterValue.value = deepCopy<T>(newValue);\n },\n { immediate: true }\n );\n\n /**\n * Indicates if the filter has a value applied (active).\n * - inactive (`true`): `appliedFilter` is empty (`undefined`) or all of its properties are empty for object values\n */\n const isFilterInactive = computed(\n () => isValueEmpty(appliedFilter.value) || isEqual<T>(appliedFilter.value, initialStructureOrValue.value)\n );\n\n /**\n * Indicates if the secondary (clear/reset) button should be disabled.\n * - disabled (`true`): No filter value is applied or `appliedFilter` value is the same as the `defaultFilter` (persistent) value\n */\n const isSecondaryButtonDisabled = computed(() =>\n defaultFilter.value != null ? isEqual<T>(defaultFilter.value, appliedFilter.value) : isFilterInactive.value\n );\n\n const isApplyButtonDisabled = computed(() => {\n const isValueUnchanged = isEqual<T>(internalFilterValue.value, appliedFilter.value);\n return isValueUnchanged || (isValueEmpty(internalFilterValue.value) && isFilterInactive.value);\n });\n\n /**\n * Clears the non-persistent filters (not used in persistent filters).\n *\n * Receives a callback to execute additional tasks required when clearing a filter\n *\n * - `object`: Sets all properties to `undefined`\n * - non-`object`: Sets to `undefined`\n * @param callback Function to be called when clearing a filter\n */\n function clearFilter(callback?: (newValue: T) => void) {\n internalFilterValue.value = deepCopy<T>(initialStructureOrValue.value);\n if (callback) {\n callback(internalFilterValue.value);\n }\n }\n\n /**\n * Resets the persistent filters (not used in non-persistent filters).\n * Sets the `internalFilterValue`\n *\n * Receives a callback to execute additional tasks required when resetting a filter.\n * @param callback Function to be called when resetting a filter\n */\n function resetFilter(callback?: (newValue: T) => void) {\n internalFilterValue.value = deepCopy<T>(defaultFilter.value);\n if (callback) {\n callback(internalFilterValue.value);\n }\n }\n\n /**\n * Sets the value to what is applied when opening a filter.\n * @param callback Function to be called when opening a filter\n */\n function openFilter(callback?: (newValue: T) => void) {\n // Reset value every time it opens\n internalFilterValue.value = deepCopy<T>(appliedFilter.value);\n if (callback) {\n callback(internalFilterValue.value);\n }\n }\n\n return {\n // Values\n internalFilterValue,\n isSecondaryButtonDisabled,\n isApplyButtonDisabled,\n\n // Methods\n clearFilter,\n resetFilter,\n openFilter,\n };\n}\n","import { type Ref, ref, shallowRef } from 'vue';\nimport * as z from 'zod';\nimport type { ZodSchema } from 'zod';\nimport { type allKeys, type ErrorBag, type UseForm } from './use-form.types';\n\n/**\n * Composable that tansforms a Zod schema into a Typed Schema that can be used alongside with {@see useForm}.\n *\n * This is meant to simulate the behavior of {@link @vee-validate/zod} {@see https://vee-validate.logaretm.com/v4/integrations/zod-schema-validation}.\n * Function that transform Zod’s schemas into something that can be understood by vee-validate\n *\n * @deprecated For usage with Zod/v3. Migrate to Zod/v4 and use `@adyen/bento-vue2/use-form-v4' instead or migrate to Vue3 and use Vee-Validate instead.\n *\n * @param formSchema Zod schema to be transformed into a `vee-validate` schema\n * @returns Schema transformed\n */\nexport function toTypedSchema<T extends ZodSchema>(formSchema: T) {\n return formSchema;\n}\n\n/**\n * Finds and returns the initial values of each of the values defined in the schema so that they\n * can be transformed into a reactive element.\n * @param schema Zod validation schema containing the definitions of each value to be used in the form\n * @returns Object with the items defined in the schema and their (default) values\n *\n * @example\n * const validationSchema = toTypedSchema(\n * z.object({\n * name: z\n * .string()\n * .min(3, { message: 'Name is required' })\n * .startsWith('Jane')\n * .max(4, { message: 'Name cannot be longer than 4 characters' })\n * .default('Joe'),\n * })\n * );\n * getInitialFormValues(validationSchema)\n *\n * Will return:\n *\n * {\n * name: 'Joe'\n * }\n *\n */\nfunction getInitialFormValues<T extends ZodSchema>(schema: T): z.infer<typeof schema> {\n if (!!z && schema instanceof z.ZodObject) {\n return Object.fromEntries(\n Object.entries(schema.shape).map(([key, value]) => {\n if (!!z && value instanceof z.ZodDefault) {\n // eslint-disable-next-line no-underscore-dangle\n return [key, value._def.defaultValue()];\n }\n\n if (!!z && value instanceof z.ZodObject) {\n return [key, getInitialFormValues(value)];\n }\n\n return [key, undefined];\n })\n ) as z.infer<typeof schema>;\n }\n\n return undefined;\n}\n\n/**\n * Constructs a path with dot paths for arrays to use brackets to be compatible with vee-validate path syntax\n * @param issue List of nested path elements\n * @returns Path with dots\n */\nfunction normalizeFormPath(issue: z.ZodIssue) {\n return issue.path.join('.');\n}\n\n/**\n * Composable that facilitates validating form data for Vue2 & Vue3 implementations with FormLayout\n * to ease the migration to Vue3.\n *\n * For Vue3 implementations use Vee-Validate.\n *\n * This provides a simplified version of Vee-Validate v4 implemented with Zod to validate a form schema.\n * It returns reactive values that can be used directly in form input elements with 'v-model' alongside\n * with functions to \"reset\" the data (sets values to default value) and a function to execute the\n * successful form validation process (through a callback).\n *\n * @deprecated For usage with Zod/v3. Migrate to Zod/v4 and use `@adyen/bento-vue2/use-form-v4' instead or migrate to Vue3 and use Vee-Validate instead.\n *\n * @param props Form configuration object\n * @param extends ZodSchema} props.validationSchema Zod typed validation schema\n * @returns response - Composable with reactive form values and errors, and functions to handle the reactive data\n * @returns response.errorBag Object with all the form values and an array of each one of the errors (if any) per value\n * @returns response.errors Object with all the form values and the first error found for that field (if any)\n * @returns response.values Object with all the form values and their current value\n * @returns response.handleReset Resets the form values to default (initial values) when it gets called\n * @returns response.submitForm Validates the data set in {response.values} and sets errors (if found) inside {response.errors} and {response.errorBag}.\n * When the validation is successful it calls the callback so the submit process can continue\n *\n * @example\n * const validationSchema = toTypedSchema(\n * z.object({\n * name: z\n * .string()\n * .min(3, { message: 'Name is required' })\n * .startsWith('Jane')\n * .max(4, { message: 'Name cannot be longer than 4 characters' })\n * .default('Joe'),\n * })\n * );\n *\n * const { values, errors, errorBag, submitForm, handleReset } = useForm({\n * validationSchema\n * });\n * const handleSubmit = submitForm(() => {\n * // Send data to API here\n * })\n *\n */\nexport function useForm<T extends ZodSchema>({\n validationSchema,\n}: UseForm<T>): {\n errorBag: Ref<{\n [P in allKeys<(typeof validationSchema)['_type']>]?: Array<string>;\n }>;\n errors: Ref<{\n [P in allKeys<(typeof validationSchema)['_type']>]?: string;\n }>;\n values: Ref<(typeof validationSchema)['_type']>;\n handleReset: () => void;\n submitForm: (submitted: any) => () => void;\n} {\n // Errors per field\n const errors = shallowRef<z.infer<typeof validationSchema>>({});\n // All errors per field\n const errorBag: Ref<ErrorBag<z.infer<typeof validationSchema>>> = ref({});\n const values: Ref<z.TypeOf<T>> = ref(getInitialFormValues<T>(validationSchema));\n\n const cleanErrors = () => {\n errors.value = {};\n errorBag.value = {};\n };\n\n const resetForm = () => {\n cleanErrors();\n values.value = getInitialFormValues<T>(validationSchema);\n };\n\n const submitForm = submitted => () => {\n cleanErrors();\n\n // Run validations on the form data through the schema\n const validSchema = validationSchema.safeParse(values.value);\n\n // Update errors\n if (!validSchema.success) {\n (validSchema as z.SafeParseError<T>).error.issues.forEach(error => {\n const path = normalizeFormPath(error);\n\n // Add the first ocurrance of a fild error to the \"errors\" object\n if (!errors.value[path]) {\n errors.value[path] = error.message;\n }\n\n // Add each error to the \"errorBag\" per field array\n if (!errorBag.value[path]) {\n errorBag.value[path] = [error.message];\n } else {\n errorBag.value[path].push(error.message);\n }\n });\n } else {\n submitted(values.value);\n }\n };\n\n return {\n // Values\n errorBag,\n errors,\n values,\n\n // Methods\n handleReset: () => resetForm(),\n submitForm,\n };\n}\n","import { type BentoTheme } from './install.types';\n\nexport const useBentoThemeKey = Symbol('use-bento-theme');\n\nexport interface UseBentoTheme {\n getTheme: () => string;\n setTheme: (theme: BentoTheme | `${BentoTheme}`) => void;\n}\n","import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\nimport { getCurrentInstance, inject } from 'vue';\nimport { isVue2 } from 'vue-demi';\nimport { type UseBentoTheme, useBentoThemeKey } from './use-bento-theme.types';\n\n/**\n * Composable that handles theming-related capabilities for the Bento component library.\n * Requires the use of `BentoPlugin`.\n *\n * @example\n * <script setup lang=\"ts\">\n * import { useBentoTheme, BentoTheme } from '@adyen/bento-vue2';\n *\n * const { setTheme } = useBentoTheme();\n *\n * setTheme(BentoTheme.BENTO_DARK)\n * </script>\n *\n * @returns {UseBentoTheme} An object with getter and setter method for the Bento theme.\n * @returns {Function} getTheme - Returns the current theme in the string form of BentoTheme enum.\n * @returns {Function} setTheme - Sets the theme of the Bento component library.\n *\n */\nexport function useBentoTheme(): UseBentoTheme {\n const bentoThemeController = isVue2\n ? getCurrentInstance()?.proxy[useBentoThemeKey]\n : inject(useBentoThemeKey, null);\n\n if (!bentoThemeController) {\n printDevelopmentWarning('useBentoTheme does not work without Vue.use(BentoPlugin)');\n\n // Return placeholder functions so client code won't break, but theme won't toggle\n return {\n getTheme: () => undefined,\n setTheme: () => undefined,\n };\n }\n\n // Return a new object so unintentional reassigning its properties won't override a global state\n return { ...bentoThemeController };\n}\n","const getSize = ({ modifiers, value }) => Object.keys(modifiers)[0] || value?.size || 'small';\n\nconst toggleHighlight = (el, binding, enabled) => {\n const extraPadding = binding.value?.extraPadding ?? false;\n const rounded = binding.value?.rounded ?? false;\n const size = getSize(binding);\n\n el.classList.toggle('b-highlight', enabled);\n el.classList.toggle('b-highlight--extra-padding', enabled && extraPadding);\n el.classList.toggle('b-highlight--rounded', enabled && rounded);\n\n ['small', 'medium', 'large'].forEach(s => {\n el.classList.toggle(`b-highlight--${s}`, enabled && s === size);\n });\n};\n\nconst applyHighlight = (el, binding) => {\n toggleHighlight(el, binding, binding.value !== false);\n};\n\nconst updateHighlight = (el, binding) => {\n toggleHighlight(el, binding, binding.value !== false);\n};\n\nconst removeHighlight = (el, binding) => {\n toggleHighlight(el, binding, false);\n};\n\nexport const BentoHighlightDirective = {\n // Vue 2\n bind: applyHighlight,\n update: updateHighlight,\n unbind: removeHighlight,\n\n // Vue 3\n beforeMount: applyHighlight,\n mounted: updateHighlight,\n updated: updateHighlight,\n unmounted: removeHighlight,\n};\n\nimport './highlight.scss';\n","import { type App, isVue2, type Vue2 } from 'vue-demi';\nimport { createToastStack, toastStackInjectionKey } from './toast-stack';\n\n/**\n * This function is used to create and register global reactive state necessary fro the Toasts to operate.\n * @param {Vue} Vue A context application to register global state with.\n */\nexport default Vue => {\n if (isVue2) {\n // Add toast stack as a global property as there is no \"app.provide\" functionality in Vue2\n // eslint-disable-next-line no-param-reassign -- this is an official way of setting up instance properties on Vue\n (Vue as typeof Vue2).prototype[toastStackInjectionKey] = createToastStack();\n } else {\n (Vue as App).provide(toastStackInjectionKey, createToastStack());\n }\n};\n","export enum BentoTheme {\n /**\n * @deprecated in favor of {@link BENTO_LIGHT}. To be removed in v2.0.0.\n */\n LEGACY = 'b-legacy-theme',\n STYLEGUIDE = 'b-styleguide-theme',\n\n /**\n * @deprecated in favor of {@link BENTO_LIGHT}. To be removed in v2.0.0.\n */\n BENTO = '',\n\n BENTO_LIGHT = 'b-light-theme',\n BENTO_DARK = 'b-dark-theme',\n BENTO_SYSTEM = 'b-system',\n}\n","import { type App, isVue2, type Vue2 } from 'vue-demi';\nimport { useBentoThemeKey } from './use-bento-theme.types';\nimport { BentoTheme } from './install.types';\n\nconst getTheme = () => document.body.className.match(/b-\\w+-theme/)?.[0] ?? '';\nconst getThemeForSystemPreference = () => {\n const preferredDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;\n\n if (preferredDarkMode) {\n return BentoTheme.BENTO_DARK;\n }\n\n return BentoTheme.BENTO_LIGHT;\n};\n\nexport const setTheme = (theme: BentoTheme) => {\n const currentTheme = getTheme();\n const systemTheme = getThemeForSystemPreference();\n const themeToSet = theme === BentoTheme.BENTO_SYSTEM ? systemTheme : theme;\n\n if (themeToSet === BentoTheme.BENTO_LIGHT || themeToSet === BentoTheme.BENTO) {\n document.documentElement.style.colorScheme = 'light';\n } else if (themeToSet === BentoTheme.BENTO_DARK) {\n document.documentElement.style.colorScheme = 'dark';\n }\n\n // if theme is different from current and it is not `BentoTheme.BENTO`\n if (currentTheme.length && currentTheme !== themeToSet) {\n document.body.classList.remove(currentTheme);\n }\n\n // if theme is not `BentoTheme.BENTO`\n if (themeToSet.length) {\n document.body.classList.add(themeToSet);\n }\n};\n\n/**\n * This function is used to create and register global reactive state necessary for theme to operate.\n * @param {Vue} Vue A context application to register global state with.\n */\nexport default Vue => {\n const themeProvider = {\n getTheme,\n setTheme,\n };\n\n if (isVue2) {\n // Add theme as a global property as there is no \"app.provide\" functionality in Vue2\n // eslint-disable-next-line no-param-reassign -- this is an official way of setting up instance properties on Vue\n (Vue as typeof Vue2).prototype[useBentoThemeKey] = themeProvider;\n } else {\n (Vue as App).provide(useBentoThemeKey, themeProvider);\n }\n};\n","import installToast from './composables/use-bento-toast-controller/install';\nimport installTheme, { setTheme } from './composables/use-bento-theme/install';\nimport { deprecate } from './utils/ts/deprecate';\nimport { BentoTheme } from './composables/use-bento-theme/install.types';\nimport type { PluginObject } from 'vue';\n\ninterface BentoVuePlugin {\n theme?: BentoTheme;\n withToast?: boolean;\n withUtilityClasses?: boolean;\n withDesignTokensCSSInjection?: boolean;\n}\n\nconst plugin: PluginObject<BentoVuePlugin> = {\n name: 'BentoVue',\n install: async (\n Vue,\n {\n theme = BentoTheme.BENTO_LIGHT,\n withToast = false,\n withUtilityClasses = false,\n withDesignTokensCSSInjection = true,\n }: BentoVuePlugin\n ) => {\n installTheme(Vue);\n\n if (withToast) {\n installToast(Vue);\n }\n if (withDesignTokensCSSInjection) {\n deprecate(\n 'Using default setting withDesignTokensCSSInjection set to true in BentoVue plugin',\n 'Please disable CSS injection by setting withDesignTokensCSSInjection to false in BentoVue plugin options as highlighted here:\\nhttps://adyen-bento.netlify.app/?path=/docs/welcome-getting-started--docs#import-css-variables',\n '2.0.0'\n );\n // Make sure to put all awaited CSS imports below this point and not above!\n if (theme === BentoTheme.STYLEGUIDE) {\n await import('@adyen/bento-design-tokens/dist/css/bento/variables-styleguide.css');\n } else {\n await import('@adyen/bento-design-tokens/dist/css/bento/variables.css');\n }\n\n if (withUtilityClasses) {\n await import('@adyen/bento-design-tokens/dist/css/bento/utility.css');\n }\n }\n\n if (theme === BentoTheme.STYLEGUIDE) {\n setTheme(BentoTheme.STYLEGUIDE);\n } else if (theme === BentoTheme.BENTO_SYSTEM) {\n setTheme(BentoTheme.BENTO_SYSTEM);\n } else if (theme === BentoTheme.BENTO_DARK) {\n setTheme(BentoTheme.BENTO_DARK);\n } else if (theme === BentoTheme.BENTO) {\n deprecate('Using `BentoTheme.BENTO`', 'Please use `BentoTheme.BENTO_LIGHT` instead', '2.0.0');\n setTheme(BentoTheme.BENTO_LIGHT);\n } else {\n setTheme(BentoTheme.BENTO_LIGHT);\n }\n },\n};\n\nexport { BentoTheme };\nexport default plugin;\n","/**\n * Defines the props used by `bento-base-filter` that must be implemented\n * on every filter as `defineProps`.\n *\n * The interface can be extended if new values are required.\n * The object can be extended if new values are required.\n *\n * @template CustomValue Defines the type of the `value` and `defaultValue` props.\n * @template CustomOptions Defines the type of the options used by the filter (default: `undefined`).\n *\n * @example\n * Using the interface\n *\n * ```typescript\n * import { type BentoBaseFilterProps } from '@adyen/bento-vue2'\n *\n * interface CustomOptions {\n * option: string;\n * }\n *\n * withDefaults(defineProps<BentoBaseFilterProps<string, CustomOptions>>(), {\n * defaultValue: undefined,\n * })\n * ```\n *\n * @example\n * Using the object\n *\n * ```typescript\n * import { BentoBaseFilterProps } from '@adyen/bento-vue2'\n *\n * defineProps({\n * ...BentoBaseFilterProps,\n * options: {\n * type: Object,\n * default: () => ({\n * option: null\n * })\n * }\n * })\n * ```\n */\nexport interface BentoBaseFilterProps<CustomValue, CustomOptions = undefined> {\n /**\n * Disables the filter from being interacted with.\n */\n disabled?: boolean;\n\n /**\n * Default value of the filter to reset to.\n */\n defaultValue?: CustomValue;\n\n /**\n * Filter name/key referencing the actual property name in the data set.\n * Should be unique per filter bar.\n */\n field: string;\n\n /**\n * Label text to be displayed\n */\n label: string;\n\n /**\n * Renders the base filter's slot content only - leaving out the button and the popover.\n * Used for the allFiltersModal component.\n */\n onlySlot?: boolean;\n\n /**\n * List of options that are needed to setup the filter\n * Available options:\n * - firstDayOfWeek: Allows you to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday\n * - isDateDisabled: Indicate if a date should be disabled or not\n * - tooltipPosition: The position of the tooltip attached to the filter button\n * - tooltipText: The content of the tooltip attached to the filter button\n */\n options?: CustomOptions;\n\n /**\n * Current value of the filter\n */\n value: CustomValue;\n}\n\nexport const BentoBaseFilterProps = Object.freeze({\n /**\n * Disables the filter from being interacted with.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Default value of the filter to reset to.\n */\n defaultValue: {\n type: [Object, Number, Boolean, Array, String, Date],\n default: null,\n },\n\n /**\n * Filter name/key referencing the actual property name in the data set.\n * Should be unique per filter bar.\n */\n field: { type: String, required: true },\n\n /**\n * Label text to be displayed\n */\n label: { type: String, required: true },\n\n /**\n * Renders the base filter's slot content only - leaving out the button and the popover.\n * Used for the allFiltersModal component.\n */\n onlySlot: { type: Boolean, default: false },\n\n /**\n * The current value of the filter, used for v-model.\n */\n value: {\n type: [Object, Number, Boolean, Array, String, Date],\n default: undefined,\n },\n});\n\n/**\n * Defines the mandatory emits that need to be defined by the implementation of any filter\n *\n * @template CustomValue Defines the type of the value being passed to the emit. Same as the type set in `BentoBaseFilterProps`\n *\n * @example\n * Using the interface\n *\n * ```typescript\n * import { type BentoBaseFilterEvents } from '@adyen/bento-vue2'\n *\n * defineEmits<BentoBaseFilterEvents<string>>()\n * ```\n *\n * @example\n * Using the object\n *\n * ```typescript\n * import { BentoBaseFilterEvents } from '@adyen/bento-vue2'\n *\n * defineEmits(BentoBaseFilterEvents)\n * ```\n */\nexport interface BentoBaseFilterEvents<CustomValue> {\n /**\n * Used in the All filters modal\n */\n (e: 'input', newFilterValue: CustomValue): void;\n\n /**\n * Used in the Filter Bar\n */\n (e: 'update', newFilterValue: CustomValue): void;\n}\n\nexport const BentoBaseFilterEvents = ['input', 'update'];\n"],"names":["isPlainObject","value","isArray","isValueEmpty","el","isEqual","first","second","deepCopy","copyStructure","key","useBentoBaseFilter","appliedFilter","defaultFilter","internalFilterValue","ref","initialStructureOrValue","onMounted","watch","newValue","isFilterInactive","computed","isSecondaryButtonDisabled","isApplyButtonDisabled","clearFilter","callback","resetFilter","openFilter","toTypedSchema","formSchema","getInitialFormValues","schema","z","normalizeFormPath","issue","useForm","validationSchema","errors","shallowRef","errorBag","values","cleanErrors","resetForm","submitted","validSchema","error","path","useBentoThemeKey","useBentoTheme","bentoThemeController","_a","getCurrentInstance","printDevelopmentWarning","getSize","modifiers","toggleHighlight","binding","enabled","extraPadding","rounded","_b","size","s","applyHighlight","updateHighlight","removeHighlight","BentoHighlightDirective","installToast","Vue","toastStackInjectionKey","createToastStack","BentoTheme","BentoTheme2","getTheme","getThemeForSystemPreference","setTheme","theme","currentTheme","systemTheme","themeToSet","installTheme","themeProvider","plugin","withToast","withUtilityClasses","withDesignTokensCSSInjection","deprecate","BentoBaseFilterProps","BentoBaseFilterEvents"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMa,MAAAA,IAAA,CAAAC,MACTA,MAAA,QAAA,OAAAA,KAAA,WACI,KAGJ,OAAA,UAAA,SAAA,KAAAA,CAAA,MAAA,mBASGC,IAAA,CAAAD,MAAA,MAAA,QAAAA,CAAA,GAUAE,IAAA,CAAAF,MAAAC,EAAAD,CAAA,IAAAA,EAAA,WAAA,KAAAA,EAAA,MAAA,CAAAG,MAAAA,MAAA,EAAA,IAAA,CAAAH,GAUMI,IAAA,CAAAC,GAAAC,MAAA,KAAA,UAAAD,CAAA,MAAA,KAAA,UAAAC,CAAA,GAUNC,IAAA,CAAAP,MAAAD,EAAAC,CAAA,KAAAC,EAAAD,CAAA,IAAA,KAAA,MAAA,KAAA,UAAAA,CAAA,CAAA,IAAAA,GAUAQ,IAAA,CAAAR,MAAAD,EAAAC,CAAA,IAAA,OAAA,YAAA,OAAA,KAAAA,CAAA,EAAA,IAAA,CAAAS,MAAA,CAAAA,GAAA,MAAA,CAAA,CAAA,IAAA;ACRS,SAAAC,EAAAC,GAAAC,GAAA;AAIZ,QAAAC,IAAAC,EAAA,GACAC,IAAAD,EAAA;AAEA,EAAAE,EAAA,MAAA;AAII,IAAAL,EAAA,SAAA,SACII,EAAA,QAAAP,EAAAG,EAAA,KAAA;AAAA,EACJ,CAAA,GAGJM;AAAA,IAAA,MAAAN,EAAA;AAAA,IACwB,CAAAO,MAAA;AAEhB,MAAAL,EAAA,QAAAN,EAAAW,CAAA;AAAA,IAAgD;AAAA,IACpD,EAAA,WAAA,GAAA;AAAA,EACkB;AAOtB,QAAAC,IAAAC;AAAA,IAAyB,MAAAlB,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BK,MAAAL,EAAA,eAE9BI,EAAAJ,EAAA,YAAA,IAAgCK,MAAAL,EAAA,aAEhCI,EAAAJ,EAAA,UAAA,KAA8BK,MAAAL,EAAA,SAE9Be,EAAA,4BAAA,+CAAA,OAAA,GACAX,EAAAJ,EAAA,WAAA;AAAA,EAGJ;AAER,GC0BagB,IAAA,OAAA,OAAA;AAAA;AAAA;AAAA;AAAA,EAAqC,UAAA,EAAA,MAAA,SAAA,SAAA,GAAA;AAAA;AAAA;AAAA;AAAA,EAIJ,cAAA;AAAA,IAK5B,MAAA,CAAA,QAAA,QAAA,SAAA,OAAA,QAAA,IAAA;AAAA,IACyC,SAAA;AAAA,EAC1C;AAAA;AAAA;AAAA;AAAA;AAAA,EACb,OAAA,EAAA,MAAA,QAAA,UAAA,GAAA;AAAA;AAAA;AAAA;AAAA,EAMsC,OAAA,EAAA,MAAA,QAAA,UAAA,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA,UAAA,EAAA,MAAA,SAAA,SAAA,GAAA;AAAA;AAAA;AAAA;AAAA,EAMI,OAAA;AAAA,IAKnC,MAAA,CAAA,QAAA,QAAA,SAAA,OAAA,QAAA,IAAA;AAAA,IACgD,SAAA;AAAA,EAC1C;AAEjB,CAAA,GAqCaC,IAAA,CAAA,SAAA,QAAA;"}
|
package/dist/radio-group.js
CHANGED
package/dist/rich-text-editor.js
CHANGED
package/dist/selection-card.js
CHANGED
|
@@ -110,6 +110,9 @@
|
|
|
110
110
|
--b-input-field-input-box-focus-border-width: 1.5px;
|
|
111
111
|
--b-input-field-input-box-height: 36px;
|
|
112
112
|
--b-input-field-password-validation-title-font-weight: 700;
|
|
113
|
+
--b-highlight-box-shadow-ripple-color: rgba(0, 161, 82, 0.4);
|
|
114
|
+
--b-highlight-box-shadow-shadow-color: rgba(0, 161, 82, 0.2);
|
|
115
|
+
--b-highlight-box-shadow-outline-color: #00a152;
|
|
113
116
|
--b-header-actions-margin-top-desktop: 0;
|
|
114
117
|
--b-header-with-views-all-views-popover-menu-item-dragging-z-index: 1;
|
|
115
118
|
--b-filter-button-label-line-height: 20px;
|
|
@@ -1137,6 +1140,8 @@
|
|
|
1137
1140
|
--b-input-field-password-validation-list-text-margin-left: var(--b-spacer-040);
|
|
1138
1141
|
--b-input-field-password-validation-list-gap: var(--b-spacer-060);
|
|
1139
1142
|
--b-info-icon-color: var(--b-color-label-primary);
|
|
1143
|
+
--b-highlight-extra-padding-inset: calc(0px - var(--b-spacer-030)) calc(0px - var(--b-spacer-040));
|
|
1144
|
+
--b-highlight-rounded-border-radius: var(--b-border-radius-m);
|
|
1140
1145
|
--b-header-component-title-margin-top: var(--b-spacer-020);
|
|
1141
1146
|
--b-header-actions-margin-top: var(--b-spacer-070);
|
|
1142
1147
|
--b-header-timestamp-margin-block: var(--b-spacer-020);
|
|
@@ -109,6 +109,9 @@
|
|
|
109
109
|
--b-input-field-input-box-focus-border-width: 1.5px;
|
|
110
110
|
--b-input-field-input-box-height: 36px;
|
|
111
111
|
--b-input-field-password-validation-title-font-weight: 700;
|
|
112
|
+
--b-highlight-box-shadow-ripple-color: rgba(0, 161, 82, 0.4);
|
|
113
|
+
--b-highlight-box-shadow-shadow-color: rgba(0, 161, 82, 0.2);
|
|
114
|
+
--b-highlight-box-shadow-outline-color: #00a152;
|
|
112
115
|
--b-header-actions-margin-top-desktop: 0;
|
|
113
116
|
--b-header-with-views-all-views-popover-menu-item-dragging-z-index: 1;
|
|
114
117
|
--b-filter-button-label-line-height: 20px;
|
|
@@ -1136,6 +1139,8 @@
|
|
|
1136
1139
|
--b-input-field-password-validation-list-text-margin-left: var(--b-spacer-040);
|
|
1137
1140
|
--b-input-field-password-validation-list-gap: var(--b-spacer-060);
|
|
1138
1141
|
--b-info-icon-color: var(--b-color-label-primary);
|
|
1142
|
+
--b-highlight-extra-padding-inset: calc(0px - var(--b-spacer-030)) calc(0px - var(--b-spacer-040));
|
|
1143
|
+
--b-highlight-rounded-border-radius: var(--b-border-radius-m);
|
|
1139
1144
|
--b-header-component-title-margin-top: var(--b-spacer-020);
|
|
1140
1145
|
--b-header-actions-margin-top: var(--b-spacer-070);
|
|
1141
1146
|
--b-header-timestamp-margin-block: var(--b-spacer-020);
|
package/dist/styles/bento.css
CHANGED
|
@@ -109,6 +109,9 @@
|
|
|
109
109
|
--b-input-field-input-box-focus-border-width: 1.5px;
|
|
110
110
|
--b-input-field-input-box-height: 36px;
|
|
111
111
|
--b-input-field-password-validation-title-font-weight: 700;
|
|
112
|
+
--b-highlight-box-shadow-ripple-color: rgba(0, 161, 82, 0.4);
|
|
113
|
+
--b-highlight-box-shadow-shadow-color: rgba(0, 161, 82, 0.2);
|
|
114
|
+
--b-highlight-box-shadow-outline-color: #00a152;
|
|
112
115
|
--b-header-actions-margin-top-desktop: 0;
|
|
113
116
|
--b-header-with-views-all-views-popover-menu-item-dragging-z-index: 1;
|
|
114
117
|
--b-filter-button-label-line-height: 20px;
|
|
@@ -1136,6 +1139,8 @@
|
|
|
1136
1139
|
--b-input-field-password-validation-list-text-margin-left: var(--b-spacer-040);
|
|
1137
1140
|
--b-input-field-password-validation-list-gap: var(--b-spacer-060);
|
|
1138
1141
|
--b-info-icon-color: var(--b-color-label-primary);
|
|
1142
|
+
--b-highlight-extra-padding-inset: calc(0px - var(--b-spacer-030)) calc(0px - var(--b-spacer-040));
|
|
1143
|
+
--b-highlight-rounded-border-radius: var(--b-border-radius-m);
|
|
1139
1144
|
--b-header-component-title-margin-top: var(--b-spacer-020);
|
|
1140
1145
|
--b-header-actions-margin-top: var(--b-spacer-070);
|
|
1141
1146
|
--b-header-timestamp-margin-block: var(--b-spacer-020);
|
package/dist/styles/legacy.css
CHANGED
|
@@ -109,6 +109,9 @@
|
|
|
109
109
|
--b-input-field-input-box-focus-border-width: 1.5px;
|
|
110
110
|
--b-input-field-input-box-height: 36px;
|
|
111
111
|
--b-input-field-password-validation-title-font-weight: 700;
|
|
112
|
+
--b-highlight-box-shadow-ripple-color: rgba(0, 161, 82, 0.4);
|
|
113
|
+
--b-highlight-box-shadow-shadow-color: rgba(0, 161, 82, 0.2);
|
|
114
|
+
--b-highlight-box-shadow-outline-color: #00a152;
|
|
112
115
|
--b-header-actions-margin-top-desktop: 0;
|
|
113
116
|
--b-header-with-views-all-views-popover-menu-item-dragging-z-index: 1;
|
|
114
117
|
--b-filter-button-label-line-height: 20px;
|
|
@@ -1136,6 +1139,8 @@
|
|
|
1136
1139
|
--b-input-field-password-validation-list-text-margin-left: var(--b-spacer-040);
|
|
1137
1140
|
--b-input-field-password-validation-list-gap: var(--b-spacer-060);
|
|
1138
1141
|
--b-info-icon-color: var(--b-color-label-primary);
|
|
1142
|
+
--b-highlight-extra-padding-inset: calc(0px - var(--b-spacer-030)) calc(0px - var(--b-spacer-040));
|
|
1143
|
+
--b-highlight-rounded-border-radius: var(--b-border-radius-m);
|
|
1139
1144
|
--b-header-component-title-margin-top: var(--b-spacer-020);
|
|
1140
1145
|
--b-header-actions-margin-top: var(--b-spacer-070);
|
|
1141
1146
|
--b-header-timestamp-margin-block: var(--b-spacer-020);
|
|
@@ -109,6 +109,9 @@
|
|
|
109
109
|
--b-input-field-input-box-focus-border-width: 1.5px;
|
|
110
110
|
--b-input-field-input-box-height: 36px;
|
|
111
111
|
--b-input-field-password-validation-title-font-weight: 700;
|
|
112
|
+
--b-highlight-box-shadow-ripple-color: rgba(0, 161, 82, 0.4);
|
|
113
|
+
--b-highlight-box-shadow-shadow-color: rgba(0, 161, 82, 0.2);
|
|
114
|
+
--b-highlight-box-shadow-outline-color: #00a152;
|
|
112
115
|
--b-header-actions-margin-top-desktop: 0;
|
|
113
116
|
--b-header-with-views-all-views-popover-menu-item-dragging-z-index: 1;
|
|
114
117
|
--b-filter-button-label-line-height: 20px;
|
|
@@ -1191,6 +1194,8 @@
|
|
|
1191
1194
|
--b-input-field-password-validation-list-text-margin-left: var(--b-spacer-040);
|
|
1192
1195
|
--b-input-field-password-validation-list-gap: var(--b-spacer-060);
|
|
1193
1196
|
--b-info-icon-color: var(--b-color-label-primary);
|
|
1197
|
+
--b-highlight-extra-padding-inset: calc(0px - var(--b-spacer-030)) calc(0px - var(--b-spacer-040));
|
|
1198
|
+
--b-highlight-rounded-border-radius: var(--b-border-radius-m);
|
|
1194
1199
|
--b-header-component-title-margin-top: var(--b-spacer-020);
|
|
1195
1200
|
--b-header-actions-margin-top: var(--b-spacer-070);
|
|
1196
1201
|
--b-header-timestamp-margin-block: var(--b-spacer-020);
|
package/dist/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"framework": "vue",
|
|
3
3
|
"name": "@adyen/bento-vue2",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.78.0",
|
|
5
5
|
"contributions": {
|
|
6
6
|
"html": {
|
|
7
7
|
"description-markup": "markdown",
|
|
@@ -2994,7 +2994,7 @@
|
|
|
2994
2994
|
},
|
|
2995
2995
|
{
|
|
2996
2996
|
"name": "checkbox-group",
|
|
2997
|
-
"description": "
|
|
2997
|
+
"description": "",
|
|
2998
2998
|
"attributes": [
|
|
2999
2999
|
{
|
|
3000
3000
|
"name": "description",
|
|
@@ -3069,7 +3069,7 @@
|
|
|
3069
3069
|
}
|
|
3070
3070
|
},
|
|
3071
3071
|
{
|
|
3072
|
-
"name": "
|
|
3072
|
+
"name": "modelValue",
|
|
3073
3073
|
"description": "Determines the initially selected value of the group. Corresponds to the BentoCheckboxButtonItem's value.\nDefaults to no value selected.",
|
|
3074
3074
|
"value": {
|
|
3075
3075
|
"kind": "expression",
|
|
@@ -4579,13 +4579,13 @@
|
|
|
4579
4579
|
"default": "undefined"
|
|
4580
4580
|
},
|
|
4581
4581
|
{
|
|
4582
|
-
"name": "
|
|
4583
|
-
"description": "
|
|
4582
|
+
"name": "visibleRowsState",
|
|
4583
|
+
"description": "Determines the state of the current results: { filtered: boolean, allItemsVisible: boolean } to render the correct select all menu options",
|
|
4584
4584
|
"value": {
|
|
4585
4585
|
"kind": "expression",
|
|
4586
|
-
"type": "
|
|
4586
|
+
"type": "BentoDataGridVisibleRowsState"
|
|
4587
4587
|
},
|
|
4588
|
-
"default": "
|
|
4588
|
+
"default": "undefined"
|
|
4589
4589
|
},
|
|
4590
4590
|
{
|
|
4591
4591
|
"name": "hasDraggableColumns",
|
|
@@ -5701,6 +5701,16 @@
|
|
|
5701
5701
|
},
|
|
5702
5702
|
"default": "undefined"
|
|
5703
5703
|
},
|
|
5704
|
+
{
|
|
5705
|
+
"name": "modelValue",
|
|
5706
|
+
"required": false,
|
|
5707
|
+
"description": "Selected date",
|
|
5708
|
+
"value": {
|
|
5709
|
+
"kind": "expression",
|
|
5710
|
+
"type": "union"
|
|
5711
|
+
},
|
|
5712
|
+
"default": "null"
|
|
5713
|
+
},
|
|
5704
5714
|
{
|
|
5705
5715
|
"name": "value",
|
|
5706
5716
|
"required": false,
|
|
@@ -5732,6 +5742,16 @@
|
|
|
5732
5742
|
"default": "false"
|
|
5733
5743
|
}
|
|
5734
5744
|
],
|
|
5745
|
+
"events": [
|
|
5746
|
+
{
|
|
5747
|
+
"name": "update:model-value",
|
|
5748
|
+
"description": "Emitted when the component's model changes."
|
|
5749
|
+
},
|
|
5750
|
+
{
|
|
5751
|
+
"name": "input",
|
|
5752
|
+
"description": "Emitted when the component's model changes."
|
|
5753
|
+
}
|
|
5754
|
+
],
|
|
5735
5755
|
"source": {
|
|
5736
5756
|
"module": "./src/components/date-range-picker/date-range-picker.vue",
|
|
5737
5757
|
"symbol": "default"
|
|
@@ -5739,7 +5759,7 @@
|
|
|
5739
5759
|
},
|
|
5740
5760
|
{
|
|
5741
5761
|
"name": "date-range-picker-calendar",
|
|
5742
|
-
"description": "
|
|
5762
|
+
"description": "",
|
|
5743
5763
|
"attributes": [
|
|
5744
5764
|
{
|
|
5745
5765
|
"name": "allowTimeInput",
|
|
@@ -5866,6 +5886,14 @@
|
|
|
5866
5886
|
"symbol": "default"
|
|
5867
5887
|
}
|
|
5868
5888
|
},
|
|
5889
|
+
{
|
|
5890
|
+
"name": "date-range-picker-default-example",
|
|
5891
|
+
"description": "",
|
|
5892
|
+
"source": {
|
|
5893
|
+
"module": "./src/components/date-range-picker/__tests__/date-range-picker-default-example.vue",
|
|
5894
|
+
"symbol": "default"
|
|
5895
|
+
}
|
|
5896
|
+
},
|
|
5869
5897
|
{
|
|
5870
5898
|
"name": "decorative-checkbox",
|
|
5871
5899
|
"description": "",
|
|
@@ -13048,12 +13076,12 @@
|
|
|
13048
13076
|
],
|
|
13049
13077
|
"events": [
|
|
13050
13078
|
{
|
|
13051
|
-
"name": "
|
|
13052
|
-
"description": "Emitted when
|
|
13079
|
+
"name": "update:model-value",
|
|
13080
|
+
"description": "Emitted when the component's model changes."
|
|
13053
13081
|
},
|
|
13054
13082
|
{
|
|
13055
|
-
"name": "
|
|
13056
|
-
"description": "Emitted when
|
|
13083
|
+
"name": "input",
|
|
13084
|
+
"description": "Emitted when the component's model changes."
|
|
13057
13085
|
}
|
|
13058
13086
|
],
|
|
13059
13087
|
"slots": [
|
|
@@ -14279,12 +14307,12 @@
|
|
|
14279
14307
|
],
|
|
14280
14308
|
"events": [
|
|
14281
14309
|
{
|
|
14282
|
-
"name": "
|
|
14283
|
-
"description": "Emitted when the
|
|
14310
|
+
"name": "update:model-value",
|
|
14311
|
+
"description": "Emitted when the component's model changes."
|
|
14284
14312
|
},
|
|
14285
14313
|
{
|
|
14286
|
-
"name": "
|
|
14287
|
-
"description": "Emitted when the
|
|
14314
|
+
"name": "input",
|
|
14315
|
+
"description": "Emitted when the component's model changes."
|
|
14288
14316
|
}
|
|
14289
14317
|
],
|
|
14290
14318
|
"slots": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adyen/bento-vue2",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.78.0",
|
|
4
4
|
"description": "Adyen Bento Vue2 components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"unified": "11.0.5",
|
|
49
49
|
"uuid": "11.0.5",
|
|
50
50
|
"vue-demi": "0.14.10",
|
|
51
|
-
"@adyen/bento-design-tokens": "1.
|
|
51
|
+
"@adyen/bento-design-tokens": "1.78.0"
|
|
52
52
|
},
|
|
53
53
|
"dependenciesMeta": {
|
|
54
54
|
"@adyen/bento-vue-i18n-demi": {
|
|
@@ -127,12 +127,12 @@
|
|
|
127
127
|
"vue-style-loader": "4.1.3",
|
|
128
128
|
"vue-template-compiler": "2.7.16",
|
|
129
129
|
"vue-tsc": "1.0.24",
|
|
130
|
-
"@adyen/bento-cli": "0.7.
|
|
130
|
+
"@adyen/bento-cli": "0.7.3",
|
|
131
131
|
"@adyen/bento-core": "0.0.1",
|
|
132
|
-
"@adyen/bento-tailwind": "0.7.
|
|
132
|
+
"@adyen/bento-tailwind": "0.7.3",
|
|
133
133
|
"@adyen/bento-vue-i18n-demi": "0.1.0",
|
|
134
|
-
"@adyen/ui-assets-icons-16": "7.3.
|
|
135
|
-
"@adyen/ui-assets-payment-method-icons": "10.4.
|
|
134
|
+
"@adyen/ui-assets-icons-16": "7.3.3",
|
|
135
|
+
"@adyen/ui-assets-payment-method-icons": "10.4.3"
|
|
136
136
|
},
|
|
137
137
|
"optionalDependencies": {
|
|
138
138
|
"vue-router": "~3.6"
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { defineComponent as y, toRef as _, computed as l, watch as c, ref as v } from "vue";
|
|
2
|
-
import { a as n, B as E } from "./checkbox.itbBlXev.js";
|
|
3
|
-
import { g as x } from "./generate-uid.NJ8tVoha.js";
|
|
4
|
-
import { d as k } from "./typography.hlOAxsEn.js";
|
|
5
|
-
import { u as C } from "./use-form-layout-loading.D3lALhtC.js";
|
|
6
|
-
import { E as S } from "./field-label.Auq-Pzho.js";
|
|
7
|
-
import { C as M } from "./controls-group.82mB_GDw.js";
|
|
8
|
-
import { n as I } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
9
|
-
import "../assets/checkbox-group.css";
|
|
10
|
-
var s = /* @__PURE__ */ ((r) => (r.HORIZONTAL = "horizontal", r.VERTICAL = "vertical", r))(s || {});
|
|
11
|
-
const p = "bento-checkbox-group", T = y({
|
|
12
|
-
name: p,
|
|
13
|
-
components: { BentoCheckbox: E, ControlsGroup: M, ErrorMessage: S },
|
|
14
|
-
model: { prop: "modelValue" },
|
|
15
|
-
props: {
|
|
16
|
-
/**
|
|
17
|
-
* Descriptive supporting text visbile underneath the label.
|
|
18
|
-
*/
|
|
19
|
-
description: { type: String, default: null },
|
|
20
|
-
/**
|
|
21
|
-
* If set to true, renders all checkboxes in the group in a disabled state.
|
|
22
|
-
*/
|
|
23
|
-
disabled: { type: Boolean, default: !1 },
|
|
24
|
-
/**
|
|
25
|
-
* Renders all checkboxes in an error state with an error message.
|
|
26
|
-
*/
|
|
27
|
-
errorMessage: { type: String, default: null },
|
|
28
|
-
/**
|
|
29
|
-
* The form id the checkbox group is associated with. Defaults to null, as a checkbox group can also be used standalone.
|
|
30
|
-
*/
|
|
31
|
-
formId: { type: String, default: null },
|
|
32
|
-
/**
|
|
33
|
-
* If set to true, renders all checkboxes in the group in an error state.
|
|
34
|
-
*
|
|
35
|
-
* @deprecated Use "errorMessage" prop instead
|
|
36
|
-
*/
|
|
37
|
-
hasError: { type: Boolean, default: !1 },
|
|
38
|
-
/**
|
|
39
|
-
* Shows/hides the group label.
|
|
40
|
-
*/
|
|
41
|
-
hideLabel: { type: Boolean, default: null },
|
|
42
|
-
/**
|
|
43
|
-
* The checkbox group's items.
|
|
44
|
-
*/
|
|
45
|
-
items: { type: Array, required: !0 },
|
|
46
|
-
/**
|
|
47
|
-
* The name associated with the group. Required for accessibility purposes.
|
|
48
|
-
*/
|
|
49
|
-
label: { type: String, required: !0 },
|
|
50
|
-
/**
|
|
51
|
-
* Determines the initially selected value of the group. Corresponds to the BentoCheckboxButtonItem's value.
|
|
52
|
-
* Defaults to no value selected.
|
|
53
|
-
*/
|
|
54
|
-
modelValue: { type: Array, default: () => [] },
|
|
55
|
-
/**
|
|
56
|
-
* Indicates the field is optional.
|
|
57
|
-
*/
|
|
58
|
-
optional: { type: Boolean, default: !1 },
|
|
59
|
-
/**
|
|
60
|
-
* If set to true, renders all checkboxes in the group in a readonly state.
|
|
61
|
-
*/
|
|
62
|
-
readonly: { type: Boolean, default: !1 },
|
|
63
|
-
/**
|
|
64
|
-
* Indicates the field is required.
|
|
65
|
-
*/
|
|
66
|
-
required: { type: Boolean, default: !1 },
|
|
67
|
-
/**
|
|
68
|
-
* Tooltip message.
|
|
69
|
-
*/
|
|
70
|
-
tooltipText: { type: String, default: null },
|
|
71
|
-
/**
|
|
72
|
-
* The checkbox group's layout. It can be vertical or horizontal. Defaults to vertical.
|
|
73
|
-
*/
|
|
74
|
-
variant: {
|
|
75
|
-
type: String,
|
|
76
|
-
default: s.VERTICAL,
|
|
77
|
-
validator: (r) => Object.values(s).includes(r)
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
emits: [n.UPDATE, n.INPUT],
|
|
81
|
-
setup(r, { emit: e, slots: a }) {
|
|
82
|
-
const o = x("error"), { isReadOnly: u } = C(_(r, "readonly")), f = l(
|
|
83
|
-
() => !r.disabled && !u.value && (!!r.errorMessage || r.hasError)
|
|
84
|
-
), h = l(
|
|
85
|
-
() => !r.disabled && !u.value && !!r.errorMessage
|
|
86
|
-
), b = l(() => ({
|
|
87
|
-
"b-checkbox-group__checkboxes--horizontal": r.variant === s.HORIZONTAL
|
|
88
|
-
})), i = (t) => !!a[t], m = l(() => i("content") && r.variant !== "vertical");
|
|
89
|
-
c(
|
|
90
|
-
m,
|
|
91
|
-
(t) => {
|
|
92
|
-
if (t)
|
|
93
|
-
throw new Error("The content slot is only available for the vertical checkbox group layout");
|
|
94
|
-
},
|
|
95
|
-
{ immediate: !0 }
|
|
96
|
-
);
|
|
97
|
-
const d = v(r.modelValue);
|
|
98
|
-
c(
|
|
99
|
-
() => r.modelValue,
|
|
100
|
-
() => {
|
|
101
|
-
d.value = r.modelValue;
|
|
102
|
-
}
|
|
103
|
-
);
|
|
104
|
-
const g = (t) => {
|
|
105
|
-
d.value = t, e(n.UPDATE, t), e(n.INPUT, t);
|
|
106
|
-
};
|
|
107
|
-
return r.hasError && k(
|
|
108
|
-
'BentoCheckboxGroup "hasError" property',
|
|
109
|
-
`Use the BentoCheckboxGroup "errorMessage" property instead to indicate that there is a modifier error.
|
|
110
|
-
Having the field as "undefined" will hide/remove the error.
|
|
111
|
-
<bento-checkbox-group errorMessage="Error message text" />`,
|
|
112
|
-
"2.0.0"
|
|
113
|
-
), {
|
|
114
|
-
// Values
|
|
115
|
-
COMPONENT_NAME: p,
|
|
116
|
-
errorId: o,
|
|
117
|
-
isReadOnly: u,
|
|
118
|
-
shouldShowGroupError: f,
|
|
119
|
-
shouldShowGroupErrorMessage: h,
|
|
120
|
-
conditionalClasses: b,
|
|
121
|
-
inputValue: d,
|
|
122
|
-
hasContentSlot: i,
|
|
123
|
-
// Methods
|
|
124
|
-
onInput: g
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
var w = function() {
|
|
129
|
-
var e = this, a = e._self._c;
|
|
130
|
-
return e._self._setupProxy, a("div", { staticClass: "b-checkbox-group" }, [a("controls-group", { staticClass: "b-checkbox-group__checkboxes", class: e.conditionalClasses, attrs: { "aria-describedby": e.shouldShowGroupErrorMessage ? e.errorId : "", "component-name": e.COMPONENT_NAME, description: e.description, disabled: e.disabled, form: e.formId, "hide-label": e.hideLabel, label: e.label, optional: e.optional, required: e.required, "tooltip-text": e.tooltipText } }, e._l(e.items, function(o) {
|
|
131
|
-
return a("bento-checkbox", { key: o.value, attrs: { "model-value": e.inputValue, value: o.value, disabled: e.disabled || o.disabled, "has-error": e.shouldShowGroupError || o.hasError, "error-message": e.shouldShowGroupError ? null : o.errorMessage, readonly: e.isReadOnly || o.readonly, tag: o.tag }, on: { "update:model-value": e.onInput }, scopedSlots: e._u([{ key: "default", fn: function() {
|
|
132
|
-
return [e._v(e._s(o.label))];
|
|
133
|
-
}, proxy: !0 }, o.description ? { key: "description", fn: function() {
|
|
134
|
-
return [e._v(e._s(o.description))];
|
|
135
|
-
}, proxy: !0 } : null, e.hasContentSlot("content") ? { key: "content", fn: function() {
|
|
136
|
-
return [e._t("content", null, null, o)];
|
|
137
|
-
}, proxy: !0 } : null], null, !0) });
|
|
138
|
-
}), 1), e.shouldShowGroupErrorMessage ? a("error-message", { staticClass: "b-checkbox-group__error-message", attrs: { id: e.errorId, "error-message": e.errorMessage } }) : e._e()], 1);
|
|
139
|
-
}, B = [], O = /* @__PURE__ */ I(
|
|
140
|
-
T,
|
|
141
|
-
w,
|
|
142
|
-
B,
|
|
143
|
-
!1,
|
|
144
|
-
null,
|
|
145
|
-
"66fbd49c"
|
|
146
|
-
);
|
|
147
|
-
const q = O.exports;
|
|
148
|
-
export {
|
|
149
|
-
s as B,
|
|
150
|
-
q as c
|
|
151
|
-
};
|
|
152
|
-
//# sourceMappingURL=checkbox-group.C3RH5Gcg.js.map
|