Repository navigation
v2.0.0
·
65 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
The library has been migrated from Vue 2 / webpack 3 to Vue 3.5 and Vite 8. Backward compatibility with 1.x is not preserved; the full migration guide with a step-by-step checklist and ready-made grep commands is in CHANGELOG.md.
Breaking changes
Environment and packaging
- Peer dependency
vue ^3.5; Node ≥ 24 to build. Vue 2 is no longer supported. - ESM-only package with an
exportsmap. UMD buildsdist/at.js/dist/at.min.jsand the globalatare removed. - Locales moved to
@amazingcat/cattr-ui/locale/<lang>(ESM) fromdist/locale/<lang>.js(UMD). - Internal
at-ui/src/...imports are gone; theat-uibundler alias is no longer needed. - The
at-ui-styleworkspace package is renamed tocattr-ui-style(private). Theme customization via$var: …; @importno longer works — use@use '@amazingcat/cattr-ui/src/stylesheet/src/index.scss' with (…).
Installation API
Vue.use(CattrUI, opts)→createApp(App).use(CattrUI, opts). Auto-registration throughwindow.Vueis removed.- Components are exported under
At*names (AtButton,AtSelect, …); the default export is{ install, version }only. Services are available asapp.config.globalProperties.$Message/$Modal/$Notify/$Loadingand as named exportsMessage,Dialog,Notification,LoadingBar. - i18n hook:
app.use(CattrUI, { i18n: (key, values) => … }); the implicitVue.locale/$tprototype detection is removed.
Template API
v-modelon every component now usesmodelValue/update:modelValue(Input, InputNumber, Textarea, Checkbox, CheckboxGroup, Radio, RadioGroup, RadioButton, Select, Switch, Slider, Rate, Modal, Tabs, Collapse, Dropdown, Tooltip, Popover). Manual:value+@inputbindings must become:model-value+@update:model-value.- The
.nativemodifier is gone:@click.native→@click. Button no longer emits its ownclick; consumer listeners fall through to the native<button>. - Input and InputNumber use
inheritAttrs: false:class/stylestay on the wrapper, all other attributes and listeners (@keyup.enter,id,aria-*,data-*) go to the native<input>.@inputon these components is now the native event, not the component's. - Slot syntax
slot="name"→<template #name>(#menuon Dropdown,#titleon Submenu,#header/#footeron Modal,#title/#contenton Popover,#title/#extra/#loadingon Card). - Table column
rendersignature:render: (h, params)→render: ({ item, column, index })withhimported fromvueand Vue 3 VNode format.indexis now the row index (it was the column index due to a shadowed variable). - Select no longer inherits the popover mixin: props
title,content,headerand thetoggleevent are removed;placementsupportstop*/bottom*only. - Event semantics:
on-changeon Select, Rate, Tabs, Textarea andradio-group-changeon RadioGroup fire only on user interaction, not on programmatic value changes. Menuon-selectfires once per click (was once per nesting level). Modal OK emits a singleon-confirm(it used to emiton-cancelafterwards too). - Services:
$Notify(...)returns a close function instead of a component instance. Services must be called afterapp.use(CattrUI)(or afterapp.use(<Service>)).$Modalstatus dialogs default to English titles (Info,Success,Warning,Error). - Removed:
AtForm,AtFormItem(never exported in 1.x) and theirdispatch('AtFormItem', …)plumbing in Input/InputNumber/Textarea. - Styles: Vue 3 transition classes (
-enter-from/-leave-frominstead of-enter/-leave) for custom animations; the grid no longer overrides the global$screen-*variables after import ($screen-sm-maxis 767px, not 991px).
Minor changes
- Prebuilt CSS in the package:
@amazingcat/cattr-ui/style.css,style.min.cssand fonts underdist/css/fonts; Sass is only needed for custom themes. - Styles compile with
sass-embedded; SCSS sources migrated to Sass modules (@use/@forward), theme variables are overridable through@use … with (…), no Dart Sass deprecation warnings. - Named
At*exports enable tree-shaking and per-componentapp.use(AtButton). - Pagination emits
update:currentandupdate:pageSize, enablingv-model:current/v-model:page-size. - Tabs, Collapse and Dropdown now have a two-way
v-model(in 1.x they never emittedinput). - Notification gains
closeAll(); the close functions returned by$Message(...)and$Notify(...)expose.id;close(id)now hides the item and calls itsonClose. $Modal: dialogs are queued and shown one after another;callbackand the returned promise work together; Escape, the close icon and the mask resolve as'cancel';closeOnPressEscis honoured; new propsshowCancelButton,showConfirmButton,inputValue,inputPlaceholder, new eventafter-leave.- Services can be installed standalone (
app.use(Dialog)): Modal registers its own Button/Input dependencies. - Button/ButtonGroup, Radio/RadioGroup, Checkbox/CheckboxGroup, Tabs, Steps, Timeline, Collapse, Menu, Select, Breadcrumb and Dropdown use provide/inject: children work at any depth and react to parent prop changes.
- Keyboard handling uses
event.key(Select, Pagination, Modal); Pagination accepts numpad digits. - LoadingBar:
config({ width })applies to the visible bar;destroy()added. - Documentation site on Vite + vue-router 5 + vue-i18n 11, deployed to GitHub Pages; CI workflow with lint (
--max-warnings 0), Prettier, Vitest with coverage thresholds and a PR coverage comment. - Tooling: ESLint 10 flat config, eslint-plugin-vue 10, Prettier 3, Vitest 5 — 42 spec files, 222 tests.
Patches
- Message:
closeAll()closed only every other message;close(id)removed the message from the stack without hiding it; a message opened fromonClosewas shifted above the viewport. - Notification: same
close/stacking fixes; customiconnow works withouttype. - Modal/Dialog: the dialog queue never worked (every call opened a new dialog); promises hung when the dialog was closed by Escape, the close icon or the mask;
close()in the same tick asalert()/confirm()still showed the dialog; thekeydownlistener was never removed (beforeDestorytypo). - Table: row selection checkbox toggled the wrong row after sorting or on later pages; the "select all" checkbox in fixed-height mode toggled twice per click; the
resizelistener was never removed (beforeDestorytypo);rendercell received the column index instead of the row index. - Tabs: closing an active unnamed pane selected a pane that no longer existed after removal; closing a pane before an active unnamed pane broke the selection;
on-changefired on mount and on programmatic changes. - Select: keyboard navigation only scrolled the list downwards; scroll-into-view depended on
offsetParent; clearing a filterable select left the stale filter applied; thekeydownlistener was never removed. - Collapse: in-place mutations of the bound array (
push,splice) did not update the panes. - InputNumber: external
modelValuechanges were ignored; typed values were discarded;changefired twice per click; emits atmin/maxboundaries preserved. - Rate:
on-changefired twice per click; Textarea: emitted on external value changes. - Popover/Tooltip: not positioned when opened through
v-modelor mounted withmodelValue: true; mixin listeners are now removed on unmount. - Pagination: the upper clamp of the page number was dead code (quickjump accepted
999); root HTML comments made the component a fragment and dropped consumer attributes. - LoadingBar:
start()right afterfinish()/error()was cancelled by the previous hide timer;height: 4px !importantignoredconfig({ width }). - Timeline: the
pendingclass was not removed whenpendingturned off. Steps/Collapse: first render no longer flashes withindex = -1. - Breadcrumb:
separatoris reactive and the first render is no longer empty; clicking without a router no longer throws. - Slider: track width is measured on each event (stale cached width on resize); handle moves immediately on drag.