nicklabs-ui 1.0.35 → 1.0.37

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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  A Vue 3 component library with glassmorphism design, built for modern web applications.
4
4
 
5
- **Version**: 1.0.34 | **Framework**: Vue 3.5+
5
+ **Version**: 1.0.36 | **Framework**: Vue 3.5+
6
6
 
7
7
  ---
8
8
 
@@ -28,6 +28,7 @@ A Vue 3 component library with glassmorphism design, built for modern web applic
28
28
  - [NCode](#ncode)
29
29
  - [Modals & Overlays](#modals--overlays)
30
30
  - [NModal](#nmodal)
31
+ - [NDrawer](#ndrawer)
31
32
  - [NAlert](#nalert)
32
33
  - [NToast](#ntoast)
33
34
  - [NTooltip](#ntooltip)
@@ -728,14 +729,20 @@ A full-featured data management component combining table, pagination, filtering
728
729
  | `itemKey` | `string` | `"id"` | Unique key field |
729
730
  | `pageSize` | `number` | `10` | Items per page |
730
731
  | `maxPageButtons` | `number` | `7` | Visible page buttons |
731
- | `filterable` | `boolean` | `false` | Show filter button |
732
+ | `creatable` | `boolean` | `false` | Show create button |
733
+ | `createLabel` | `string` | `"新增"` | Create button label |
732
734
  | `updatable` | `boolean` | `false` | Show row edit button |
735
+ | `updateLabel` | `string` | `"編輯"` | Edit button label |
733
736
  | `deletable` | `boolean` | `false` | Show row delete button |
734
- | `creatable` | `boolean` | `false` | Show create button |
737
+ | `deleteLabel` | `string` | `"刪除"` | Delete button label |
735
738
  | `batchDeletable` | `boolean` | `false` | Enable batch delete with checkboxes |
739
+ | `batchDeleteLabel` | `string` | `"批量刪除"` | Batch delete button label |
740
+ | `filterable` | `boolean` | `false` | Show filter button |
741
+ | `filterLabel` | `string` | `"篩選"` | Filter button label |
736
742
  | `refreshable` | `boolean` | `false` | Show refresh button |
743
+ | `refreshLabel` | `string` | `"重新整理"` | Refresh button label |
737
744
  | `emptyTitle` | `string` | `"目前沒有資料"` | Empty state title |
738
- | `emptyDescription` | `string` | | Empty state description |
745
+ | `emptyDescription` | `string` | `"可以點擊上方的按鈕來新增資料或重新整理"` | Empty state description |
739
746
  | `emptyIcon` | `string` | — | Custom SVG string for empty state |
740
747
 
741
748
  **Events**
@@ -964,6 +971,69 @@ function confirm() {
964
971
 
965
972
  ---
966
973
 
974
+ #### NDrawer
975
+
976
+ A teleported side drawer that slides in from the right or left edge of the viewport.
977
+
978
+ **Props**
979
+
980
+ | Prop | Type | Default | Description |
981
+ |------|------|---------|-------------|
982
+ | `show` | `boolean` | `false` | Visibility (v-model:show) |
983
+ | `title` | `string` | — | Drawer title |
984
+ | `width` | `string` | `"380px"` | Drawer width |
985
+ | `placement` | `"right" \| "left"` | `"right"` | Which side to slide in from |
986
+ | `closeOnClickOverlay` | `boolean` | `true` | Close when backdrop clicked |
987
+ | `showClose` | `boolean` | `true` | Show close button |
988
+ | `zIndex` | `number` | `1000` | Custom z-index |
989
+
990
+ **Events**
991
+
992
+ | Event | Description |
993
+ |-------|-------------|
994
+ | `update:show` | Visibility changed |
995
+ | `close` | Drawer closed |
996
+ | `open` | Drawer opened |
997
+
998
+ **Slots**
999
+
1000
+ | Slot | Description |
1001
+ |------|-------------|
1002
+ | `default` | Drawer body content |
1003
+ | `title` | Override the title area |
1004
+ | `footer` | Footer actions area (renders footer only when provided) |
1005
+
1006
+ **Usage**
1007
+
1008
+ ```vue
1009
+ <template>
1010
+ <NButton @click="isOpen = true">Open Drawer</NButton>
1011
+
1012
+ <NDrawer v-model:show="isOpen" title="Edit Item">
1013
+ <NInput v-model="name" title="Name" placeholder="Enter name" />
1014
+
1015
+ <template #footer>
1016
+ <NButton variant="outline" @click="isOpen = false">Cancel</NButton>
1017
+ <NButton variant="solid" intent="primary" @click="save">Save</NButton>
1018
+ </template>
1019
+ </NDrawer>
1020
+ </template>
1021
+
1022
+ <script setup>
1023
+ import { ref } from 'vue'
1024
+ import { NDrawer, NButton, NInput } from 'nicklabs-ui'
1025
+
1026
+ const isOpen = ref(false)
1027
+ const name = ref('')
1028
+
1029
+ function save() {
1030
+ isOpen.value = false
1031
+ }
1032
+ </script>
1033
+ ```
1034
+
1035
+ ---
1036
+
967
1037
  #### NAlert
968
1038
 
969
1039
  Programmatic alert and confirm dialogs via the `useAlert` composable.
@@ -1236,10 +1306,10 @@ Form wrapper with optional tab navigation and hero section header.
1236
1306
  |------|------|---------|-------------|
1237
1307
  | `model` | `object` | `{}` | Form data object |
1238
1308
  | `disabled` | `boolean` | `false` | Disable all inputs |
1309
+ | `icon` | `string` | — | Header icon (SVG string) |
1239
1310
  | `title` | `string` | — | Form header title |
1240
1311
  | `description` | `string` | — | Form header description |
1241
- | `icon` | `string` | | Header icon (SVG string) |
1242
- | `tabs` | `string[]` | `[]` | Tab labels for multi-section forms |
1312
+ | `tabs` | `string[]` | `[]` | Tab labels; active tab persisted to localStorage |
1243
1313
 
1244
1314
  **Events**
1245
1315
 
@@ -1252,6 +1322,7 @@ Form wrapper with optional tab navigation and hero section header.
1252
1322
 
1253
1323
  | Slot | Description |
1254
1324
  |------|-------------|
1325
+ | `heroSection` | Replace the entire hero header (rarely needed) |
1255
1326
  | `toolbar` | Toolbar area in the hero header (buttons, etc.) |
1256
1327
  | `description` | Custom description content in hero header |
1257
1328
  | `tab0` | Content for first tab (or only content when no tabs) |
@@ -1606,9 +1677,6 @@ import { useDisclosure } from 'nicklabs-ui'
1606
1677
 
1607
1678
  // Array destructuring
1608
1679
  const [isOpen, open, close] = useDisclosure()
1609
-
1610
- // Object destructuring
1611
- const { isOpen, open, close } = useDisclosure()
1612
1680
  ```
1613
1681
 
1614
1682
  **Usage**