@dasidev/dasi-ui 1.0.22 → 1.0.23

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
@@ -1,5 +1,408 @@
1
- # Vue 3 + TypeScript + Vite
1
+ <!-- # Vue 3 + TypeScript + Vite
2
2
 
3
3
  This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
4
4
 
5
- Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).
5
+ Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup). -->
6
+
7
+ # @dasidev/dasi-ui
8
+
9
+ A starter Vue 3 + TypeScript framework for building configurable, enterprise-ready web apps. It ships with a configuration-driven architecture, unified components, and type-safe development. Forms are powered by Vueform, which serves as the built-in form builder across the project.
10
+
11
+ ## 🚀 Quick Start
12
+
13
+ Make sure you guys use node v20 or above
14
+
15
+ ### Create New Project
16
+
17
+ ```sh
18
+ # Using npm (recommended)
19
+ npx @dasidev/dasi-ui create my-admin-app
20
+
21
+ # Using yarn
22
+ yarn create @dasidev/dasi-ui my-admin-app
23
+
24
+ # Using pnpm
25
+ pnpm create @dasidev/dasi-ui my-admin-app
26
+ ```
27
+ <!--
28
+ ### Install as Library
29
+
30
+ ```sh
31
+ # Using npm
32
+ npm install @dasidev/dasi-ui
33
+
34
+ # Using yarn
35
+ yarn add @dasidev/dasi-ui
36
+
37
+ # Using pnpm
38
+ pnpm add @dasidev/dasi-ui
39
+ ``` -->
40
+
41
+ ### Requirements
42
+ - Node.js: v20 or above
43
+ -Package Manager: npm v10+, yarn, or pnpm
44
+
45
+ ## 📦 Usage
46
+
47
+ ```sh
48
+ # Create new project with interactive setup
49
+ npx @dasidev/dasi-ui create my-admin-app
50
+
51
+ # Follow the prompts to configure:
52
+ # - Project title and description
53
+ # - Template (default/minimal/full)
54
+ # - Features (auth, charts, maps, forms)
55
+ # - Package manager
56
+ # - TypeScript support
57
+ # - API configuration
58
+ # - Dark mode
59
+
60
+ # Navigate to project directory
61
+ cd my-admin-app
62
+
63
+ # Install dependencies
64
+ npm install
65
+
66
+ # Run development server
67
+ npm run dev
68
+ ```
69
+ <!--
70
+ ### As Component Library
71
+ ``` typescript
72
+ <template>
73
+ <DasiApp>
74
+ <PageActivity endpoint="/users" />
75
+ </DasiApp>
76
+ </template>
77
+
78
+ <script setup>
79
+ import { DasiApp, PageActivity } from '@dasidev/dasi-ui'
80
+ import '@dasidev/dasi-ui/style.css'
81
+ </script>
82
+ ``` -->
83
+
84
+ ## 🏗️ Architecture Overview
85
+
86
+ This framework follows a **configuration-driven architecture** where pages are defined through schemas and configurations, making it highly reusable and maintainable.
87
+
88
+ <!-- ### Core Flow
89
+
90
+ ```
91
+ Route → PageActivity → Schema → Table → DataTableCell
92
+ ↓ ↓ ↓ ↓ ↓
93
+ Config → PageConfig → Columns → Render → Display
94
+ ```
95
+
96
+ ### Key Components
97
+
98
+ - **PageActivity.vue** - Main page container
99
+ - **DataTable.vue** - Unified table component
100
+ - **DataTableCell.vue** - Smart cell renderer
101
+ - **BaseSelector.vue** - Unified selector component
102
+ - **DateSelectorElement.vue** - Unified date picker -->
103
+
104
+ ## 📋 Configuration System
105
+
106
+ ### 1. Application Configuration
107
+
108
+ Create your app configuration in `src/config/my-app.config.ts`:
109
+
110
+ ```typescript
111
+ export default {
112
+ app: {
113
+ name: "My Application",
114
+ version: "1.0.2"
115
+ },
116
+ api: {
117
+ baseUrl: process.env.VITE_API_URL || "http://localhost:3000/api",
118
+ timeout: 10000
119
+ },
120
+ branding: {
121
+ companyName: "My Company",
122
+ logo: "/logo.svg"
123
+ }
124
+ }
125
+ ```
126
+
127
+ ### 2. Page Configuration
128
+
129
+ Create page-specific configs in `src/vueform/config/{endpoint}.ts`:
130
+
131
+ ```typescript
132
+ export default {
133
+ endpoint: "/users",
134
+ title: "User Management",
135
+ columns: [
136
+ { key: "name", header: "Name", visible: true },
137
+ { key: "email", header: "Email", visible: true }
138
+ ]
139
+ }
140
+ ```
141
+
142
+ ### 3. Form Schema
143
+
144
+ Define your form schemas in `src/vueform/schemas/{pageCode}/{schema}.ts`:
145
+
146
+ ```typescript
147
+ export default {
148
+ schema: {
149
+ name: {
150
+ type: "text",
151
+ label: "Full Name",
152
+ rules: ["required"],
153
+ showInTable: true
154
+ },
155
+ organizationId: {
156
+ type: "selector",
157
+ endpoint: "/organizations",
158
+ label: "Organization",
159
+ showAvatar: true,
160
+ condition: { levels: "admin" },
161
+ showInTable: true
162
+ },
163
+ birthDate: {
164
+ type: "date_selector",
165
+ label: "Birth Date",
166
+ pickerType: "date",
167
+ showInTable: true
168
+ }
169
+ }
170
+ }
171
+ ```
172
+
173
+ ## 🎯 Unified Components
174
+
175
+ ### BaseSelector
176
+
177
+ A unified selector component that handles all selection needs:
178
+
179
+ ```typescript
180
+ // Single selection
181
+ {
182
+ type: "selector",
183
+ endpoint: "/users",
184
+ showAvatar: true,
185
+ nameField: "name"
186
+ }
187
+
188
+ // Multiple selection
189
+ {
190
+ type: "selector",
191
+ endpoint: "/users",
192
+ multiple: true,
193
+ showAvatar: true,
194
+ returnObject: true
195
+ }
196
+
197
+ // With conditions and sorting
198
+ {
199
+ type: "selector",
200
+ endpoint: "/organizations",
201
+ condition: { levels: "admin" },
202
+ orderBy: "name",
203
+ sort: "asc"
204
+ }
205
+ ```
206
+
207
+ ### DateSelectorElement
208
+
209
+ A unified date picker supporting all date types:
210
+
211
+ ```typescript
212
+ // Single date
213
+ {
214
+ type: "date_selector",
215
+ pickerType: "date",
216
+ label: "Select Date"
217
+ }
218
+
219
+ // Date range
220
+ {
221
+ type: "date_selector",
222
+ pickerType: "date",
223
+ range: true,
224
+ label: "Select Date Range"
225
+ }
226
+
227
+ // DateTime with time picker
228
+ {
229
+ type: "date_selector",
230
+ pickerType: "datetime",
231
+ enableTimePicker: true,
232
+ label: "Select Date & Time"
233
+ }
234
+
235
+ // Month picker
236
+ {
237
+ type: "date_selector",
238
+ pickerType: "month",
239
+ label: "Select Month"
240
+ }
241
+
242
+ // Year picker
243
+ {
244
+ type: "date_selector",
245
+ pickerType: "year",
246
+ yearRange: [2020, 2030],
247
+ label: "Select Year"
248
+ }
249
+ ```
250
+
251
+ ## 📊 Table System
252
+
253
+ ### Automatic Column Generation
254
+
255
+ The framework automatically generates table columns from your form schema:
256
+
257
+ ```typescript
258
+ // Schema definition
259
+ {
260
+ name: {
261
+ type: "text",
262
+ label: "Name",
263
+ showInTable: true,
264
+ textAlign: "left"
265
+ },
266
+ organizationId: {
267
+ type: "selector",
268
+ endpoint: "/organizations",
269
+ showAvatar: true,
270
+ showInTable: true
271
+ }
272
+ }
273
+
274
+ // Automatically becomes table columns
275
+ // - Name (text column)
276
+ // - Organization (selector with avatar)
277
+ ```
278
+
279
+ ### Cell Types
280
+
281
+ The `DataTableCell.vue` component automatically handles different cell types:
282
+
283
+ - **`text`** - Plain text display
284
+ - **`selector`** - Selector with avatar support
285
+ - **`date_selector`** - Date picker with all variants
286
+ - **`toggle`** - Boolean toggle display
287
+ - **`checkboxgroup`** - Checkbox group display
288
+ - **`radiogroup`** - Radio group display
289
+ - **`select`** - Select dropdown display
290
+
291
+ ## 🔧 Development Workflow
292
+
293
+ ### 1. Create New Page
294
+
295
+ 1. **Add Route**: Define route in `src/router/index.ts`
296
+ 2. **Create Schema**: Add schema in `src/vueform/schemas/{pageCode}/`
297
+ 3. **Create Config**: Add page config in `src/vueform/config/`
298
+ 4. **Test**: The page will automatically work with the framework
299
+
300
+ ### 2. Add New Field
301
+
302
+ 1. **Define in Schema**: Add field to your form schema
303
+ 2. **Set Properties**: Configure `showInTable`, `cellType`, etc.
304
+ 3. **Test**: Field automatically appears in both form and table
305
+
306
+ ### 3. Custom Cell Rendering
307
+
308
+ ```typescript
309
+ // Custom cell renderer
310
+ {
311
+ name: {
312
+ type: "text",
313
+ cellRender: (i: number, row: any) => {
314
+ return `<strong>${row.name}</strong>`;
315
+ }
316
+ }
317
+ }
318
+ ```
319
+
320
+ ## 🎨 Styling & Theming
321
+
322
+ ### Tailwind CSS
323
+
324
+ The framework uses Tailwind CSS with custom configuration:
325
+
326
+ - **Dark Mode**: Automatic dark mode support
327
+ - **Custom Colors**: Brand-specific color schemes
328
+ - **Responsive**: Mobile-first responsive design
329
+
330
+ ### Component Styling
331
+
332
+ Components are styled with Tailwind classes and support:
333
+
334
+ - **Hover States**: Interactive hover effects
335
+ - **Focus States**: Keyboard navigation support
336
+ - **Disabled States**: Proper disabled styling
337
+ - **Loading States**: Loading indicators
338
+
339
+ ## 🎯 CLI Features
340
+
341
+ The CLI provides interactive setup with:
342
+ - Template Selection: Default, Minimal, or Full-featured
343
+ - Feature Toggles: Authentication, Charts, Maps, Forms
344
+ - Package Manager: npm, yarn, or pnpm
345
+ - TypeScript: Optional TypeScript support
346
+ - API Configuration: Custom API endpoints
347
+ - Theming: Dark mode support
348
+
349
+ Available Templates
350
+ - Default - Complete admin dashboard with all core features
351
+ - Minimal - Basic admin setup with essential components
352
+ - Full - All features including charts, maps, and advanced forms
353
+
354
+ ## 📚 Key Libraries
355
+
356
+ - **Vue 3** - Main framework with Composition API
357
+ - **TypeScript** - Type safety and better DX
358
+ - **Tailwind CSS** - Utility-first CSS framework
359
+ - **Shadcn-vue** - Component library
360
+ - **Lucide Vue** - Icon library
361
+ - **Vueform** - Form handling
362
+ - **Pinia** - State management
363
+ - **Vue Router** - Client-side routing
364
+ - **Axios** - HTTP client
365
+ - **Moment.js** - Date manipulation
366
+
367
+ ## 🤝 Contribution
368
+
369
+ 1. **Clone** the repository
370
+ 2. **Create** a new branch for your feature: `git checkout -b feature-name`
371
+ 3. **Develop** your feature following the framework patterns
372
+ 4. **Test** your changes thoroughly
373
+ 5. **Create** a pull request to the `dev` branch
374
+
375
+ ### Branch Naming
376
+
377
+ Use descriptive branch names:
378
+ - `feature/user-management`
379
+ - `fix/date-picker-bug`
380
+ - `enhancement/table-performance`
381
+
382
+ ## 📖 Documentation
383
+
384
+ - **Framework Guide**: See `FRAMEWORK_GUIDE.md` for detailed documentation
385
+ - **Quick Start**: See `QUICK_START.md` for getting started
386
+ - **API Reference**: Check component documentation in code
387
+
388
+ ## 🔧 Customization
389
+
390
+ ### Environment Variables
391
+
392
+ Create `.env.local`:
393
+
394
+ ```env
395
+ VITE_API_URL=http://localhost:3000/api
396
+ VITE_APP_NAME=My Application
397
+ VITE_COMPANY_NAME=My Company
398
+ ```
399
+
400
+ 🚀 Ready to build your next admin dashboard? Start with npx @dasidev/dasi-ui create my-app!
401
+
402
+ ### Vite Configuration
403
+
404
+ See [Vite Configuration Reference](https://vitejs.dev/config/) for advanced configuration options.
405
+
406
+ ---
407
+
408
+ **Built with ❤️ using Vue 3, TypeScript, and modern web technologies.**