ソースを参照

refactor out from TextFilter

Jason Gorst 1 ヶ月 前
コミット
85f50aa40a
2 ファイル変更22 行追加0 行削除
  1. 19 0
      app/utils/matchModes.js
  2. 3 0
      app/utils/nameFromMatchMode.js

+ 19 - 0
app/utils/matchModes.js

@@ -0,0 +1,19 @@
+import { FilterMatchMode } from "@primevue/core/api"
+
+export const matchModes = [
+  {
+    name: "starts with",
+    icon: "ph:arrow-line-left-bold",
+    matchMode: FilterMatchMode.STARTS_WITH
+  },
+  {
+    name: "contains",
+    icon: "ph:dots-three-outline-fill",
+    matchMode: FilterMatchMode.CONTAINS
+  },
+  {
+    name: "ends with",
+    icon: "ph:arrow-line-right-bold",
+    matchMode: FilterMatchMode.ENDS_WITH
+  }
+]

+ 3 - 0
app/utils/nameFromMatchMode.js

@@ -0,0 +1,3 @@
+export default function nameFromMatchMode(matchMode) {
+  return _find(matchModes, { matchMode }).name
+}