Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Commit 286cc08

Browse files
authored
Custom Select (#9)
1 parent 1f26c13 commit 286cc08

26 files changed

+4825
-30
lines changed

Diff for: .gitattributes

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@
1111
/phpunit.xml.dist export-ignore
1212
/psalm.xml.dist export-ignore
1313
/tests export-ignore
14-
14+
/babel.config.js export-ignore
15+
/package.json export-ignore
16+
/package-lock.json export-ignore
17+
/rollup.config.js export-ignore

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ coverage
88
phpunit.xml
99
psalm.xml
1010
vendor
11+
/node_modules

Diff for: babel.config.js

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
module.exports = {
2+
presets: [
3+
[
4+
'@babel/preset-env',
5+
{
6+
targets: {
7+
node: 'current',
8+
edge: '18',
9+
ie: "11",
10+
},
11+
},
12+
],
13+
],
14+
plugins: [
15+
"@babel/plugin-proposal-object-rest-spread",
16+
],
17+
env: {
18+
test: {
19+
presets: [
20+
[
21+
'@babel/preset-env',
22+
{
23+
targets: {
24+
node: 'current',
25+
},
26+
}
27+
]
28+
]
29+
}
30+
}
31+
};

Diff for: composer.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
"blade-ui-kit/blade-heroicons": "^0.2.1",
3232
"friendsofphp/php-cs-fixer": "^2.16",
3333
"gajus/dindent": "^2.0",
34-
"orchestra/testbench": "^6.0",
35-
"phpunit/phpunit": "^9.3",
34+
"orchestra/testbench": "^6.2",
35+
"phpunit/phpunit": "^9.4",
3636
"psalm/plugin-laravel": "^1.4",
37-
"vimeo/psalm": "^3.11"
37+
"vimeo/psalm": "^4.0"
3838
},
3939
"autoload": {
4040
"psr-4": {
@@ -62,7 +62,10 @@
6262
"laravel": {
6363
"providers": [
6464
"Rawilk\\FormComponents\\FormComponentsServiceProvider"
65-
]
65+
],
66+
"aliases": {
67+
"FormComponents": "Rawilk\\FormComponents\\Facades\\FormComponents"
68+
}
6669
}
6770
},
6871
"minimum-stability": "dev",

Diff for: config/form-components.php

+52
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,32 @@
6868
'view' => 'form-components::components.inputs.select',
6969
],
7070

71+
'custom-select' => [
72+
'class' => Components\Inputs\CustomSelect::class,
73+
'view' => 'form-components::components.inputs.custom-select',
74+
75+
// This icon will be shown on an option when it is selected.
76+
'selected_icon' => 'heroicon-s-check',
77+
78+
/*
79+
* This icon will be shown on a selected option on a select
80+
* that allows clearing the value to indicate the option
81+
* can be de-selected.
82+
*/
83+
'uncheck_icon' => 'heroicon-o-x-circle',
84+
85+
/*
86+
* This icon will be shown when an option is selected
87+
* and the "optional" attribute is set to true.
88+
*/
89+
'clear_icon' => 'heroicon-o-x',
90+
],
91+
92+
'custom-select-option' => [
93+
'class' => Components\Inputs\CustomSelectOption::class,
94+
'view' => 'form-components::components.inputs.custom-select-option',
95+
],
96+
7197
'label' => [
7298
'class' => Components\Label::class,
7399
'view' => 'form-components::components.label',
@@ -188,4 +214,30 @@
188214
],
189215
],
190216

217+
/*
218+
|--------------------------------------------------------------------------
219+
| Enable Third Party Assets
220+
|--------------------------------------------------------------------------
221+
|
222+
| Set this to false to disable linking to third-party CDNs from
223+
| the 'assets' key in this config. This is ignored if you pass `true`
224+
| to either `@fcScripts` or `@fcStyles` directives.
225+
|
226+
*/
227+
'link_vendor_cdn_assets' => env('FC_LINK_VENDOR_CDN_ASSETS', null),
228+
229+
/*
230+
|--------------------------------------------------------------------------
231+
| FormComponents Assets URL
232+
|--------------------------------------------------------------------------
233+
|
234+
| This value sets the path to the FormComponents JavaScript assets, for cases
235+
| where your app's domain root is not the correct path. By default,
236+
| FormComponents will load its JavaScript assets from the app's
237+
| "relative root".
238+
|
239+
| Examples: "/assets", "myapp.com/app",
240+
|
241+
*/
242+
'asset_url' => null,
191243
];

Diff for: dist/form-components.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/form-components.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/manifest.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"/form-components.js":"/form-components.js?id=463675fb6a026cc94be2"}

0 commit comments

Comments
 (0)